Specify the invoice currency exactly once

Error FX-SCH-A-000038 Factur-X

Element 'ram:InvoiceCurrencyCode' must occur exactly 1 times.

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

ram:InvoiceCurrencyCode is missing from ram:ApplicableHeaderTradeSettlement or occurs more than once. The rule requires exactly one such element.

What the rule means

The invoice currency must be specified exactly once in the document-level settlement information.

Please specify the invoice currency exactly once

ram:InvoiceCurrencyCode is missing from the settlement information or appears more than once. Adjust the information so that it occurs exactly once.

What to do
  1. Find ram:ApplicableHeaderTradeSettlement.
  2. Make sure it contains exactly one ram:InvoiceCurrencyCode element.
  3. Recreate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:ApplicableHeaderTradeSettlement/>
✓ Correct
<ram:ApplicableHeaderTradeSettlement>
  <ram:InvoiceCurrencyCode/>
</ram:ApplicableHeaderTradeSettlement>
Technical details

The rule counts the direct ram:InvoiceCurrencyCode elements within ram:ApplicableHeaderTradeSettlement and requires a count of one.

Where the rule applies

The rule applies to ram:InvoiceCurrencyCode within the document-level settlement information (ram:ApplicableHeaderTradeSettlement).

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement
Test expression (assert/@test)
count(ram:InvoiceCurrencyCode)=1