Subtype for a parent invoice line

Error BR-FXEXT-06 Factur-X

For each item (BG-25), if the "ID of the parent line" (BT-X-304) is used, the "Subtype of the invoice item" (BT-X-8) must be specified.

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

If ParentLineID contains a value, LineStatusReasonCode must also be provided. The invoice line has a parent line identifier but no subtype.

What the rule means

ParentLineID associates the invoice line with a parent line. The subtype identifies the kind of invoice line.

Affected fields BG-25 BT-X-304 BT-X-8
Please provide the subtype of the parent invoice line

An invoice line refers to a parent line using ParentLineID, but LineStatusReasonCode is missing. You can resolve this by providing the subtype.

What to do
  1. Check the parent line identifier in AssociatedDocument.ParentLineID.
  2. Provide AssociatedDocument.LineStatusReasonCode for this invoice line.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:AssociatedDocumentLineDocument>
  <ram:ParentLineID>1</ram:ParentLineID>
</ram:AssociatedDocumentLineDocument>
✓ Correct
<ram:AssociatedDocumentLineDocument>
  <ram:ParentLineID>1</ram:ParentLineID>
  <ram:LineStatusReasonCode>DETAIL</ram:LineStatusReasonCode>
</ram:AssociatedDocumentLineDocument>
Check in FactoorSharp
  • AssociatedDocument.LineStatusReasonCode (BT-X-8)
  • AssociatedDocument.ParentLineID (BT-X-304)
  • LineStatusReasonCodes (BT-X-8)
  • TradeLineItem.SetParentLineId(parentLineId) (BT-X-304)
Technical details

The test passes when ParentLineID is empty, or when LineStatusReasonCode is also non-empty if ParentLineID is not empty.

Where the rule applies

The rule applies to each invoice line in IncludedSupplyChainTradeLineItem, especially to AssociatedDocumentLineDocument.

Context (rule/@context)
//ram:IncludedSupplyChainTradeLineItem
Test expression (assert/@test)
normalize-space(ram:AssociatedDocumentLineDocument/ram:ParentLineID) ='' or ( normalize-space(ram:AssociatedDocumentLineDocument/ram:ParentLineID) != '' and ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode != '' )