Allowed source currency code

Error FX-SCH-A-000332 Factur-X

Value of 'ram:SourceCurrencyCode' 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:SourceCurrencyCode 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:SourceCurrencyCode identifies the source 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 source currency

The source 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:SourceCurrencyCode 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:SourceCurrencyCode 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:SourceCurrencyCode in the currency exchange details for tax amounts at document level.

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