Payee role code at most once

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. The element may occur at most once, but it may also be absent.

What the rule means

The role code describes the payee’s role. Repeating it would duplicate this role in the XML structure.

Please include the payee’s role code no more than once

The payee’s role code has been entered more than once. Remove the duplicate so it occurs no more than once.

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

The rule counts the direct ram:RoleCode elements in ram:PayeeTradeParty and passes when the count is at most one.

Where the rule applies

The rule applies to the optional role code ram:RoleCode within the payee ram:PayeeTradeParty in the payment terms.

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