VRBL-INV-CORE-443

Basic Info

Rule The Invoice Line Invoice End Date must be within Invoice End Date
Context /ubl:Invoice/cac:InvoiceLine/cac:InvoicePeriod
Pattern vrbl-invoice-core
Severity fatal

Implementation

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