In the first image. the product costs 99 kr. this it including taxes. so the product numbers are:
product: 88.39 kr
tax 12% 10.61 kr
total 99.00 kr
shipping 23.20 kr
tax 25% 5.80 kr
total 29.00 kr
p + s 111.59 kr
tax total 16.41 kr
order total 128.00 kr
In the second image I added a 25% coupon code and the module shows correct numbers.
99 kr - 25% (24.75) = 74.25 kr
However in the third image the tax is not correct.
When I look at the checkout I display the wrong tax (Moms totalt)
But the total is correct: 103.25 kr
The tax should be:
12% of product after 25% discount:
88.39 - 25% (22.10) = 66.29 kr
66.29 * 12% = 7.96 kr
total = 74.25 kr
shipping = 23.20 kr
shipping tax 25% = 5.80 kr
order total = 103.25 kr
tax total should be:
product 7.96 kr
shipping 5.80 kr
total 13.76 kr (or rounded out to 13.75 kr) *not 16.41 kr
So the results are. The customer pays the correct amount but the business records are calculating too much tax so the business is losing money when it allows coupons.
I get the same results if my coupon uses total instead of percent.
I get the same results tax with or without a discount coupon and with total or percent discount
[attachment cleanup by admin]
It looks like the discount is calculated after tax. I dont think Virtuemart handles before tax, for that you would probably need a coupon extension. AwoCoupon pro can handle it:
http://awodev.com/products/joomla/awocoupon