BR-O-08: 'Not subject to VAT' (O) taxable amount must match its lines

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

Warning: accepted with a warningConditional, see belowFields: BG-23, BT-118, BT-116, BT-131, BT-92, BT-99, BT-151, BT-95, BT-102

For each cac:TaxSubtotal with VAT category 'O' (Not subject to VAT), cbc:TaxableAmount must equal the sum of cbc:LineExtensionAmount of lines with category O, plus document-level charges, minus document-level allowances with category O. The executed check also warns if no line or document-level allowance/charge uses category O. The published test expression is written so that it passes whenever O lines or allowances/charges exist, without comparing amounts.

How to fix it

Set the O breakdown's cbc:TaxableAmount to Σ line net amounts (O) + Σ document charges (O) − Σ document allowances (O), and remove the O breakdown if no line or allowance/charge uses category O.

ZATCA's official text

[BR-O-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is " Not subject to VAT" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are "Not subject to VAT".
Source: ZATCA SDK 3.4.8 · EN 16931 (CEN) rules

Fails when (the condition ZATCA's SDK runs)

count(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])> 0 and not(exists(../../../cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) or exists(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']])) or not((xs:decimal(../cbc:TaxableAmount) = (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)))))

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