AttestwireRule referenceBR-29

BR-29 The invoicing period must not end before it starts

noun · EN 16931 · fatal · BT-73 / BT-74

For a sample invoice, the library reports: The invoicing period runs from "2026-07-31" (BT-73) to "2026-07-01" (BT-74), which ends before it starts. EN 16931 requires the end date to be later than or equal to the start date; equal is allowed, because a single-day period is a real thing.

Business term
BT-73 / BT-74
Severity
fatal

The fix

Swap invoicingPeriod.startDate and invoicingPeriod.endDate, or correct whichever of the two is wrong. Use the same date in both fields for a period of one day.

A passing value

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

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-29",
  "field": [
    "BT-73",
    "BT-74"
  ],
  "severity": "fatal",
  "message": "The invoicing period runs from \"2026-07-31\" (BT-73) to \"2026-07-01\" (BT-74), which ends before it starts. EN 16931 requires the end date to be later than or equal to the start date; equal is allowed, because a single-day period is a real thing. An inverted period is almost always two fields transposed, and it is worth catching here rather than downstream: a consumer that computes a duration from it gets a negative number and either books the accrual to the wrong period or divides by it.",
  "fix": "Swap invoicingPeriod.startDate and invoicingPeriod.endDate, or correct whichever of the two is wrong. Use the same date in both fields for a period of one day.",
  "example": "\"invoicingPeriod\": { \"startDate\": \"2026-07-01\", \"endDate\": \"2026-07-31\" }",
  "xpath": "/ubl:Invoice/cac:InvoicePeriod/cbc:EndDate",
  "docsUrl": "https://attestwire.com/rules/BR-29"
}

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