VRBL-INV-IT-1p2-111

Basic Info

Rule When the Buyer Power of Attorney Group is identifying a tax representative, the Buyer Agent Tax Company ID used as VAT ID must begin with a valid Alpha-2 Country Code.
Context /ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PowerOfAttorney/cac:AgentParty/cac:PartyTaxScheme/cbc:CompanyID
Pattern vrbl-invoice-it-1p2
Severity fatal

Implementation

not(
	../../../cbc:Description = concat($VRBL-IT-Prefix, 'TaxRepresentative')
	and
	../cac:TaxScheme/cbc:ID = 'VAT'
)
or
contains($VRBL-CL-CountryCode, concat(' ', substring(normalize-space(.), 1, 2), ' '))