BR-FREXT-11

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 : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).

Context
(cac:InvoiceLine|cac:CreditNoteLine)
Test
($isParentID and exists((../cac:InvoiceLine|../cac:CreditNoteLine)[cbc:ID = $parentID][cbc:ID != $lineID])) or not($isParentID)

Checked with France EXTENDED-CTC-FR (UBL)

Message

Num line : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).

Context
//ram:IncludedSupplyChainTradeLineItem
Test
($parentID != '' and exists(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ram:AssociatedDocumentLineDocument/ram:LineID = $parentID and ram:AssociatedDocumentLineDocument/ram:LineID != $lineID])) or $parentID = ''

Checked with France EXTENDED-CTC-FR (CII)