BR-FR-BD-14-EXT-FR-FE-136

BR-FR-BD-14-EXT-FR-FE-136 : Num Facture antérieure manquant ligne … : Lorsque le cadre de facturation (BT-23) est S9, B9 ou M9, et pour les factures rectificatives et avoirs chaque ligne (BG-25) avec un sous-type de ligne (EXT-FR-FE-163) égal à "GROUP" et sans identifiant de ligne Parent (EXT-FR-FE-162) doit comprendre un identifiant de facture antérieure à la ligne (EXT-FR-FE-136) ainsi que sa date (EXT-FR-FE-138).

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.

Context
(ubl:Invoice | cn:CreditNote)[(cbc:InvoiceTypeCode | cbc:CreditNoteTypeCode) = ('261','471','473','502')]/(cac:InvoiceLine | cac:CreditNoteLine)/cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID = $invoiceID][(cac:InvoiceDocumentReference/cbc:DocumentStatusCode = 'GROUP') and not(cac:BillingReferenceLine/cbc:ID)]
Test
not(custom:isSpecialContractBD(/ubl:Invoice|/cn:CreditNote)) or exists(../cac:BillingReference[cac:InvoiceDocumentReference/cbc:ID != $invoiceID]/cac:InvoiceDocumentReference/cbc:ID)

Checked with France e-invoice (UBL), France e-credit note (UBL), France EXTENDED-CTC-FR (UBL)

Context
rsm:CrossIndustryInvoice[rsm:ExchangedDocument/ram:TypeCode = ('261','471','473','502')]/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ram:AssociatedDocumentLineDocument/ram:LineStatusReasonCode = 'GROUP' and not(ram:AssociatedDocumentLineDocument/ram:ParentLineID)]
Test
not(custom:isSpecialContractBD(/rsm:CrossIndustryInvoice)) or exists(ram:SpecifiedLineTradeSettlement/ram:InvoiceReferencedDocument/ram:IssuerAssignedID)

Checked with France e-invoice (CII), France Factur-X EN 16931, France EXTENDED-CTC-FR (CII), France Factur-X EXTENDED, France Factur-X BASIC WL