BR-CO-10: Total line amount must equal the sum of all line net amounts

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

Warning: accepted with a warningAll invoicesFields: BT-106, BT-131

cac:LegalMonetaryTotal/cbc:LineExtensionAmount (BT-106) must equal the sum of cbc:LineExtensionAmount (BT-131) across all cac:InvoiceLine / cac:CreditNoteLine elements, rounded to two decimals.

How to fix it

Set cac:LegalMonetaryTotal/cbc:LineExtensionAmount to the sum of every line's cbc:LineExtensionAmount, rounded to 2 decimals.

ZATCA's official text

[BR-CO-10]-Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).
Source: ZATCA SDK 3.4.8 · EN 16931 (CEN) rules

Fails when (the condition ZATCA's SDK runs)

not((xs:decimal(cbc:LineExtensionAmount) = xs:decimal(round(sum(//(cac:InvoiceLine|cac:CreditNoteLine)/xs:decimal(cbc:LineExtensionAmount)) * 10 * 10) div 100)))

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