BR-NL-9

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Message

For suppliers in the Netherlands, if the document is a corrective invoice (cbc:InvoiceTypeCode = 384), the document MUST contain an invoice reference (cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)

Context
cbc:InvoiceTypeCode[$s]|cbc:CreditNoteTypeCode[$s]
Test
(. != '384') or /*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID

Checked with Netherlands SI-UBL 2.0 Invoice (NLCIUS), Netherlands SI-UBL 2.0 Credit Note (NLCIUS)

Message

For suppliers in the Netherlands, if the document is a corrective invoice (rsm:ExchangedDocument/ram:TypeCode = 384), the document MUST contain an invoice reference (/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument/ram:IssuerAssignedID)

Context
/*/rsm:ExchangedDocument/ram:TypeCode[$si]
Test
not($s) or (. != 384) or ../rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument/ram:IssuerAssignedID

Checked with Netherlands NLCIUS Invoice (CII)