BR-KSA-90: Tax exchange rate may be at most 14 characters long

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-39

If cac:TaxExchangeRate/cbc:CalculationRate (KSA-39) is present and non-empty, its trimmed length must be under 15 characters. The check counts every character, including the decimal point, not only digits; the test string displayed for the rule is a copy of BR-KSA-89's.

How to fix it

Shorten the rate to 14 characters or fewer, e.g. <cbc:CalculationRate>3.75</cbc:CalculationRate>.

ZATCA's official text

[BR-KSA-90] If exists, the allowed maximum number of digits for the Tax Exchange Rate (KSA-39) is 14.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) != '' and not(string-length(normalize-space(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate)) < 15)

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