# BR-FREXT-CO-04

Source: https://xmlvalid.com/rules/BR-FREXT-CO-04

> Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151), if the "Subtype of invoice line item" (EXT-FR-FE-163 / BT-X-8) has the value "DETAIL" or is not specified.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (UBL) 1.4.0.04
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `not($lineInCalul) or (exists(cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/(normalize-space(upper-case(cbc:ID))='VAT')]/cbc:ID))`

> Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151) if the "Subtype of invoice line item" (EXT-FR-FE-163 / BT-X-8) has the value "Normal line item (standard case)" (DETAIL) or is not specified.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `//ram:IncludedSupplyChainTradeLineItem/ram:AssociatedDocumentLineDocument[not(ram:LineStatusReasonCode) or ram:LineStatusReasonCode = 'DETAIL']`
- Test: `(../ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)`

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