VRBL-INV-HR-CIUS-1p0-60
Basic Info
|
Rule
|
When the Buyer Country Identification Code is 'HR', the Buyer Tax Company ID must be a valid OIB. |
|
Context
|
/ubl:Invoice/cac:AccountingCustomerParty/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)
)