BR-KSA-F-04: Invoice amounts and quantities must not be negative

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

Error: the invoice is rejectedAll invoicesFields: —

Checks that listed amounts and quantities are >= 0 when they have a value: cac:LegalMonetaryTotal amounts, cac:TaxTotal/cbc:TaxAmount, cac:TaxSubtotal TaxAmount and TaxableAmount (taxable amount skipped for category 'O'), allowance/charge Amount and BaseAmount, line cbc:InvoicedQuantity, cac:Price/cbc:PriceAmount, line tax amounts and cac:TaxExchangeRate/cbc:CalculationRate. Zero is accepted.

How to fix it

Use positive or zero values in these elements, e.g. <cbc:InvoicedQuantity unitCode="PCE">2</cbc:InvoicedQuantity> rather than -2.

ZATCA's official text

[BR-KSA-F-04]-All the document amounts and quantities must be positive, unless specified otherwise.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

string-length(.) > 0 and not((.) >= 0)

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