BR-KSA-51: Line amount with VAT (KSA-12) = line net amount + line VAT
For each cac:InvoiceLine/cac:TaxTotal, cbc:RoundingAmount (KSA-12) must equal the line's cbc:LineExtensionAmount (BT-131) plus cbc:TaxAmount (KSA-11), compared to 2 decimal places after rounding the sum. A missing cbc:RoundingAmount also fails.
How to fix it
Set the line's cac:TaxTotal/cbc:RoundingAmount to LineExtensionAmount + TaxAmount, rounded to 2 decimals.
ZATCA's official text
[BR-KSA-51]-The line amount with VAT (KSA-12) must be Invoice line net amount (BT-131) + Line VAT amount (KSA-11).
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not( format-number((cbc:RoundingAmount),'#.00') = format-number( (round(( (cbc:TaxAmount) + (../cbc:LineExtensionAmount) ) * 100 ) div 100), '#.00') )
Related rules
- BR-24 · Each invoice line needs a line net amount (BT-131)
- BR-CO-10 · Total line amount must equal the sum of all line net amounts
- 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-52 · Each line needs a line VAT amount (KSA-11) on standard invoices
- BR-KSA-53 · Each line needs a line amount with VAT (KSA-12) on standard invoices
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