Incorrect tax calculation

  • Posts: 10
  • Thank you received: 1
7 years 1 month ago #290269

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

Please Log in or Create an account to join the conversation.

  • Posts: 83777
  • Thank you received: 13561
  • MODERATOR
7 years 1 month ago #290273

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.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 1
7 years 1 month ago #290297

....

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.049 seconds
Powered by Kunena Forum