question

Alexey avatar image
Alexey asked bsharts published

Problems with tax calculating

Hello, I faced a problem with online ordering.

We trying to test some taxes for online orders and probably can't find a way to calculate it right.

For example: There is an order with total 11.01 But the item in this order costs 10.00 and applied tax 10%. After creating order and paying for it 11$ we see that it's not enough to make order fully paid.

Order:

order result

Order item:

order item

2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dan avatar image Dan commented ·

I am facing a similar problem. We have a tax rate totaling 34.5%. 1 item with a base price of 2.05 has a tax rounded up to 0.71 (actual value is 0.70725), and a different item has a base price of 1.70 with a tax of 0.58 (actual value is 0.5865). Clover is inexplicably rounding one up and the other down....

0 Likes 0 ·
bsharts avatar image bsharts commented ·
How do you get the two tax rates?
0 Likes 0 ·
Dan avatar image
Dan answered Jeffrey Blattman commented

Basically, the tax from each of the two tax rates relevant to the line item is being calculated and rounded separately. In this specific case, we have:

An lineitem with a unitprice of 1000 and two tax rates, one for 0.06755% and another for 0.0325%.

This results in tax amounts of 68 (67.55 rounds up) cents and 33 (32.5 rounds up) cents respectively.

Therefore the total is 1000 + 68 + 33 => 1101

This becomes more complicated when there are multiple line items with the same tax rate and discounts.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Great answer!

0 Likes 0 ·
bsharts avatar image
bsharts answered bsharts published
How do you get the two tax rates?
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community