At most one invoice reference document for the advance payment

Error FX-SCH-A-000326 Factur-X

Element 'ram:InvoiceSpecifiedReferencedDocument' 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

SpecifiedAdvancePayment contains more than one ram:InvoiceSpecifiedReferencedDocument element.

What the rule means

The invoice reference document associates the advance payment with a referenced invoice. This rule limits the number of such references to at most one.

Please limit the advance payment’s invoice reference to one document

SpecifiedAdvancePayment contains more than one invoice reference document. You can resolve this by providing at most one ram:InvoiceSpecifiedReferencedDocument there.

What to do
  1. Locate SpecifiedAdvancePayment in the invoice settlement information.
  2. Check the ram:InvoiceSpecifiedReferencedDocument elements it contains.
  3. Ensure that no more than one such element is present.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedAdvancePayment>
  <ram:InvoiceSpecifiedReferencedDocument/>
  <ram:InvoiceSpecifiedReferencedDocument/>
</ram:SpecifiedAdvancePayment>
✓ Correct
<ram:SpecifiedAdvancePayment>
  <ram:InvoiceSpecifiedReferencedDocument/>
</ram:SpecifiedAdvancePayment>
Technical details

The rule counts the direct ram:InvoiceSpecifiedReferencedDocument elements in the current SpecifiedAdvancePayment and permits no more than one.

Where the rule applies

The rule applies to SpecifiedAdvancePayment within the invoice settlement information and its ram:InvoiceSpecifiedReferencedDocument elements.

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