1. The Tax Rules Engine and Tax Rates

Priority-ordered rules

The generic (non-GST) tax engine is driven by a Tax Rules page (TaxRulesPage). Rules are priority-ordered, so when more than one rule could apply the engine selects based on that ordering. Each rule can carry conditions on jurisdiction, customer type and product category, which means tax selection is automatic rather than a manual choice on every transaction.

Condition dimensions

The condition dimensions reflect real tax logic. Jurisdiction-based conditions apply tax by country and state. Customer-type conditions distinguish categories such as retail, wholesale and government. Product-category conditions let different kinds of products attract different rates. A single rule can combine these so that, for example, a particular product category sold to a particular customer type within a particular jurisdiction resolves to the correct rate.

Tax rates

Tax Rates (TaxRatesPage) hold the actual rate values that the rules resolve to. The rules engine decides which rate applies and the rate table supplies the number used in the calculation. This separation keeps rate maintenance independent of the selection logic. A typical configuration workflow is to define the rates first, then build priority-ordered rules whose conditions map each combination of jurisdiction, customer type and product category onto the right rate, so that invoices and orders then compute tax automatically from the transaction's attributes.