VRBL-INV-FR-CIUS-1p0-152

Basic Info

Rule When the Invoice Type Code represents a credit and no Invoice Line Invoice Document Reference Group or Sub Invoice Line Invoice Document Reference Group is provided, the Preceding Invoice Reference ID must exist within the Invoice.
Context /ubl:Invoice
Pattern vrbl-invoice-fr-cius-1p0
Severity warning

Used Template: Exists

Parameter Value
probe = cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID

Implementation

(
	not(contains($VRBL-CL-FR-InvoiceTypeCode-Credit, concat(' ', cbc:InvoiceTypeCode, ' '))) or boolean(cac:InvoiceLine/cac:BillingReference/cac:InvoiceDocumentReference[cbc:ID and cbc:IssueDate]) or boolean(cac:InvoiceLine/cac:SubInvoiceLine/cac:BillingReference/cac:InvoiceDocumentReference[cbc:ID and cbc:IssueDate])
)
or
(
	boolean(cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)
)