VRBL-INV-FR-CIUS-1p0-156

Basic Info

Rule When the Invoice Type Code represents a credit and no Billing Reference Group is provided, the Sub Invoice Line Invoice Document Reference ID must exist within the Sub Invoice Line Group.
Context /ubl:Invoice/cac:InvoiceLine/cac:SubInvoiceLine
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(' ', /ubl:Invoice/cbc:InvoiceTypeCode, ' '))) or not(boolean(/ubl:Invoice/cac:BillingReference/cac:InvoiceDocumentReference[cbc:ID and cbc:IssueDate]))
)
or
(
	boolean(cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)
)