BR-NL-8

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

If the invoice type code (cbc:InvoiceTypeCode) is 381, the document MUST use the CreditNote scheme

Context
cbc:InvoiceTypeCode[$s]|cbc:CreditNoteTypeCode[$s]
Test
(. != '381') or /cn:CreditNote

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

Message

If the credit note type code (cbc:CreditNoteTypeCode) is 380, 384 or 389, the document MUST use the Invoice scheme

Context
cbc:InvoiceTypeCode[$s]|cbc:CreditNoteTypeCode[$s]
Test
(. = '381') or /ubl:Invoice

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