At most one RoleCode for the invoicing party

Error FX-SCH-A-000888 Factur-X

Element 'ram:RoleCode' may occur at maximum 1 times.

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

ram:InvoicerTradeParty contains more than one ram:RoleCode element.

What the rule means

At most one role code is provided for the invoicing party in this element context.

Please provide no more than one RoleCode for the invoicing party

More than one ram:RoleCode element is present for the invoicing party. This element may occur no more than once in this part of the XML.

What to do
  1. Find ram:InvoicerTradeParty in the settlement details.
  2. Review its ram:RoleCode elements and remove any additional occurrences.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:InvoicerTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
  <ram:RoleCode>B</ram:RoleCode>
</ram:InvoicerTradeParty>
✓ Correct
<ram:InvoicerTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
</ram:InvoicerTradeParty>
Technical details

The test counts the direct ram:RoleCode elements in ram:InvoicerTradeParty and allows no more than one.

Where the rule applies

The rule applies to ram:RoleCode within ram:InvoicerTradeParty in the settlement details.

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