Provide the item subtype when a parent line ID is given

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

When ram:ParentLineID contains a value, the item subtype in ram:LineStatusReasonCode is missing.

What the rule means

The parent line ID links the invoice line to another, higher-level line. The item subtype identifies the type of line and is required when a parent ID is used.

Affected fields BG-25 BT-X-304 BT-X-8
Please provide the item subtype for the parent line ID

An invoice line refers to a parent line, but its item subtype is missing. Add the detail that identifies the line type.

What to do
  1. In ram:AssociatedDocumentLineDocument, provide LineStatusReasonCode when ParentLineID has a value.
  2. Check the call to SetParentLineId(...) and the value of AssociatedDocument.LineStatusReasonCode.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:ParentLineID>1</ram:ParentLineID>
  </ram:AssociatedDocumentLineDocument>
</ram:IncludedSupplyChainTradeLineItem>
✓ Correct
<ram:IncludedSupplyChainTradeLineItem>
  <ram:AssociatedDocumentLineDocument>
    <ram:ParentLineID>1</ram:ParentLineID>
    <ram:LineStatusReasonCode>DETAIL</ram:LineStatusReasonCode>
  </ram:AssociatedDocumentLineDocument>
</ram:IncludedSupplyChainTradeLineItem>
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 XPath permits an empty ram:ParentLineID. Otherwise, ram:LineStatusReasonCode within ram:AssociatedDocumentLineDocument must have a non-empty value.

Where the rule applies

This rule applies to an invoice line ram:IncludedSupplyChainTradeLineItem when ram:ParentLineID is used in ram: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 != '' )