BR-CO-12: Charge total must equal the sum of document-level charges
In SDK 3.4.8 the executed check compares cac:LegalMonetaryTotal/cbc:ChargeTotalAmount (BT-108) with the sum of cbc:Amount (BT-99) of document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = true, rounded to two decimals; it passes if both are absent and fails if ChargeTotalAmount is present but empty. The rule's listed test text is a copy of the allowance formula (BR-CO-11) and does not match the official message.
How to fix it
Set cbc:ChargeTotalAmount to the rounded sum of all document-level charge amounts, or omit the element entirely when there are no document-level charges (do not leave it empty).
ZATCA's official text
[BR-CO-12]-Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).
Source: ZATCA SDK 3.4.8 · EN 16931 (CEN) rules
Fails when (the condition ZATCA's SDK runs)
not(xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()])))
Related rules
- BR-36 · Each document-level charge needs an amount (BT-99)
- BR-CO-13 · Total without VAT = line amounts - allowances + charges
- BR-E-08 · Exempt (E) taxable amount must match the exempt lines and adjustments
- BR-KSA-EN16931-03 · Allowance/charge amount must equal base amount × percentage / 100
- BR-O-08 · 'Not subject to VAT' (O) taxable amount must match its lines
- BR-S-08 · Standard-rated (S) taxable amount must match its lines
Validate your invoice against ZATCA's rules
Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.
Validate an invoice or try Matheel