BR-04
An Invoice shall have an Invoice type code (BT-3).
Why it fails
- There is no
cbc:InvoiceTypeCode(cbc:CreditNoteTypeCodein a credit note,ram:TypeCodein 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
/ubl:Invoice | /cn:CreditNote
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)
/rsm:CrossIndustryInvoice
normalize-space(rsm:ExchangedDocument/ram:TypeCode) != ''
Checked with EN 16931 Invoice (CII)
/ubl:Invoice | /cn:CreditNote
(cbc:InvoiceTypeCode) !='' or (cbc:CreditNoteTypeCode) !=''
Checked with Romania RO e-Factura Invoice (UBL), Romania RO e-Factura Credit Note (UBL)
//ubl:Invoice | //cn:CreditNote
exists(cbc:InvoiceTypeCode) or exists(cbc:CreditNoteTypeCode)
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)
/ubl:Invoice | /cn:CreditNote
(exists(cbc:InvoiceTypeCode) and (cbc:InvoiceTypeCode) !='') or (exists(cbc:CreditNoteTypeCode) and (cbc:CreditNoteTypeCode) !='')
Checked with Saudi Arabia ZATCA Tax Invoice (UBL), Saudi Arabia ZATCA Simplified Tax Invoice (UBL)
/rsm:CrossIndustryInvoice
(rsm:ExchangedDocument/ram:TypeCode!='')
Checked with France Factur-X BASIC WL, Factur-X / ZUGFeRD BASIC WL