VRBL-INV-HR-CIUS-1p0-59

Basic Info

Rule When the Seller Country Identification Code is 'HR', the Seller Tax ID must be a valid OIB.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID
Pattern vrbl-invoice-hr-cius-1p0
Severity fatal

Used Template: VRBL-HR-OIB

Implementation

(
	not(../../cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'HR') and not(../cac:TaxScheme/cbc:ID = 'VAT')
)
or
(
	(string-length(.) = 11 and string-length(translate(., $Numerics, '')) = 0)
	or
	(string-length(.) = 13 and starts-with(., 'HR') and string-length(translate(substring(., 3, 11), $Numerics, '')) = 0)
)