At most one referenced invoice document

Error FX-SCH-A-000337 Factur-X

Element 'ram:InvoiceReferencedDocument' 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:SpecifiedLineTradeSettlement contains more than one ram:InvoiceReferencedDocument. This element may occur there at most once.

What the rule means

ram:InvoiceReferencedDocument contains a reference to an invoice document in the context of the invoice line. Limiting it to one element prevents multiple competing references in this context.

Please list no more than one referenced invoice document for the invoice line

ram:InvoiceReferencedDocument appears more than once in the settlement of an invoice line. At most one such element is allowed in this section.

What to do
  1. Check ram:SpecifiedLineTradeSettlement for the affected invoice line.
  2. Ensure that ram:InvoiceReferencedDocument occurs there no more than once.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLineTradeSettlement>
  <ram:InvoiceReferencedDocument/>
  <ram:InvoiceReferencedDocument/>
</ram:SpecifiedLineTradeSettlement>
✓ Correct
<ram:SpecifiedLineTradeSettlement>
  <ram:InvoiceReferencedDocument/>
</ram:SpecifiedLineTradeSettlement>
Technical details

The test requires the number of direct ram:InvoiceReferencedDocument elements in ram:SpecifiedLineTradeSettlement to be at most 1; zero is allowed.

Where the rule applies

The rule applies to ram:InvoiceReferencedDocument within the settlement of an invoice line.

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