# BR-FR-MV-06_EXT-FR-FE-167

Source: https://xmlvalid.com/rules/BR-FR-MV-06_EXT-FR-FE-167

> IDligne … , ID parent ligne … , legalID : … , ParentlegalID : … . Lorsque le cadre de facturation (BT-23) est S8, B8, M8 ou S9, B9, M9, chaque ligne (BG-25) doit contenir un identifiant légal de vendeur (ram:ID). Si la ligne a un identifiant de ligne parent (ram:ParentLineID), cet identifiant doit être identique à celui de la ligne parent.

- Level: error
- Rule sets: French e-invoicing rules (UBL) 1.4.0.04
- Context: `ubl:Invoice/cac:InvoiceLine|cn:CreditNote/cac:CreditNoteLine`
- Test: `not(custom:isSpecialContract(/ubl:Invoice|/cn:CreditNote)) or ($legalID != '' and (not($parentlineID) or $legalID = $legalIDParent))`

> BR-FR-MV-06/EXT-FR-FE-167 : IDligne … , ID parent ligne … , legalID : … , ParentlegalID : … . Lorsque le cadre de facturation (BT-23) est S8, B8, M8 ou S9, B9, M9, chaque ligne (BG-25) doit contenir un identifiant légal de vendeur (ram:ID). Si la ligne a un identifiant de ligne parent (ram:ParentLineID), cet identifiant doit être identique à celui de la ligne parent.

- Level: error
- Rule sets: French e-invoicing rules (CII) 1.4.0.04
- Context: `rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem`
- Test: `not(custom:isSpecialContract(/rsm:CrossIndustryInvoice)) or ($legalID != '' and (not($parentlineID) or $legalID = $legalIDParent))`

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