Use an allowed currency code for the target currency

Error FX-SCH-A-000333 Factur-X

Value of 'ram:TargetCurrencyCode' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

A non-empty value in ram:TargetCurrencyCode is not included in permitted code list 42. This check does not reject an empty value.

What the rule means

The target currency code identifies the currency into which the exchange rate converts. A disallowed code cannot reliably identify the target currency.

Please use an allowed code for the target currency

The specified target-currency value is not included in the permitted code list. Use an entry from code list 42 for ram:TargetCurrencyCode.

What to do
  1. Check the value in ram:TargetCurrencyCode.
  2. Replace any disallowed value with an entry from code list 42.
  3. Regenerate the invoice and validate it again.
Technical details

The test accepts an empty value; otherwise, ram:TargetCurrencyCode must match a value in the enumeration of code list 42.

Where the rule applies

Applies to ram:TargetCurrencyCode in the exchange rate for the tax currency.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:TaxApplicableTradeCurrencyExchange/ram:TargetCurrencyCode
Test expression (assert/@test)
string-length($codeValue42)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=42]/enumeration[@value=$codeValue42]