BR-FREXT-12
The rule sets below word this rule differently; each wording is shown with its rule set.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
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.
(cac:InvoiceLine|cac:CreditNoteLine)
($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)
Checked with France EXTENDED-CTC-FR (UBL)
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.
//ram:IncludedSupplyChainTradeLineItem
($isSublineGroup and $numberChildWG = $numberChildWGAndBT131) or not($isSublineGroup)
Checked with France EXTENDED-CTC-FR (CII)