Reference to an existing invoice line

Error BR-FXEXT-11 Factur-X

Each "ID of parent line" (BT-X-304) must refer to an existing "ID of invoice item" (BT-126).

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

The value of ParentLineID does not match the LineID of any invoice line in the invoice. The reference to the parent line therefore cannot be resolved.

What the rule means

ParentLineID must refer to the identifier of an existing invoice line so that the association with the parent line can be followed.

Affected fields BT-X-304 BT-126
Please reference an existing invoice line

The parent line identifier ParentLineID does not match any LineID in the invoice. Link the line using the identifier of an existing invoice line.

What to do
  1. Check the value in AssociatedDocument.ParentLineID.
  2. Make sure it matches an existing AssociatedDocument.LineID.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
    <ram:ParentLineID>9</ram:ParentLineID>
  </ram:AssociatedDocumentLineDocument>
</ram:IncludedSupplyChainTradeLineItem>
✓ Correct
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>1</ram:LineID>
  </ram:AssociatedDocumentLineDocument>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:LineID>2</ram:LineID>
    <ram:ParentLineID>1</ram:ParentLineID>
  </ram:AssociatedDocumentLineDocument>
</ram:IncludedSupplyChainTradeLineItem>
Check in FactoorSharp
  • AssociatedDocument.LineID (BT-126)
  • TradeLineItem.AssociatedDocument (BT-126)
  • AssociatedDocument.ParentLineID (BT-X-304)
  • TradeLineItem.SetParentLineId(parentLineId) (BT-X-304)
Technical details

The test compares the normalized value of ParentLineID with the normalized LineID values of all invoice lines and requires at least one match.

Where the rule applies

The rule applies to invoice lines in IncludedSupplyChainTradeLineItem that have a ParentLineID.

Context (rule/@context)
//ram:IncludedSupplyChainTradeLineItem [normalize-space(ram:AssociatedDocumentLineDocument/ ram:ParentLineID) != '']
Test expression (assert/@test)
some $p in //ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument/ ram:LineID satisfies normalize-space($p) = normalize-space(ram:AssociatedDocumentLineDocument/ ram:ParentLineID)