VRBL-INV-PEPPOL-RS-21

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-bis3p0-reduced-syntax
Severity fatal

Used Template: EndDateEqualOrLaterStartDate

Parameter Value
StartDate = /ubl:Invoice/cac:InvoicePeriod/cbc:StartDate
EndDate = cbc:StartDate

Implementation

not(boolean(/ubl:Invoice/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(/ubl:Invoice/cac:InvoicePeriod/cbc:StartDate, 1, 4),
		substring(/ubl:Invoice/cac:InvoicePeriod/cbc:StartDate, 6, 2),
		substring(/ubl:Invoice/cac:InvoicePeriod/cbc:StartDate, 9, 2)
	)
)