Multiple role codes for the payee

Error FX-SCH-A-000986 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:RoleCode occurs more than once in ram:PayeeTradeParty. This element may appear at most once in this context.

What the rule means

The role code describes the payee’s role. The structure allows at most one such code.

Please use no more than one role code for the payee

ram:RoleCode appears more than once in ram:PayeeTradeParty. This section may contain the role code only once.

What to do
  1. Locate ram:PayeeTradeParty in the payment terms.
  2. Check the ram:RoleCode elements it contains and remove any extra occurrences.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:PayeeTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
  <ram:RoleCode>B</ram:RoleCode>
</ram:PayeeTradeParty>
✓ Correct
<ram:PayeeTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
</ram:PayeeTradeParty>
Technical details

The XPath test count(ram:RoleCode)<=1 allows zero or one ram:RoleCode element and rejects more than one.

Where the rule applies

The rule applies to ram:RoleCode within ram:PayeeTradeParty in the document-level payment terms.

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