In this article (8 sections)
The context
Step: tax calculation on the invoice line, in Revenue Cloud Billing. The company invoices customers inside and outside the EU. It has to apply domestic VAT, intra-EU rules and export zero-rating, and finance has to be able to justify every line to an auditor.
The problem
Three things have to be right on each line: the rate, the tax code, and the reason for a zero.
The rate has to follow the right country. The tax code has to change with the country too, and nothing native switches it. And a zero-rated line looks exactly like an untaxed one on the invoice.
That last point is the one an audit runs into. A line with no applicable rate and a line with a rate row set to zero both show no VAT. Only the second one records a decision (“this sale is zero-rated”). The first one records a gap in the setup, and nothing on the invoice tells them apart. When an auditor asks why a line has no VAT, the answer has to come from a row in the rate table.
The solution
Each of the three gets its own piece.
For the rate, tax is resolved from the billing profile (see Calculating Tax from the Billing Profile), with a tax zone kept on the account. For the code, the treatment is set on the line with a Manual policy (see Country-Driven Tax Code, Without Apex).
For zero-rating, zero rates are loaded explicitly, one row per code, country and period, so every zero on an invoice points to a row someone decided on.
Flow
Two points to take from this diagram. First, it is the country of the billing profile that determines the rate, not the address on the order. I verified it in both directions on two orders with different addresses and the same profile. Second, no native mechanism varies the tax code by country: TaxTreatmentItem has no geographic field, and the standard decision table takes a code as input and returns a rate, so it can never produce one.
- Who — LegalEntity (who is selling), BillingAccount (who is billed)
- Which rule — TaxPolicy (how to choose), TaxTreatment (product × code)
- How much — TaxEngine (the calculator), TaxRate (code × country × period)
- Result — InvoiceLineTax (the only place the code lands)
How to set it up
- Tax zone as a picklist on the account, maintained by finance rather than derived: overrides do happen.
- One rate row per code × country × period, zeros included.
- A flow that maps zone to tax code when a quote line is created or updated.
- Policy set to Manual so repricing doesn’t undo it.
Alternatives
The other option is an external tax engine. It removes the work of maintaining rates, and it is the right answer at real scale or in the United States. For a handful of EU countries with stable rates, I don’t pick it: it adds a dependency and a cost for rules that fit in a table.
In practice
- Resolve VAT from the billing profile, not from the order address.
- Load every rate, zeros included, one row per code × country × period.
- Let finance own the tax zone on the account.
- Check unusual territories against the rate table, not against what people remember.