VRBL-INV-IT-1p2-4

Basic Info

Rule For Credit Memos, the Issue Date of the Credit Memo must be equal or after the Invoice Document Reference Issue Date.
Context /ubl:Invoice
Pattern vrbl-invoice-it-1p2
Severity fatal

Implementation

not(
	cbc:InvoiceTypeCode = concat($VRBL-IT-Prefix, 'TD04') or cbc:InvoiceTypeCode = '381'
)
or
not(boolean(cac:BillingReference/cac:InvoiceDocumentReference/cbc:IssueDate))
or
number(translate(substring(cbc:IssueDate, 1, 10), '-', '')) >= number(translate(substring(cac:BillingReference/cac:InvoiceDocumentReference/cbc:IssueDate, 1, 10), '-', ''))