# BR-CIUS-PT-65

Source: https://xmlvalid.com/rules/BR-CIUS-PT-65

> An Invoice with type code equal to 383 or ND shall contain the Preceding Invoice Reference (BG-3).

- Level: error
- Rule sets: CIUS-PT rules (Portugal, UBL) 2.1.1
- Context: `//ubl:Invoice | //cn:CreditNote`
- Test: `((cbc:InvoiceTypeCode = '383' or cbc:InvoiceTypeCode = 'ND') and not(cac:BillingReference))`

Validate a document against these rules: https://xmlvalid.com/validate
