Invoice line quantity unit required

Error BR-FXEXT-BR-23 Factur-X

An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130) if the "Subtype of invoice line item" (BT-X-8) has the value "Normal line item (standard case)" (DETAIL) or is not specified.

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

The unitCode attribute is missing from BilledQuantity under SpecifiedLineTradeDelivery. This applies when LineStatusReasonCode is not specified or is DETAIL.

What the rule means

The unit of measure code states the unit in which the invoiced quantity is expressed. Without this code, the meaning of the quantity value is incomplete.

Affected fields BG-25 BT-130 BT-X-8
Please specify the quantity unit for the invoice line

The unit for the invoiced quantity is missing from this invoice line. Add the unit code to the quantity.

What to do
  1. Check the status in AssociatedDocumentLineDocument.
  2. For a line with no status code or with DETAIL, add the unit code using TradeLineItem.UnitCode.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SpecifiedLineTradeDelivery>
  <ram:BilledQuantity>2</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
✓ Correct
<ram:SpecifiedLineTradeDelivery>
  <ram:BilledQuantity unitCode="C62">2</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
Check in FactoorSharp
  • AssociatedDocument.LineStatusReasonCode (BT-X-8)
  • LineStatusReasonCodes (BT-X-8)
  • TradeLineItem.UnitCode (BT-130)
Technical details

The test checks for the unitCode attribute on SpecifiedLineTradeDelivery/BilledQuantity for lines without a status code and for lines with DETAIL.

Where the rule applies

The rule applies to an IncludedSupplyChainTradeLineItem invoice line whose AssociatedDocumentLineDocument has no LineStatusReasonCode or has the value DETAIL.

Context (rule/@context)
//ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument[ not(ram:LineStatusReasonCode) or ram:LineStatusReasonCode = 'DETAIL' ]
Test expression (assert/@test)
(../ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode)