VRBL-INV-IS-1p0-8

Basic Info

Rule When the Seller Country Code is 'IS' and the Additional Document Reference Document Description is 'EINDAGI', the corresponding Additional Document Reference ID MUST be in the format 'YYYY-MM-DD'.
Context /ubl:Invoice/cac:AdditionalDocumentReference
Pattern vrbl-invoice-is-peppolbis-3p0
Severity fatal

Implementation

	not(../cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'IS'
	and
	cbc:DocumentDescription = 'EINDAGI')
	or
	(
	string-length(cbc:ID) = 10
	and
	translate(substring(cbc:ID, 1, 4), '0123456789', '') = ''
	and
	substring(cbc:ID, 5, 1) = '-'
	and
	translate(substring(cbc:ID, 6, 2), '0123456789', '') = ''
	and
	substring(cbc:ID, 8, 1) = '-'
	and
	translate(substring(cbc:ID, 9, 2), '0123456789', '') = ''
)