There is the same problem as in this issue: https://drupal.org/node/1403498. However, a change in weight was not successful and i couldn't fix this.

The subtotal and taxes are charged by the undiscounted face value. Curiously, the product price is displayed with discount while checkout. By calculating the taxes due to the undiscounted subtotal there is a miscalculation and wrong display in checkout form.

Calculation of taxes with discount (in Germany):

-> Product Price without tax
-> Discount
-> ----------------------------------------
-> Subtotal = Product Price without tax - Discount
-> ----------------------------------------
-> VAT = Subtotal * tax Rate
-> Total = Subtotal + VAT

Current Calculation (false):

-> Product Price without tax
-> Discount
-> ----------------------------------------
-> Subtotal = Product Price without tax
-> ----------------------------------------
-> VAT = Subtotal * tax Rate
-> Total = Subtotal + VAT - Discount

I'm thankful for ideas.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lsolesen’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -checkout, -discount

Could you supply a screenshot og the problem and the exact steps to reproduce on a clean install.

lsolesen’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Please reopen with exact steps to reproduce on a clean Commerce Kickstart, if shifting the weights did not solve your problem.

deardagny’s picture

I've been trying to solve this issue for a while (with Sales Tax as opposed to VAT), and following along with https://drupal.org/node/1403498 as well. I'm now testing on a fresh install and see the same problem with tax calculation and adjusting weights of the rules has made no difference. I figured I'd chime in here also...

Using:

- Commerce Kickstart 2.19 base install
- Commerce Discount - Tested both alpha4 and dev versions, as well as this patch: https://www.drupal.org/node/1962484#comment-8803335
- No other contrib modules

I've found that when using a Product Discount, taxes are correctly calculated on the discounted line item, as shown here:

correct

However, when an Order Discount is created, the following incorrect calculation occurs:

incorrect

Tax on the order should be calculated on the total price of products minus the 20% discount, not the original price of $8.00.

Steps to reproduce:

  1. Create a tax rule that applies to any order (10% in my case)
  2. Create an Order Discount of any percentage value (20% off any order in my case)
  3. Adjust the weight of the discount rule(-10) so that it fires before the tax rule (0)
  4. Create a test order

Please let me know if you need any more info. I'd love to know how other people are dealing with this.

deardagny’s picture

Version: 7.x-2.13 » 7.x-2.19
Status: Closed (cannot reproduce) » Active
valentino@digors.com’s picture

Hi everybody,

I am struggling with this bug and I didn't have success so far.
What I've found out is that VAT is calculated right when applying discount if the price DOES NOT include VAT.
If the item price includes VAT, then the discount is calculated right but VAT result is wrong.

mglaman’s picture

Project: Commerce Kickstart » Commerce Discount
Version: 7.x-2.19 » 7.x-1.x-dev

This is actually a bug in Commerce Discount #2202433: Sales tax is calculated before discounts, moving there, should probably be marked as duplicate, or information combined some how. This one seems to have better details than other, though.

mglaman’s picture

Tagging for Commerce sprint

mglaman’s picture

Status: Active » Closed (duplicate)

Marking this as a duplicate of #1962484: Product discounts: Taxes should applied to SUBTOTAL minus DISCOUNT. There's a patch and work being done there. If this isn't the same issue around discounts and tax, please reopen.