VRBL-PAY-FR-1p0-62

Basic Info

Rule If both Statement Period Start Date and Statement Period End Date are given then the Statement Period End Date must be later or equal to the Statement Period Start Date.
Context /ubl:Statement/cac:StatementPeriod
Pattern vrbl-payments-fr-1p0
Severity fatal

Used Template: EndDateEqualOrLaterStartDate

Parameter Value
StartDate = cbc:StartDate
EndDate = cbc:EndDate

Implementation

not(boolean(cbc:StartDate)) 
or 
not(boolean(cbc:EndDate))
or 
number(
	concat(
		substring(cbc:EndDate, 1, 4),
		substring(cbc:EndDate, 6, 2),
		substring(cbc:EndDate, 9, 2)
	)
)
>=
number(
	concat(
		substring(cbc:StartDate, 1, 4),
		substring(cbc:StartDate, 6, 2),
		substring(cbc:StartDate, 9, 2)
	)
)