BR-KSA-80: Prepaid amount must equal prepayment taxable plus tax amounts

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

Warning: accepted with a warningConditional, see belowFields: BT-113, KSA-31, KSA-32

cac:LegalMonetaryTotal/cbc:PrepaidAmount (BT-113) must equal, to two decimals, the sum of all line-level cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount (KSA-31) plus cbc:TaxAmount (KSA-32). The executed check also warns when such line-level subtotals exist while PrepaidAmount is 0 or absent, and when PrepaidAmount is non-zero, both sums are positive and any line cac:DocumentReference/cbc:DocumentTypeCode is not 386.

How to fix it

Set cbc:PrepaidAmount to the total of the prepayment lines' TaxableAmount plus TaxAmount (e.g. 1000 + 150 gives <cbc:PrepaidAmount currencyID="SAR">1150.00</cbc:PrepaidAmount>), use DocumentTypeCode 386 in those lines, and include line-level cac:TaxSubtotal only when there is a prepayment.

ZATCA's official text

[BR-KSA-80] - The Pre-Paid amount (BT-113) must be equal to the sum total of the Prepayment VAT category Taxable Amount (KSA-31) and the Prepayment VAT Category Tax Amount (KSA-32).
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

(($prepaid-amount = 0 or not($prepaid-amount-exists)) and (($taxable-amount-exists) or ($tax-amount-exists))) or (($prepaid-amount != 0 ) and ($taxable-amount-sum > 0) and ($tax-amount-sum > 0) and $any-document-type-code-not-386 ) or (format-number($prepaid-amount, '#.00') != format-number($total-tax-amount, '#.00'))

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