VRBL-INV-IT-1p2-3

Basic Info

Rule At least one of Seller Tax ID used as VAT ID or Buyer Tax Company ID used as VAT ID must start with 'IT'.
Context /ubl:Invoice
Pattern vrbl-invoice-it-1p2
Severity fatal

Implementation

substring(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID), 1, 2) = 'IT'
or
substring(normalize-space(cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID), 1, 2) = 'IT'