VRBL-INV-FR-CIUS-1p0-129

Basic Info

Rule When the processing is BAR/B2B and the Invoice Type Code represents self-billing, then the Seller Endpoint ID must have a Seller Endpoint ID Scheme ID equal to '0225' and it must start with the SIREN given in Seller Legal Registration ID.
Context /ubl:Invoice/cac:AccountingSupplierParty/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
not(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']
)