Page 1 of 1

VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 8:01 pm
by GarfNo17
Hi there

I have issue with rounding with VAT and I am wondering what I have missed.

If I have an item at £4.17 + VAT ( at 20%) then an individual item is £5.00
However 10 of them becomes £50.04 due to the £4.17 * 1.2 = £5.004.

Is there a way to round before the multiplication of quantity?

Thanks in advance

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 8:56 pm
by artcore
Can you store it as 4.16666667?
(haven't used oc2 in a live setup yet but that's what I do in oc1.5)

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 9:04 pm
by jrfcomputing
You have to use 4 decimal places to get it to round correctly.

The easiest way to to get the correct pricve is work backwards

if you do £5 - 16.6666% then that will give you the price to put in which is 4.1666

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 9:31 pm
by GarfNo17
That is a not really a fix.

I would rather find the calculations and do Product * Price round to 2 dp then multiple by the quantity.

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 9:48 pm
by GarfNo17
Also... that fix will cause you issues with the tax man at some point

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 10:04 pm
by GarfNo17
I have figured it out.

Just a couple of round($XXXXXXX,2) in tax.php and that's sorted it

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Sep 15, 2015 10:15 pm
by jrfcomputing
The tax man uses more than 2 decimal places as it is impossible to calculate multiples correctly.

The customer will still see as 2 decimal places you will be taking the right amount of VAT as 16.6666% is just working the tax backwards.

Your example where your item is £4.17 + 20% actually equals £5.004 so if you sold enough then it would mean you are paying too little tax and that is why with multiples it adds the extra pence

Re: VAT Per Product and Rounding 2.0.1.1

Posted: Tue Nov 03, 2015 4:59 pm
by micrdy
GarfNo17 wrote:I have figured it out.

Just a couple of round($XXXXXXX,2) in tax.php and that's sorted it
Could you tell us where exactly?