BR-KSA-89: Exchange-rate target currency must equal the tax currency

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

Error: the invoice is rejectedConditional, see belowFields: KSA-38, BT-6

If cac:TaxExchangeRate/cbc:TargetCurrencyCode (KSA-38) is present and non-empty, it must match cbc:TaxCurrencyCode (BT-6). The executed check compares with TaxCurrencyCode as the message says, although the test string displayed for the rule mentions DocumentCurrencyCode.

How to fix it

Set cbc:TargetCurrencyCode to the cbc:TaxCurrencyCode value, which must be SAR (BR-KSA-EN16931-02): <cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode>.

ZATCA's official text

[BR-KSA-89] If exists, Target Currency Code (KSA-38) must be the same as the Tax currency code (BT-6)
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) != '' and not(matches(normalize-space(//cbc:TaxCurrencyCode), /ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode !='') )

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