All rules · en16931 · error
BR-CO-15
The total with tax must equal the total without tax plus the total VAT amount.
Reviewed
Why this rule exists
This is the arithmetic every downstream system re-checks. If the three totals do not reconcile, nobody — the buyer, the ASP, or the tax authority — can tell which of them is the real number.
Why it usually happens
- Rounding the tax total independently of the per-category amounts it aggregates
- Adding a document-level charge to the tax-inclusive total but not to the exclusive one
- Floating-point arithmetic producing a fraction of a fils that survives into serialization
How to fix it
Compute the inclusive total as exclusive + tax using a decimal type, and serialize that result rather than a separately-derived figure.
<cbc:TaxExclusiveAmount currencyID="AED">1000.00</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="AED">1051.00</cbc:TaxInclusiveAmount> <!-- with TaxAmount 50.00, this is off by 1.00 -->
<cbc:TaxExclusiveAmount currencyID="AED">1000.00</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="AED">1050.00</cbc:TaxInclusiveAmount>
The official rule
Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).
Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.
Schematron test
every $Currency in cbc:DocumentCurrencyCode satisfies (count(cac:TaxTotal/xs:decimal(cbc:TaxAmount[@currencyID=$Currency])) eq 1) and (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxInclusiveAmount) = round( (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxExclusiveAmount) + cac:TaxTotal/xs:decimal(cbc:TaxAmount[@currencyID=$Currency])) * 10 * 10) div 100)
Applied to nodes matching /ubl:Invoice | /cn:CreditNote
Rule-pack versions
| Rule-pack | Layer | Severity | Applies to |
|---|---|---|---|
| pint-eu-1.1.1 | en16931 | error | billing/creditnote, billing/invoice |
Related rules
ibr-co-13 · ibr-co-16 · aligned-ibrp-s-08
Check your own invoice
Paste your XML and see every rule that fires, not just this one. Free, no sign-up, and we never store the document.
Open the validator