VRBL-INV-FR-CIUS-1p0-108

Basic Info

Rule If the Invoice Line Delivery Location ID is marked as a SIRET-CODE, it must be consistent with the reported SIREN in Invoice Line Delivery Party Legal Entity Company ID.
Context /ubl:Invoice/cac:InvoiceLine/cac:Delivery/cac:DeliveryLocation/cbc:ID
Pattern vrbl-invoice-fr-cius-1p0
Severity warning

Used Template: VRBL-FR-schemeID-0009-and-SIREN

Parameter Value
probeSIREN = ../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002']
displayName_probeSIREN = %{../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID}

Implementation

not(@schemeID = '0009')
or
not(boolean(../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002']))
or
not(
	string-length(normalize-space(../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002'])) = 9
	and
	translate(normalize-space(../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002']), $Numerics, '') = ''
)
or
substring(normalize-space(.), 1, 9) = normalize-space(../../cac:DeliveryParty/cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002'])