{
  "id": 9170856,
  "title": "Two Invoices, One Number: Allocate Invoice Numbers From the Log, Not a Cell",
  "url": "https://urgent.news/2026/09/22/two-invoices-one-number-allocate-invoice-numbers-from-the-log-not-a",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-22T18:05:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/hayrullahkar/two-invoices-one-number-allocate-invoice-numbers-from-the-log-not-a-cell-1o66"
  },
  "original_language": "en",
  "account": "Two invoices issued under the same number can cause confusion and lost payments. A Google Sheets invoice template automatically generates invoice numbers from cell B4 and logs them in a Log tab, but this approach has flaws. When the script reads the value from cell B4, it doesn't claim it, leaving a gap between reading the number and appending it to the log. If the script crashes during this process, the server won't record the invoice, leaving the client without a record and potentially causing payment issues. Moreover, most VAT and sales tax systems require invoice numbers to form a continuous sequence, which is impossible with a cell-based system. To avoid these problems, allocate invoice numbers from the Log tab instead of a cell. The Log tab holds every issued invoice number, making it a reliable source for generating the next number. This pure function can be tested outside the spreadsheet, ensuring consistent invoicing.",
  "summary": "A Google Sheets invoice template does one job well: it prints. The header, the line items, the four formulas at the bottom. The automation people bolt on afterwards reads the invoice number out of cell B4 , exports the sheet as a PDF, emails it, and appends a row to a Log tab: const invoiceNo = sheet . getRange ( ' B4 ' ). getValue (); // ... export, email ... ss . getSheetByName ( ' Log ' ).…",
  "key_points": [
    "Issued invoices with same number cause confusion and lost payments",
    "Google Sheets template auto-generates invoice numbers from cell B4",
    "Log tab provides reliable source for generating continuous invoice numbers"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}