Additional referenced document on an invoice line

Error PEPPOL-EN16931-R101 Peppol

Element Additional referenced document can only be used for Invoice line object.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

If ram:AdditionalReferencedDocument is present in an invoice line’s settlement, its ram:TypeCode must have the value 130. A different value is not allowed for this element in this location.

What the rule means

The rule restricts the additional referenced document at this invoice line location to the document type with code 130. This ensures the element is used only in the specified form.

Please use type code `130` for the invoice line’s additional referenced document

The additional referenced document on an invoice line has a type code other than 130. If you use this element, its type code must match that value.

What to do
  1. Locate ram:AdditionalReferencedDocument in the settlement of the affected invoice line.
  2. Check the value of ram:TypeCode.
  3. Use the value 130 for this element, or omit the element if it is not needed.
  4. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:SpecifiedLineTradeSettlement>
  <ram:AdditionalReferencedDocument>
    <ram:TypeCode>999</ram:TypeCode>
  </ram:AdditionalReferencedDocument>
</ram:SpecifiedLineTradeSettlement>
✓ Correct
<ram:SpecifiedLineTradeSettlement>
  <ram:AdditionalReferencedDocument>
    <ram:TypeCode>130</ram:TypeCode>
  </ram:AdditionalReferencedDocument>
</ram:SpecifiedLineTradeSettlement>
Technical details

The test passes when ram:AdditionalReferencedDocument is absent or its ram:TypeCode equals 130.

Where the rule applies

The rule applies to ram:AdditionalReferencedDocument within ram:SpecifiedLineTradeSettlement on an invoice line.

Context (rule/@context)
ram:IncludedSupplyChainTradeLineItem
Test expression (assert/@test)
( not(ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument) or (ram:SpecifiedLineTradeSettlement/ram:AdditionalReferencedDocument/ram:TypeCode='130') )