BR-CO-11: Allowance total must equal the sum of document-level allowances

Explained by Matheel from ZATCA's rule text and the condition SDK 3.4.8 executes · Updated

Error: the invoice is rejectedAll invoicesFields: BT-107, BT-92

cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount (BT-107) must equal the sum of cbc:Amount (BT-92) of the document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = false, rounded to two decimals. It also passes when there is neither an AllowanceTotalAmount nor any document-level allowance.

How to fix it

Set cbc:AllowanceTotalAmount to the rounded sum of all document-level allowance amounts, or omit it when the invoice has no document-level allowances.

ZATCA's official text

[BR-CO-11]-Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).
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

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