- Posts: 10
- Thank you received: 1
Incorrect tax calculation
- Jacek.sikora
-
Topic Author
- Offline
Less
More
8 years 8 months ago #290269
by Jacek.sikora
Incorrect tax calculation was created by Jacek.sikora
-- url of the page with the problem -- :
dev.vitberg.pl/aparat-ram-vitberg-plus
-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.2
Hello
I've got a taxes set-up at 8%.
An item is priced at 10 (including taxes)
At checkout it says:
Order value 10,00 PLN (correct)
Shipping 0,00 PLN (correct)
VAT 8% 0,74 PLN INCORRECT it should be 0,80PLN
Total 10,00 PLN (correct)
Why oh why it calculates the taxes wrong? It can't be rounding, there's nothing to round....
I looked everywhere, checked everything and still I'm no smarter than I was few hours ago, any pointers?
Thanks.
Przemek
-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.2
Hello
I've got a taxes set-up at 8%.
An item is priced at 10 (including taxes)
At checkout it says:
Order value 10,00 PLN (correct)
Shipping 0,00 PLN (correct)
VAT 8% 0,74 PLN INCORRECT it should be 0,80PLN
Total 10,00 PLN (correct)
Why oh why it calculates the taxes wrong? It can't be rounding, there's nothing to round....
I looked everywhere, checked everything and still I'm no smarter than I was few hours ago, any pointers?
Thanks.
Przemek
Please Log in or Create an account to join the conversation.
8 years 8 months ago #290273
by nicolas
Replied by nicolas on topic Incorrect tax calculation
Hi,
There is actually no error.
The taxes percentage is ALWAYS calculated out of the untaxed price.
So the taxes would be 0.8 PLN only if the untaxed price was 10 PLN.
Since you want a taxed price of 10 PLN, then the algorithm has to calculate the taxes so that the untaxed amount + the taxes equals the taxed amount:
untaxed + untaxed * 0.08 = untaxed + taxes = taxed amount
So you get untaxed + untaxed 0.08 = 10 => untaxed * 1.08 = 10 => untaxed = 10/1.08 = 9.26
And thus the taxes are equal to 10 - 9.26 = 0.74
Try to look at the tax amount of something costing 10 PLN with taxes in your supermarket and you'll see that the tax amount is calculated the same way.
There is actually no error.
The taxes percentage is ALWAYS calculated out of the untaxed price.
So the taxes would be 0.8 PLN only if the untaxed price was 10 PLN.
Since you want a taxed price of 10 PLN, then the algorithm has to calculate the taxes so that the untaxed amount + the taxes equals the taxed amount:
untaxed + untaxed * 0.08 = untaxed + taxes = taxed amount
So you get untaxed + untaxed 0.08 = 10 => untaxed * 1.08 = 10 => untaxed = 10/1.08 = 9.26
And thus the taxes are equal to 10 - 9.26 = 0.74
Try to look at the tax amount of something costing 10 PLN with taxes in your supermarket and you'll see that the tax amount is calculated the same way.
Please Log in or Create an account to join the conversation.
- Jacek.sikora
-
Topic Author
- Offline
Less
More
- Posts: 10
- Thank you received: 1
8 years 8 months ago #290297
by Jacek.sikora
Replied by Jacek.sikora on topic Incorrect tax calculation
....
You're totally correct.
I never thought of that, just assumed that I could calculate "backwards".
Thanks!
Przemek
You're totally correct.
I never thought of that, just assumed that I could calculate "backwards".
Thanks!
Przemek
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
Time to create page: 0.050 seconds