Rules
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 Electronic Address must have a Buyer Electronic Address Scheme ID equal to '0225' and it must start with the SIREN given in Buyer Legal Registration 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
not(
string-length(normalize-space(../cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002'])) = 9
and
translate(normalize-space(../cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002']), $Numerics, '') = ''
)
or
(
@schemeID = '0225'
and
substring(normalize-space(.), 1, 9) = normalize-space(../cac:PartyLegalEntity/cbc:CompanyID[not(@schemeID) or @schemeID='0002'])
)