question

jtg763 avatar image
jtg763 asked bryanvargas commented

How can I calculate tax with a flat discount and variable tax rates, ensuring accuracy down to the cent?

If I have a total purchase composed of:

  • Item A with a price of $20 and a quantity of 2, subject to a 10% tax rate.
  • Item B with a price of $10 and a quantity of 3, subject to a 5% tax rate.
  • Item C with a price of $5 and a quantity of 1, subject to a 7% tax rate.

In this scenario, the subtotal for the items amounts to $75.

If a flat $10 discount is applied to the subtotal, how can I accurately distribute this discount among the items, considering their respective tax rates, to ensure the final amount is correct to the cent?

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

bryanvargas avatar image bryanvargas ♦♦ commented ·

Clover only has two ways to do the discount, order discount (uses the subtotal regardless of what tax rate an item has) and item by item discount. If you need a break down of each item discount, I would recommend using the item by item discount instead of the subtotal.

0 Likes 0 ·

1 Answer

·
jefflawson1 avatar image
jefflawson1 answered jefflawson1 edited

To distribute the $10 discount accurately, calculate each item's share based on its proportion to the total pre-discount cost, considering the individual tax rates for precise cent accuracy.

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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