I would recommend a set of database tables and connections.
Example:
- Jurisdiction : list of states, countries, countries, cities, etc.
- Product : obvious
- Save : list of places where you sell,
- StoreJurisdiction (StoreID, JurisdictionID): a list of jurisdictions in the store responsible for collecting taxes for
- ProductTaxCode (ProductID int, TaxCodeID int): type of product for tax purposes: basic, luxury, etc.
- JurisdictionTaxCodeRate (JurisdictionID, TaxCodeID, InterestRate, RateType): for each applicable combination of jurisdiction and tax code, indicate the applicable tax rate and the type of rate (compound, simple, etc ..).
To find the list of applicable taxes, all you need is the INNER JOIN of the store, its jurisdiction, the jurisdiction that applies to these jurisdictions and product tax codes.
You can define ProductTaxCode as a view so that all products receive TaxCode by default, unless a special one is provided. By abstracting TaxCode, you can have the same product metadata (for example, "Food") for different regions in different ways. If a particular jurisdiction has its own definition of “food,” you simply add a code specific to the jurisdiction and apply it to the products as needed.
This may require some customization for online purchases, bulk purchases, and other situations where the sale is somehow tax-free or the customer is responsible for transferring them. It also needs to be set up for situations where the location of the client, and not in the store, determines the tax rate.
Other settings: here, for example, in Texas, we have a “tax-free” weekend when state and local taxes are not collected on some classes of products where the sale price of individual items is less than $ 100. The idea is to provide cheaper school supplies, clothes, etc. For children going to school for the new year. Such customization can be implemented by displaying a table of date ranges for each JurisdictionTaxCodeRate in the future, as far as possible.
source share