VRBL-INV-FR-CIUS-1p0-128

Basic Info

Rule When the processing is BAR/B2B and the Invoice Type Code does not represent self-billing, then the Buyer Endpoint ID must have a Buyer Endpoint ID Scheme ID equal to '0225' and it must start with the SIREN given in Buyer Party Legal Entity Company ID.
Context /ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cbc:EndpointID
Pattern vrbl-invoice-fr-cius-1p0
Severity warning

Implementation

not(boolean(/ubl:Invoice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:InvoiceExtension/vrbl:Note[@code = 'BAR']))
or
not(/ubl:Invoice/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:InvoiceExtension/vrbl:Note[@code = 'BAR'] = 'B2B')
or
contains($VRBL-CL-FR-InvoiceTypeCode-SelfBilling, concat(' ', /ubl:Invoice/cbc:InvoiceTypeCode, ' '))
or
(
	@schemeID = '0225'
	and
	substring(., 1, 9) = ../cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002']
)