VRBL-INV-RS-1p0-13

Basic Info

Rule The Buyer Party Legal Entity Registration Name and Buyer Party Legal Entity Company ID must be provided. The Buyer Party Legal Entity Company ID must to be 8 digits.
Context /ubl:Invoice/cac:AccountingCustomerParty
Pattern vrbl-invoice-rs-1p0
Severity fatal

Implementation

not($RSSupplierCountry = 'RS')
or
(
	boolean(cac:Party/cac:PartyLegalEntity/cbc:RegistrationName)
	and
	boolean(cac:Party/cac:PartyLegalEntity/cbc:CompanyID)
	and
	string-length(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) = 8
	and
	string-length(translate(cac:Party/cac:PartyLegalEntity/cbc:CompanyID, $Numerics, '')) = 0
)