Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply multiple taxes #343

Open
tongtian0925 opened this issue Aug 3, 2022 · 1 comment
Open

Apply multiple taxes #343

tongtian0925 opened this issue Aug 3, 2022 · 1 comment

Comments

@tongtian0925
Copy link

In Quebec Canada, we have two kinds of taxes
GST 9.975%+ QST 5%
but if I apply two conditions the calculation is wrong because it should be subtotal*(1+ 0.0975+0.05), but the code is calculated as subtotal* 1.0975*1.05 which means one tax is base on another tax result. do we have a way to calculate tax rate first then apply on the subtotal?

It is legal to get the tax separately, so I can't add them to one condition then apply it

@Blum
Copy link

Blum commented Aug 17, 2022

First of all, as I read, it seems the opposite.. The QST is 9.975% and GST is 5%.

The only solution I see for this in the current functionality would be to add a conditions at once (*1,14975) and to break the result down into fractions after that, so you can show the taxes separately.

If the subtotal is S = 8,55, the both added taxes would be R = S*1,14975 = 9,8303625, and GST+QST part would be = R - (R/1,14975) = 1,2803625.
The ratio QST / GST = 9.975 / 5 , and after we know that GST = (1,2803625 - QST) turns out GST = 0,4275 and QST = 0,8528625.
Quick check would confirms that if we extract the QST by (8,55 * 1,09975) - 8.55 we'll get exactly 0,8528625.

You can spare a lots of these calculations if you keep the original price as an attribute to the item, and get the QST and GST directly by it.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants