VRBL-INV-FR-CIUS-1p0-B2G-28

Basic Info

Rule For B2G, Seller Agent Party Identification ID must use SIRET when a Seller Agent Party Legal Entity Company ID used as SIREN is provided, otherwise an allowed private identifier scheme.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:AgentParty
Pattern vrbl-invoice-fr-cpro-b2g
Severity warning

Implementation

not($isB2G)
or
(
	(
		not(boolean(cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID = '0002']))
		and
		boolean(cac:PartyIdentification/cbc:ID[contains($VRBL-CL-FR-CPRO-AllowedNonSirenPrivateIDScheme, concat(' ', normalize-space(@schemeID), ' '))])
	)
	or
	(
		boolean(cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID = '0002'])
		and
		boolean(cac:PartyIdentification/cbc:ID[@schemeID = '0009' and substring(normalize-space(.), 1, 9) = normalize-space(../../cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID = '0002'])])
	)
)