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

Update some Canadian tax rates #32

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

stephankaag
Copy link
Contributor

It looks like some Canadian rates are incorrect.

Source: https://www.advalorem.ca/en/canada-vat-rates/

@valeriansaliou valeriansaliou merged commit e657bca into valeriansaliou:master Oct 21, 2020
@valeriansaliou
Copy link
Owner

Thanks a lot!

@stephankaag stephankaag deleted the update-canada branch October 21, 2020 16:29
@sboichon
Copy link

@valeriansaliou Sorry but I think this is not correct.
As a canadian I have been using your awesome library for quite some time , and the tax rates as retuned by the function:
getSalesTax('CA', provinceCode) have always been correct.
It is my assumption that the above method sums the federal GST (5%) and the provincial part of the HST.

With the changes of @stephankaag getSalesTax is now returning GST + (GST + HST) which is off by 5%.

Could you please revert ?
Thank you very much

@valeriansaliou
Copy link
Owner

valeriansaliou commented Oct 27, 2020

@sboichon I've verified, and you're right. This PR did not take into account the calculation trick I initially used to adjust the calculation system to HST: for the states using HST, I've "emulated" their tax rates by substracting the GST from their actual HST, and saying that the calculated (smaller) rate was HST.

It means that for a state that has 15% HST, in the JSON configuration that should be stored as HST = 10%, given that GST is 5%. GST + HST would give the real HST which is 15%.

This PR would produce incorrect final HST values as all original HST values would be added to the GST, giving out eg. 5% + 15% = 20% which is invalid.

Released v2.2.3 to address this, also bumped a state tax rate that was changed in 2019 (Manitoba; ref a139c0a).

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

Successfully merging this pull request may close these issues.

3 participants