RoleCode may occur at most once

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 in this section.

What the rule means

ram:RoleCode states a role in the context of the seller details for the invoice line. Multiple occurrences would state the role more than once in the same section.

Please provide at most one `RoleCode` for the invoice line’s seller

The seller details for the invoice line contain ram:RoleCode more than once. You can resolve this by removing the duplicate occurrence.

What to do
  1. Find ram:ItemSellerTradeParty for the relevant invoice line.
  2. Make sure it contains at most one ram:RoleCode.
  3. Regenerate the invoice and validate it again.
Technical details

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

Where the rule applies

The rule applies within ram:ItemSellerTradeParty in the seller details for the invoice line.

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