At most one role code for the invoice line seller

Error FX-SCH-A-001038 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:ItemSellerTradeParty contains more than one ram:RoleCode. The element may occur at most once.

What the rule means

The role code describes a role of the invoice line seller. Repeating this element is not permitted by this structure.

Please include no more than one role code for the invoice line seller

ram:RoleCode appears more than once for the invoice line seller. The field may be omitted or included once, but it must not be repeated.

What to do
  1. Locate ram:ItemSellerTradeParty in the affected invoice line.
  2. Remove extra ram:RoleCode elements so that no more than one remains.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:ItemSellerTradeParty>
  <ram:RoleCode>AA</ram:RoleCode>
  <ram:RoleCode>BB</ram:RoleCode>
</ram:ItemSellerTradeParty>
✓ Correct
<ram:ItemSellerTradeParty>
  <ram:RoleCode>AA</ram:RoleCode>
</ram:ItemSellerTradeParty>
Technical details

The rule counts the direct ram:RoleCode elements in ram:ItemSellerTradeParty and allows zero or one occurrence.

Where the rule applies

The rule applies to ram:RoleCode within ram:ItemSellerTradeParty for an invoice line seller.

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