VRBL-INV-PEPPOL-PINT-116

Basic Info

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

Used Template: EndDateEqualOrLaterStartDate

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

Implementation

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