News:

Looking for documentation? Take a look on our wiki

Main Menu

Issue with discount calculations

Started by foadmg, October 21, 2012, 23:27:10 PM

Previous topic - Next topic

foadmg

Some weeks ago we found out a bug regarding the tax row calculation. In the tax row it would show a wrong value, but the total was right (mathematicaly speaking). This got solved with the last update of VM2 to 2.0.12b.

But doing some tests we have realized that the bug is still there when using a DBTax discount.

Here is our example:
We use a 10% VAT and we have added a 10% discount for all the products (let's call it Chirstmas discount). The discount is calculated before VAT and when configuring this discount the value has been set to 10.000 and we use the -%

Now here is what happens in the cart (see the attached file).

For a 3.3 product, this is what should happen:
  3.3€  -0.33 (discount) + (3.3-0.33)*10% (VAT after taking the discount from the product price) ---> 3.3 - 0.33 + 0,30 (0,297 rounded to 0,30) = 3,27€ TOTAL (in our example +3€ shipping vat included=6,27€)

But if you look closely at the example in the picture, the VAT is correctly set, the TOTAL is also correctly calculated, BUT....the discount shows a weird number: -0.36 for discount instead of the -0.33 it should put. But as I said, the TOTAL is correctly calculated: 6,27€ total (shipping included).

I have also attached the same example with 3 products so you can see different numbers.

Just as a reminder, and as I posted at the begining of the topic, this was a mistake we had before upgrading in the Tax row: it would show a wrong number but do a right calculation.

So....anyone knows how to fix this which I understand is a bug?

[attachment cleanup by admin]

Milbo

It is the total discount, with the tax you spare.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/