PageSourceSearch

https://invoicecraftly.com/_assets/js/features/invoice-schema/document-numbering.ff57995e736d.js

js invoicecraftly.com collected 2026-10-02 01:34:25 UTC 919 bytes, 17 lines download raw bytes

1import { PROFORMA_INVOICE_LABEL } from './document-types.a2843656007c.js';
2
3// Proforma is the only type with its own independent number sequence today —
4// Quote/Estimate/Receipt/Credit Note still share the Invoice counter (a
5// pre-existing gap, out of scope here). This stays a small label check
6// rather than a generic per-type table until a second type needs one.
7export function numberForLabel(settings, label) {
8  return label === PROFORMA_INVOICE_LABEL
9    ? `${settings.proformaNumberPrefix || 'PRO-'}${String(settings.nextProformaNumber || 1).padStart(4, '0')}`
10    : `${settings.invoiceNumberPrefix || 'INV-'}${String(settings.nextInvoiceNumber || 1).padStart(4, '0')}`;
11}
12
13export function advanceNumberingForLabel(settings, label) {
14  if (label === PROFORMA_INVOICE_LABEL) settings.nextProformaNumber = (settings.nextProformaNumber || 1) + 1;
15  else settings.nextInvoiceNumber += 1;
16  return settings;
17}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.