BR-KSA-20: Each invoice line charge needs a reason code
Applies to each cac:InvoiceLine/cac:AllowanceCharge with cbc:ChargeIndicator = true: it must have a non-empty cbc:AllowanceChargeReasonCode (BT-145). A text cbc:AllowanceChargeReason alone does not satisfy the executed check; the listed test text expresses this differently.
How to fix it
Add a reason code to each line-level charge, e.g. <cbc:AllowanceChargeReasonCode>…</cbc:AllowanceChargeReasonCode>.
ZATCA's official text
[BR-KSA-20]-Each Invoice line charge (BG-28) shall have a code for the reason for invoice line charge (BT-145).
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules
Fails when (the condition ZATCA's SDK runs)
not(exists(cbc:AllowanceChargeReasonCode) and normalize-space(cbc:AllowanceChargeReasonCode )!='' )
Related rules
- BR-43 · Each line-level charge needs an amount (BT-141)
- BR-KSA-22 · Each invoice line charge needs a charge reason text (BT-144)
- BR-KSA-CL-06 · Charge reason codes must come from UNTDID 7161
- BR-KSA-17 · Credit and debit notes need a reason for issuing
- BR-KSA-18 · VAT category code must be S, Z, E or O
- BR-KSA-19 · Each document-level charge needs a reason code
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