BR-KSA-87: Tax exchange rate needs source currency, target currency and rate

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

Warning: accepted with a warningConditional, see belowFields: KSA-36, KSA-37, KSA-38, KSA-39

If /ubl:Invoice/cac:TaxExchangeRate (KSA-36) exists, it must contain non-empty cbc:SourceCurrencyCode (KSA-37), cbc:TargetCurrencyCode (KSA-38) and cbc:CalculationRate (KSA-39).

How to fix it

Complete the block, e.g. <cac:TaxExchangeRate><cbc:SourceCurrencyCode>USD</cbc:SourceCurrencyCode><cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode><cbc:CalculationRate>3.75</cbc:CalculationRate></cac:TaxExchangeRate>, or leave out cac:TaxExchangeRate entirely.

ZATCA's official text

[BR-KSA-87] If the tax exchange rate (KSA-36) exists, then Source Currency Code (KSA-37), Target Currency Code (KSA-38) and Calculation Rate (KSA-39) shall be provided
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

exists(/ubl:Invoice/cac:TaxExchangeRate) and not(exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) != '' and exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) != '' and exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) != '')

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