bug in Nop_OrderProductVariant table

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
In the order variant table values are stored as follows:

Unit Price inc tax: 6.7900 | Unit price exc tax6.7900 | 100
Unit Price inc tax: 10.0900 | Unit price exc tax10.0900 | 100
Unit Price inc tax: 4.6400 | Unit price exc tax3.9500 | 117.4684
Unit Price inc tax: 14.9500 | Unit price exc tax12.7200 | 117.5314
Unit Price inc tax: 0.8800 | Unit price exc tax0.8800 | 100
Unit Price inc tax: 0.8900 | Unit price exc tax0.7600 | 117.1053
Unit Price inc tax: 6.9900 | Unit price exc tax5.9500 | 117.4790
Unit Price inc tax: 15.4900 | Unit price exc tax13.1800 | 117.5266
Unit Price inc tax: 1.2900 | Unit price exc tax1.2900 | 100
Unit Price inc tax: 8.9900 | Unit price exc tax8.9900 | 100
Unit Price inc tax: 8.9900 | Unit price exc tax8.9900 | 100
Unit Price inc tax: 15.4900 | Unit price exc tax13.1800 | 117.5266
Unit Price inc tax: 6.9900 | Unit price exc tax5.9500 | 117.4790
Unit Price inc tax: 8.9900 | Unit price exc tax8.9900 | 100
Unit Price inc tax: 4.6400 | Unit price exc tax3.9500 | 117.4684
Unit Price inc tax: 0.8800 | Unit price exc tax0.8800 | 100
Unit Price inc tax: 4.6400 | Unit price exc tax3.9500 | 117.4684
Unit Price inc tax: 8.9900 | Unit price exc tax8.9900 | 100
Unit Price inc tax: 0.8900 | Unit price exc tax0.7600 | 117.1053

As you can see when calculating the price as a % rounding error is made. All should be 117.5 (17.5% VAT UK)

The smaller the amount the bigger the error - see last row above:
0.7600 * 1.17500 = 0.893


This is in v1.7 - not sure if it was fixed in v1.8?
13 лет назад
It's a matter of argument. What price should see a customer - 0.893? I think that he should see 0.89.

But of course we can store not-rounded values into Nop_OrderProductVariant and Nop_Order tables. And round them before displaying to customers
13 лет назад
nopCommerce team | a.m. wrote:
But of course we can store not-rounded values into Nop_OrderProductVariant and Nop_Order tables. And round them before displaying to customers


I think that would be the answer - only round when coming to calculate totals/displaying on front end.

About 50% of orders in 1 store we look after has these rounding errors when importing to Quickbooks.
13 лет назад
So what's the answer. We are storing our prices exclusive of VAT which then gets added before displaying the price. When you have a quantity greater than 1 you can get rounding error.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.