# BR-21

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

> Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17, EN 16931 rules 1.3.16 (UBL), EXTENDED-CTC-FR rules (UBL) 1.4.0.04
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `normalize-space(cbc:ID) != ''`

> Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

- Level: error
- Rule sets: EN 16931 rules (CII) 1.3.17, EN 16931 rules 1.3.16 (CII), EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `normalize-space(ram:AssociatedDocumentLineDocument/ram:LineID) != ''`

> Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

- Level: error
- Rule sets: Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `(cbc:ID) != ''`

> Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

- Level: error
- Rule sets: Factur-X EN 16931 rules 1.09.2, Factur-X EXTENDED rules 1.09.2
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `(ram:AssociatedDocumentLineDocument/ram:LineID!='')`

## Why it fails

- An invoice line has an empty or missing `cbc:ID` (`ram:AssociatedDocumentLineDocument/ram:LineID` in CII).

## How to fix it

- Number the lines; `1`, `2`, `3` will do. Peppol also wants the numbers to be unique within the invoice.

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