VRBL-INV-RS-1p0-8

Basic Info

Rule When the Seller is Serbian, then the Seller Tax ID must be sent. If the Seller Tax Scheme Code is VAT, it can contain the Serbian TIN preceeded by the prefix RS.
Context /ubl:Invoice/cac:AccountingSupplierParty
Pattern vrbl-invoice-rs-1p0
Severity fatal

Implementation

not($RSSupplierCountry = 'RS')
or
boolean(cac:Party/cac:PartyTaxScheme[translate(normalize-space(cac:TaxScheme/cbc:ID), 'vat', 'VAT') = 'VAT']/cbc:CompanyID)
and
(
	substring(cac:Party/cac:PartyTaxScheme[translate(normalize-space(cac:TaxScheme/cbc:ID), 'vat', 'VAT') = 'VAT']/cbc:CompanyID, 1, 2) = 'RS'
	and
	string-length(cac:Party/cac:PartyTaxScheme[translate(normalize-space(cac:TaxScheme/cbc:ID), 'vat', 'VAT') = 'VAT']/cbc:CompanyID) = 11
	and
	string-length(translate(substring(cac:Party/cac:PartyTaxScheme[translate(normalize-space(cac:TaxScheme/cbc:ID), 'vat', 'VAT') = 'VAT']/cbc:CompanyID, 3, 11), $Numerics, '')) = 0
)