Determination rules and the simulator
Let rules decide the tax code of a sale or purchase, test them in the simulator, and keep a frozen record.
Before you begin
- The feature Determination rules and simulator is on (Applications > Tax > Features).
- You have tax.configure to create rules and tax.determine to use the simulator. A second administrator activates each rule.
- Tax codes exist (Finance > Configuration > Taxes) and an active registration covers the dates you test.
What a rule is
A rule says: when these conditions are true for a supply, give this tax code. Rules have a priority; the lowest number is checked first. Rules are used to fill a line that has no tax code and to simulate.
Steps: create a rule
- Choose Tax > Configuration > Determination rules and press New.
- Fill Code (for example
EXPORT) and Name. - Choose For: Sales, Purchases or Both.
- Type the Priority (lower wins) from 1 to 9999 (default 100).
- Choose Gives tax code.
- Leave Exclusive on if no other rule should decide the same supply at that priority.
- Tick Only with a valid exemption certificate if the partner must hold an active certificate for the code on the tax date.
- Type the Conditions (JSON).
- Optionally list Facts the request must carry, a Legal source and an Explanation shown with the result.
- Save. A second administrator presses Activate.
Conditions
Conditions are a JSON list of {fact, op, value}. Facts: side, seller_country, buyer_country, ship_from_country, ship_to_country, buyer_registered, supply_type (goods or service), party_class, product_class, place_of_supply. Operators: eq, ne, in, not_in, present.
Export of goods, ship-to outside the UAE: [{"fact":"ship_to_country","op":"ne","value":"AE"}].
Other masters rules use
- Classifications group customers, products or supplies (for example class
MEDfor medicines, with members such asMED-001). Use it with theproduct_classfact. Needs evidence is stored but not checked. - Exemption certificates name the customer or supplier, the tax code it allows, the dates, the reference and the scan's SHA-256.
- Rounding policies decide whether prices include tax, rounding per line or whole document, decimals (0 to 6) and mode (half up, half to even, down). One active default per company.
All are created in Tax > Configuration and activated by someone else.
Steps: simulate
- Choose Tax > Determination > Simulate.
- Choose For: Sale or Purchase.
- Type the Tax date.
- Optionally type the Customer / supplier code, Ship-to country, Goods or services and Place of supply.
- Tick Amounts include tax if the amounts are gross.
- Press Add a line and fill Product, Tax code (if no rule) and Amount.
- Press Simulate. The result shows each line: code, treatment, rate, net, tax, the boxes it would count in, and why.
- To keep the result, press Record determination.
Worked examples
With rules EXPORT (priority 10, ship-to not AE gives ZR, exclusive) and DOM (priority 100, sale gives SR):
- Ship-to
SA, line 1,000:ZR, tax 0.00. - Ship-to
AE, line 1,000:SR, tax 50.00. - Amounts include tax, line 1,050.00 at
SR: net 1,000.00, tax 50.00. - Rounding: three lines of 0.10 at 5 %. Per line, 0.005 rounds to 0.01 each, total 0.03. By whole document, 0.015 rounds to 0.02, spread by largest remainder (0.01, 0.01, 0.00).
Refusals: the rules never guess
| Situation | Message |
|---|---|
| A deciding fact is missing | 'Rule EXPORT needs ship_to_country to decide line 1. Give it rather than letting the tax be guessed.' |
| Two exclusive rules both match | 'Rules A and B both decide line 1 at priority 10. Resolve the conflict; no rule is picked arbitrarily.' |
| No rule and no code | 'No rule decides line 1 and it names no tax code. Nothing is defaulted.' |
| Certificate missing | 'Rule X gives EX only with a valid exemption certificate, and none covers <date>.' |
| No tax date | 'Give the tax date (the date of supply the law uses).' |
| Same conditions as an active exclusive rule | 'Rule X has the same conditions and priority. Two exclusive rules cannot both decide the same supply.' |
| Unknown fact in a condition | 'Condition 1: colour is not a fact. Use one of side, seller_country, ...' |
| Unknown comparison | 'Condition 1: gt is not a comparison.' |
If no registration is recorded, simulation still works with the warning 'No AE VAT registration is recorded for this company.'
Frozen records
Recording the same request twice for the same source returns the same record ('replayed'). Tax > Determination > Determinations lists records with Number, Tax date, Source, Rules, Tax and SHA-256. Open one to see Facts, Lines and Totals. Press Check against today's rules to confirm the stored result still matches its hash ('The frozen record matches its hash.') and see whether today's rules would answer differently.
On documents
If Documents take their tax code from the determination rules is on in Tax settings, a line with no tax code receives the rules' code when saved, and a determination is frozen when the document is posted. A code picked by hand stays as picked.
Good to know
- Rules fill empty lines only; they do not stop anyone choosing another code by hand.
- Conditions are typed as JSON; there is no condition builder yet.
- Turning the feature off hides Simulate and Determinations and refuses the simulator. Documents may still receive rule codes while the settings and rules exist, so also turn off the setting.