# BR-FREXT-12

Source: https://xmlvalid.com/rules/BR-FREXT-12

> Num Fact : … , Num line : … - [BR-FREXT-12]-If the "Subtype of invoice line item" (EXT-FR-FE-163 / BT-X-8) has the value "GROUP" and if the "Invoice line net amount" (BT-131) is specified, all lower levels which has "Subtype of invoice line item" (EXT-FR-FE-163) equal to "GROUP" MUST contain a "Invoice line net amount" (BT-131) value.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (UBL) 1.4.0.04
- Context: `(cac:InvoiceLine|cac:CreditNoteLine)`
- Test: `($isSublineGroup and count((../cac:InvoiceLine|../cac:CreditNoteLine)[cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID]/cac:BillingReferenceLine/cbc:ID=$lineID][cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID]/cac:InvoiceDocumentReference/cbc:DocumentStatusCode = 'GROUP']) = count((../cac:InvoiceLine|../cac:CreditNoteLine)[cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID]/cac:BillingReferenceLine/cbc:ID=$lineID][cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID]/cac:InvoiceDocumentReference/cbc:DocumentStatusCode = 'GROUP']/cbc:LineExtensionAmount) )or not($isSublineGroup)`

> Num line : … - [BR-FREXT-12]-If the "Subtype of invoice line item" (EXT-FR-FE-163 / BT-X-8) has the value "GROUP" and if the "Invoice line net amount" (BT-131) is specified, all lower levels which has "Subtype of invoice line item" (EXT-FR-FE-163) equal to "GROUP" MUST contain a "Invoice line net amount" (BT-131) value.

- Level: error
- Rule sets: EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `($isSublineGroup and $numberChildWG = $numberChildWGAndBT131) or not($isSublineGroup)`

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