VRBL-INV-AE-1p0-143

Basic Info

Rule the Seller Tax ID MUST be exactly 15 alphanumeric digits, starting with 1, ending with 03.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme
Pattern vrbl-invoice-AE-1p0
Severity fatal

Implementation

not(cac:TaxScheme/cbc:ID = 'VAT' and (/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'AE'))
or
(
	string-length(cbc:CompanyID) = 15
	and starts-with(cbc:CompanyID, '1')
	and substring(cbc:CompanyID, 14, 2) = '03'
	and translate(cbc:CompanyID, '0123456789', '') = ''
)