VRBL-INV-IS-1p0-10

Basic Info

Rule When the Seller Country Code is 'IS' and the Additional Document Reference Document Description is 'EINDAGI', if both Payment Due Date and cbc:ID used as EINDAGI are given then the cbc:ID used as EINDAGI must be later or equal to the Payment Due Date.
Context /ubl:Invoice/cac:AdditionalDocumentReference
Pattern vrbl-invoice-is-peppolbis-3p0
Severity fatal

Used Template: EndDateEqualOrLaterStartDate

Parameter Value
displayName_EndDate = cbc:ID used as EINDAGI
StartDate = ../cbc:DueDate
EndDate = cbc:ID

Implementation

(
	not(../cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'IS' and cbc:DocumentDescription = 'EINDAGI')
)
or
(
	not(boolean(../cbc:DueDate)) 
	or 
	not(boolean(cbc:ID))
	or 
	number(
		concat(
			substring(cbc:ID, 1, 4),
			substring(cbc:ID, 6, 2),
			substring(cbc:ID, 9, 2)
		)
	)
	>=
	number(
		concat(
			substring(../cbc:DueDate, 1, 4),
			substring(../cbc:DueDate, 6, 2),
			substring(../cbc:DueDate, 9, 2)
		)
	)
)