Allowed target currency code

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

The value of ram:TargetCurrencyCode is neither empty nor included in the code list defined for currency codes. The rule explicitly allows an empty value.

What the rule means

ram:TargetCurrencyCode identifies the target currency for the currency exchange. A code that is not allowed can make the currency used in the conversion ambiguous.

Please use an allowed code for the target currency

The target currency code is not recognized as an allowed value. You can leave it empty or use an allowed currency code.

What to do
  1. Find ram:TargetCurrencyCode in the currency exchange details.
  2. Check the value and leave it empty or use an allowed currency code.
  3. Generate the invoice again and validate it.
Technical details

The test accepts ram:TargetCurrencyCode when its value is empty or appears in the enumeration of code list ID 42 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to ram:TargetCurrencyCode in the currency exchange details for tax amounts at document level.

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]