BR-KSA-89: Exchange-rate target currency must equal the tax currency
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
- BR-53 · With a tax currency (BT-6), give the VAT total in it (BT-111)
- BR-KSA-68 · Every invoice needs a tax currency code (BT-6)
- BR-KSA-87 · Tax exchange rate needs source currency, target currency and rate
- BR-KSA-EN16931-02 · VAT accounting currency (TaxCurrencyCode) must be SAR
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