BR-FREXT-12

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

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.

Message

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.

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)

Checked with France EXTENDED-CTC-FR (UBL)

Message

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.

Context
//ram:IncludedSupplyChainTradeLineItem
Test
($isSublineGroup and $numberChildWG = $numberChildWGAndBT131) or not($isSublineGroup)

Checked with France EXTENDED-CTC-FR (CII)