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

Basic Info

Rule For B2G, Payee Party ID must use SIRET when a Payee Legal Registration ID used as SIREN is provided, otherwise an allowed private identifier scheme.
Context /ubl:Invoice/cac:PayeeParty
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'])])
	)
)