News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Totals mismatch

Started by maxxer, February 11, 2013, 16:53:37 PM

Previous topic - Next topic

maxxer

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]

GJC Web Design

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

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

maxxer

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

maxxer

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....

GJC Web Design

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..
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

maxxer

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

maxxer

Apparently item tax is calculated using all the decimals, while doing the same with only two decimals returns the 3 missing €cents ...

GJC Web Design

is this only happening on multi item orders?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

maxxer

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:





QTYA * QTYproduct_subtotal_with_tax
15.495455.50000
210.9909011.00000
316.4863516.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!

GJC Web Design

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...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

maxxer

I will, but it looks strange to me that nobody else ever experienced this issue...