BR-04

An Invoice shall have an Invoice type code (BT-3).

error: the document is invalid Peppol documentation ↗

Why it fails

  • There is no cbc:InvoiceTypeCode (cbc:CreditNoteTypeCode in a credit note, ram:TypeCode in CII).

How to fix it

Add the type code (BT-3) from UNTDID 1001: 380 for a commercial invoice, 381 for a credit note, 384 for a corrected invoice.

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.

Context
/ubl:Invoice | /cn:CreditNote
Test
normalize-space(cbc:InvoiceTypeCode) != '' or normalize-space(cbc:CreditNoteTypeCode) !=''

Checked with EN 16931 Invoice (UBL), EN 16931 Credit Note (UBL), Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)

Context
/rsm:CrossIndustryInvoice
Test
normalize-space(rsm:ExchangedDocument/ram:TypeCode) != ''

Checked with EN 16931 Invoice (CII)

Context
/ubl:Invoice | /cn:CreditNote
Test
(cbc:InvoiceTypeCode) !='' or (cbc:CreditNoteTypeCode) !=''

Checked with Romania RO e-Factura Invoice (UBL), Romania RO e-Factura Credit Note (UBL)

Context
/rsm:CrossIndustryInvoice
Test
(rsm:ExchangedDocument/ram:TypeCode!='')

Checked with France Factur-X BASIC WL, Factur-X / ZUGFeRD BASIC WL