-
Notifications
You must be signed in to change notification settings - Fork 63
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
More flexible tax rules #53
Comments
I wonder, too, if I should remove |
Oops, right, |
Wow, thanks for the work. I'm interested in the implementation, and did not know that it's not allowed to save the tax total in a single variable. I thought that we could use the That does not work when a tax is applied to order items, and another tax to the order total though. (Anecdote: It was shortly after visiting Canada (BC / Northern Territories though) that I implemented Plata's tax model.) |
Thanks for your feedback. As you can see from my changes, I'm using the |
The |
The current one tax per
Price object
method is very specific to certain regions of the world. I propose a more flexible tax calculation architecture that can be programmed to be compliant with more tax systems around the world.Some background: I'm building a shop for use in Quebec, subject to local laws. The Quebec tax system uses calculates two taxes independently: the federal tax, GST, and the provincial tax, PST. These taxes are calculated on the order subtotal, and not per item (makes no difference if internal calculations use extra significant digits). Additionally, Quebec's PST used to be calculated on the subtotal plus the GST (effectively compounding the rate) but this is no longer the case. From my research, there are still places that compound the tax, such as Prince Edward Island. One more quirk: all this tax mess means the current rates in Quebec are 5.0% for the GST and 9.975% for the PST. Two decimal places are not enough to store the tax rate.
As such, I will attempt to write add a new
TaxProcessor
class to augment the current implementation. I plan to create a new settingPLATA_TAX_CLASS
to be used the same way asPLATA_SHOP_PRODUCT
, to decouple the actual tax model and allow a new model to be substituted.While we're on the subject, why not rename those two settings to
PLATA_TAX_MODEL
andPLATA_PRODUCT_MODEL
respectively? That would be clearer and more consistent, allowing future changes of this kind to follow a naming convention.The text was updated successfully, but these errors were encountered: