AttestwireRule referenceBR-CO-20

BR-CO-20 An invoice line period must have a start date, an end date or both

noun · EN 16931 · fatal · BG-26

For a sample invoice, the library reports: Line 1 carries an invoice line period (BG-26) with neither a start date (BT-134) nor an end date (BT-135).

Business term
BG-26
Severity
fatal

The fix

Set line.period.startDate, line.period.endDate, or both, or remove line.period so the line falls back to the document level invoicing period. Note that line.period.descriptionCode is ignored at line level.

A passing value

the shape this field expects
"period": { "startDate": "2026-07-01", "endDate": "2026-07-15" }

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": "BR-CO-20",
  "field": "BG-26",
  "severity": "fatal",
  "message": "Line 1 carries an invoice line period (BG-26) with neither a start date (BT-134) nor an end date (BT-135). Unlike the document level period (BG-14), a line period has no legal empty form: BT-8, the tax point date code that lets BG-14 exist without dates, is a document term and has no line equivalent, so a line period with no dates conveys nothing whatsoever. A line period exists to say that this line covers a different timeframe from the rest of the invoice — omit the group and the line simply inherits BG-14, which is usually what you want.",
  "fix": "Set line.period.startDate, line.period.endDate, or both, or remove line.period so the line falls back to the document level invoicing period. Note that line.period.descriptionCode is ignored at line level.",
  "example": "\"period\": { \"startDate\": \"2026-07-01\", \"endDate\": \"2026-07-15\" }",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:InvoicePeriod",
  "docsUrl": "https://attestwire.com/rules/BR-CO-20"
}

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