Hi.
In a shop of ours we're having problems with totals: decimals mismatch...
Given the summary in the attached table, at first you can see that tax sum doesn't match.
On the background, I have a taxable amount of 312,53369, which summed to the tax amount (65,5837) results in a total of 378,11739, which is the unrounded total. But if I consider the taxable amount and apply VAT (21% in our case), the result is 378,16576, which is a 0.04€ gap from the printed value on the order or invoice. This difference is too much, and customers are complaining.
How can I make the visual values being usable in manual calculations? Should I set in configuration all prices to 2 decimals?
thanks
[attachment cleanup by admin]
but 21% of 312,53369 = 65,632074 (not 65,5837) = 378,16576 (there's the 4 cents)
where does the 65,5837 come from?
312.53 add VAT 21% (65.63 ) = 378.16
Quote from: GJC Web Design on February 11, 2013, 17:35:19 PM
where does the 65,5837 come from?
Taxable (288.56369) + Shipping taxable (23.97) = 312.53369
These are from vm database...
thanks
I tried placing the same order with 2 decimals calc all over the config but still having problems. Now in the database I have:
Taxable: 288.57000
Shipment: 23.97
SUM: 312,54
SUM + 21% -> 378,1734
SUM + 65.58 = 378,12
Order tax: 60.55000
Shipment tax: 5.03000
SUM: 65.58
Order total: 378,12
So I still have a mismatch in manual calc....
Order tax: 60.55000
this is wrong - it should be 60.5997
ship tax correct
can you display all the pricing on your product pages to find out at which stage this is happening?
i.e is the tax incl. price correct on the product details - in the cart etc etc -
do a simple round number product so any error is easy to see..
From a quick search in the db I have one row which could be the culprit:
Product item price: 4.54545
Product tax: 0.95
product_item_price+product_tax: 5.49545
product_quantity: 6
(product_item_price+product_tax)*product_quantity: 32.97270
product_subtotal_with_tax: 33.00
Now the problem is to understand why...
Other lines are ok, even other lines with qty>1
Apparently item tax is calculated using all the decimals, while doing the same with only two decimals returns the 3 missing €cents ...
is this only happening on multi item orders?
Quote from: GJC Web Design on February 11, 2013, 19:08:01 PM
is this only happening on multi item orders?
Apparently it's a matter of quantity.
Given the following constants:
Product item price: 4.54545
Product tax: 0.95000
Price + tax: 5.49545 (A)
For the different quantities:
QTY | A * QTY | product_subtotal_with_tax |
1 | 5.49545 | 5.50000 |
2 | 10.99090 | 11.00000 |
3 | 16.48635 | 16.50000 |
As you can see starting from 3 items the issue is raised. While a 0.01 is acceptable, increasing the quantity increases the error...
How can I mitigate it?
thanks!
this is all done in administrator/components/com_virtuemart/helpers/calculationh.php &
administrator/components/com_virtuemart/models/product.php
you need to start echoing out each stage to try and get an idea where the rounding errors are occurring
e.g. in the function getProductPrices() etc...
I will, but it looks strange to me that nobody else ever experienced this issue...