BR-CO-16: Amount due = total with VAT - prepaid amount + rounding amount
cac:LegalMonetaryTotal/cbc:PayableAmount (BT-115) must equal cbc:TaxInclusiveAmount (BT-112) minus cbc:PrepaidAmount (BT-113) plus cbc:PayableRoundingAmount (BT-114), where the prepaid and rounding amounts count only if present; values are compared after rounding to two decimals.
How to fix it
Set cbc:PayableAmount = cbc:TaxInclusiveAmount − cbc:PrepaidAmount + cbc:PayableRoundingAmount (leave out any term whose element is absent).
ZATCA's official text
[BR-CO-16]-Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Pre-Paid amount (BT-113) + Rounding amount (BT-114).
Source: ZATCA SDK 3.4.8 · EN 16931 (CEN) rules
Fails when (the condition ZATCA's SDK runs)
not(( not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount))))
Related rules
- BR-14 · The invoice total with VAT (BT-112) must be present
- BR-15 · The amount due for payment (BT-115) must be present
- BR-CO-15 · Total with VAT must equal total without VAT plus total VAT
- BR-KSA-73 · Prepaid amount (BT-113) requires full prepayment reference on lines
- BR-KSA-80 · Prepaid amount must equal prepayment taxable plus tax amounts
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