Attestwire › Rule reference › ATW-CREDIT-NOTE-NO-PRECEDING-INVOICE

ATW-CREDIT-NOTE-NO-PRECEDING-INVOICE A credit note should name the invoice it credits

noun · Attestwire · information · BG-3 / BT-25

For a sample invoice, the library reports: This credit note names no preceding invoice (BG-3 / BT-25). No rule requires one: BR-DE-26 is often read as demanding it, and it does not — its test fires on the corrected-invoice code 384, on either document type, and never on 381.

Business term
BG-3 / BT-25
Severity
information

The fix

Set precedingInvoices to the invoice being credited — [{ "invoiceNumber": "2026-000142", "issueDate": "2026-08-09" }]. BT-26, the issue date, is optional and worth supplying: it is what lets the buyer find the original after a numbering reset. If the credit note is genuinely standalone (a goodwill credit, a volume rebate over many invoices), leave it out — that is a real case and this finding is advisory for exactly that reason.

A passing value

the shape this field expects
"precedingInvoices": [{ "invoiceNumber": "2026-000142", "issueDate": "2026-08-09" }]

What the library returns

The full error returned by @attestwire/en16931. It includes the rule ID, affected field and suggested correction. Developers can use this object in their application:

TeachingError
{
  "rule": "ATW-CREDIT-NOTE-NO-PRECEDING-INVOICE",
  "field": [
    "BG-3",
    "BT-25"
  ],
  "severity": "information",
  "message": "This credit note names no preceding invoice (BG-3 / BT-25). No rule requires one: BR-DE-26 is often read as demanding it, and it does not — its test fires on the corrected-invoice code 384, on either document type, and never on 381. KoSIT accepts a credit note with no reference, and so does the EN 16931 schematron. What it leaves is a reconciliation problem: the buyer holds a credit with nothing to net it against, and your own VAT return cannot show which supply the adjustment belongs to. A credit note that says what it credits is the ordinary case, which is why this is worth one line of advice at the level the regulator uses for advice.",
  "fix": "Set precedingInvoices to the invoice being credited — [{ \"invoiceNumber\": \"2026-000142\", \"issueDate\": \"2026-08-09\" }]. BT-26, the issue date, is optional and worth supplying: it is what lets the buyer find the original after a numbering reset. If the credit note is genuinely standalone (a goodwill credit, a volume rebate over many invoices), leave it out — that is a real case and this finding is advisory for exactly that reason.",
  "example": "\"precedingInvoices\": [{ \"invoiceNumber\": \"2026-000142\", \"issueDate\": \"2026-08-09\" }]",
  "xpath": "/ubl:CreditNote/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID",
  "docsUrl": "https://github.com/attestwire/en16931#not-implemented-yet"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.