BR-KSA-74: Prepayment document type code (KSA-30) on lines must be 386
When cac:LegalMonetaryTotal/cbc:PrepaidAmount is greater than 0, every cac:InvoiceLine/cac:DocumentReference that has a cbc:DocumentTypeCode (KSA-30) must have the value '386'.
How to fix it
Set <cbc:DocumentTypeCode>386</cbc:DocumentTypeCode> in each line's cac:DocumentReference.
ZATCA's official text
[BR-KSA-74]-Prepayment Document Type Code (KSA-30) for the Invoice line document reference must be '386'.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
normalize-space(./cac:TaxCategory/cbc:Percent)='' or not( format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)-0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)+0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)), '#.00')))
Related rules
- BR-KSA-73 · Prepaid amount (BT-113) requires full prepayment reference on lines
- BR-KSA-75 · Prepayment lines need taxable amount, tax amount, category and rate
- BR-KSA-82 · Prepayment lines must carry zero line amounts
- BR-KSA-71 · Simplified summary invoices need the buyer name
- BR-KSA-72 · Simplified summary invoices need supply start and end dates
- BR-KSA-76 · Zero-rated (Z) prepayment line VAT rate must be 0
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