Skip to main content

BR-23 Invoiced quantity unit of measure code must be specified

Under EN 16931 rule BR-23, each invoiced quantity in BT-129 must have an associated unit of measure code in BT-130 (@unitCode). The unit code must be selected from the UN/ECE Recommendation 20 / Recommendation 21 code list (e.g. "H87" for piece, "C62" for one, "KGM" for kilogram, "MTR" for meter, "HUR" for hour, or "DAY" for day). Omitting the unitCode attribute leaves the invoiced physical dimension ambiguous.

Problem Description

Under EN 16931 rule BR-23, each invoiced quantity in BT-129 must have an associated unit of measure code in BT-130 (@unitCode). The unit code must be selected from the UN/ECE Recommendation 20 / Recommendation 21 code list (e.g. "H87" for piece, "C62" for one, "KGM" for kilogram, "MTR" for meter, "HUR" for hour, or "DAY" for day). Omitting the unitCode attribute leaves the invoiced physical dimension ambiguous.

ERROR

XRechnung 3.0

Context and Significance

A numeric quantity without a recognized unitCode attribute fails Schematron rule BR-23 and code list validation BR-CL-23.

Solution

In your ERP master data or invoice line configuration, ensure every invoiced quantity exports an approved UN/ECE unit code. In UBL 2.1 syntax, populate the unitCode attribute on InvoicedQuantity: <cbc:InvoicedQuantity unitCode="H87">10.00</cbc:InvoicedQuantity>. In UN/CEFACT CII syntax, populate the unitCode attribute on BilledQuantity: <ram:BilledQuantity unitCode="H87">10.00</ram:BilledQuantity>.

Quick actions

Valid Examples

  • Invoice line with BT-129 = 10 and BT-130 = "H87" (10 pieces)
  • Invoice line with BT-129 = 40.5 and BT-130 = "HUR" (40.5 hours)

Invalid Examples

  • cac:InvoiceLine element contains numeric quantity but omits unitCode attribute (<cbc:InvoicedQuantity>10</cbc:InvoicedQuantity>)
  • InvoicedQuantity declared with invalid or empty unitCode attribute (<cbc:InvoicedQuantity unitCode=""/>)

Code Examples

Valid XML
<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="H87">10</cbc:InvoicedQuantity>
</cac:InvoiceLine>
Invalid XML
<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity>10</cbc:InvoicedQuantity>
</cac:InvoiceLine>

Affected Fields

Validation Tools