VRBL-INV-PEPPOL-PINT-117

Basic Info

Rule If both Invoice Line Invoice End Date and Invoice End Date are given then the Invoice End Date must be later or equal to the Invoice Line Invoice End Date.
Context /ubl:Invoice/cac:InvoiceLine/cac:InvoicePeriod
Pattern vrbl-invoice-peppol-pint
Severity fatal

Used Template: EndDateEqualOrLaterStartDate

Parameter Value
StartDate = cbc:EndDate
EndDate = ../../cac:InvoicePeriod/cbc:EndDate

Implementation

not(boolean(cbc:EndDate)) 
or 
not(boolean(../../cac:InvoicePeriod/cbc:EndDate))
or 
number(
	concat(
		substring(../../cac:InvoicePeriod/cbc:EndDate, 1, 4),
		substring(../../cac:InvoicePeriod/cbc:EndDate, 6, 2),
		substring(../../cac:InvoicePeriod/cbc:EndDate, 9, 2)
	)
)
>=
number(
	concat(
		substring(cbc:EndDate, 1, 4),
		substring(cbc:EndDate, 6, 2),
		substring(cbc:EndDate, 9, 2)
	)
)