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

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.

Wrong
<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 -->
Right
<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-packLayerSeverityApplies to
pint-eu-1.1.1en16931errorbilling/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