Here's is what I want to accomplish:

- There are 2 VAT taxes in my country: VAT1:6.5% & VAT2: 23%. Every product has to be matched with 1 of these 2 VATs (taxonomy term reference field in product type?)
- A discount will always be available, depending on total order's amount (e.g. €0,01-€50,00: -5%, €50,01-€80,00: -8%, €80,01-€110,00: -10% etc)

What I want to accomplish:
- Customer adds products to cart and heads to checkout. According to order's total (addition of products' base prices), the appropriate discount will be applied.
- Final Price = (Products' base prices + their total VATs)*Discount + Shipping Cost

Example:
Shopping cart includes:
- Product 1: €15 base price - 23% VAT
- Product 2: €20 base price - 6.5% VAT
Checkout Process:
- Total base price = €15 + €20 = €35. As a result, the customer will be awarded with a -5% discount (see available discount rates above)
- Order's total including products' VATs = (€15 + €15*0.23) + (€20 + €20*0.065) = €18.45 + €21.3 = €39.75
- The -5% sale scale is applied: €39.75 - €39.75*0.08 = €36.57 and that's what the customer has to pay for the products in his/her cart
- Order's weight is calculated and a shipping flat rate is applied (I have this functionality already working). As a result, the shipping cost is added to €36.57 and we finally get the sum that the customer will have to pay using one of available payment methods.

I would appreciate your suggestions on how to make this happen. Tricky parts are that different products can have different VAT (23% or 6.5%). Also, the discount has first to be calculated depending on base prices and then applied to full (inclusing VAT) prices. It would also be nice if VATs & discount were displayed to customer in order's review.

Comments

ioanmar’s picture

Here's the question posted on drupalcommerce.

iMiksu’s picture

I'm struggling with similar issue, but my business requirements are that discount and VAT rate sums should be displayed correctly in order total summary.

Even if the discount gets calculated with correct conditions, we start to get our taxes summed incorrectly.

This seems to be impossible task, because if I apply taxes before discount, my VAT rate sums are incorrect in total summary. Same goes other way around, if I apply discount (to get VAT sums correct), my Discount sum is incorrect (because it doesn't have VAT included, since it's calculated later).

My business requirements are:

  • Consumers should see all prices with taxes included
  • Consumers see the correct sum of taxes separately (=the sum of taxes of each VAT rate)

Example:

  • VAT rate 10%
  • Product 110 € (inc VAT)
  • Discount -20%

Case 1:

  • Base price: 100 €
  • Add VAT: 10 € (=110 €)
  • Discount: 22 € (=88 €)
  • In summary: VAT: 10 €, Discount: 22 €
  • Problem: 10 € isn't 10% of 88 €

Case 2:

  • Base price: 100 €
  • Discount: 20 € (=80 €)
  • Add VAT: 8 € (=88 €)
  • In summary: VAT: 8 €, Discount: 20 €
  • Problem: 20 € isn't discount of 110 €
  • Problem: 10 € isn't 10% of 88 €
iMiksu’s picture

Finally I resolved my issue by:

  • Applying the discount to original price (taxes included)
  • Re-calculating the tax amount using same discount percentage
  • Creating a VAT discount regression component type which is hided in summary

For this issue I created a sandbox project which does it for you. All you need is to use "Apply discount to line item" when calculating the discounts to products.

http://drupal.org/sandbox/iMiksu/1871090

bojanz’s picture

Status: Active » Fixed

1. You enter prices without VAT when creating the products, then apply VAT conditionally (each tax rate rule can have a condition, this is nicely documented).
2. Discounts with VAT get tricky. You won't be able to do this properly until #1825886: Add rules actions for applying discounts to prices with VAT included gets fixed.
The sandbox in #3 seems to do the same thing that's described in that issue, so I'm guessing it can be used in the meantime.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.