BR-KSA-99: Buyer VAT number must not be empty when the element is present

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

Warning: accepted with a warningStandard tax invoices (B2B)Fields: BT-48, KSA-2

For standard tax invoices and their notes (KSA-2 @name starting 01), if cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) is present, its trimmed value must not be empty. The test string shown for the rule is malformed; this describes the executed condition.

How to fix it

Fill cbc:CompanyID with the buyer's VAT number, or remove the empty element (BR-KSA-81 then requires another buyer ID in cac:PartyIdentification/cbc:ID).

ZATCA's official text

If it exists in the invoice, the buyer VAT registration number or buyer group VAT registration number (BT-48) should not be left empty in the tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) = '' and (exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID))

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