-
Notifications
You must be signed in to change notification settings - Fork 63
Description
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 setting PLATA_TAX_CLASS to be used the same way as PLATA_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 and PLATA_PRODUCT_MODEL respectively? That would be clearer and more consistent, allowing future changes of this kind to follow a naming convention.