# BR-23

Source: https://xmlvalid.com/rules/BR-23

> An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130).

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17, EN 16931 rules 1.3.16 (UBL), Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `exists(cbc:InvoicedQuantity/@unitCode) or exists(cbc:CreditedQuantity/@unitCode)`

> An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130).

- Level: error
- Rule sets: EN 16931 rules (CII) 1.3.17, EN 16931 rules 1.3.16 (CII), Factur-X EN 16931 rules 1.09.2
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode)`

## Why it fails

- The quantity has no `unitCode` attribute.

## How to fix it

- Add a UN/ECE Recommendation 20 or 21 unit code to the quantity, such as `unitCode="C62"` for pieces or `unitCode="HUR"` for hours.

Validate a document against these rules: https://xmlvalid.com/validate
