AddThisFeature

Invoice Generator

Produce a proper numbered invoice document that a customer can download and file.

involved Documents & Files

What it adds

Issued invoice records with sequential numbering, frozen totals, and a downloadable document per invoice.

What your agent is told to do

5
  1. 1

    Separate the draft from the issued invoice. A draft is editable; issuing assigns the number, freezes the content, and produces the document.

  2. 2

    Render the document through the app's existing PDF Export pipeline rather than adding a second renderer. If the app already syncs to an accounting system, treat that integration as the source of record and this as the customer-facing document, not a competing ledger.

  3. 3

    Copy the seller and buyer details, line items, tax rates, and currency onto the invoice at issue time. Do not reference live customer or product records, because a later address change would silently rewrite last year's paperwork.

  4. 4

    Store every issued document and keep it retrievable for the retention period the business needs, with access limited to the buyer and authorised staff.

  5. 5

    Do not attempt to compute tax rules for every jurisdiction. Take the applicable rate and label as input, apply it consistently, and record what was applied.

Edge cases it handles

8
  • Invoice numbers must run in an unbroken sequence, and two invoices created at the same instant must not claim the same one. Allocate the number inside a database transaction with a real lock, not from a count of existing rows.
  • Totals, tax, and addresses that read from live records will shift retroactively when a price or an address changes. Snapshot every displayed value at issue time so a reprint today matches the copy the customer filed last year.
  • An issued invoice must not be editable. Corrections happen through a credit note or a replacement invoice that references the original, so both sides keep a trail of what changed and why.
  • Currency symbols, decimal separators, thousands separators, tax labels, and date order differ by country, and a European buyer reading a US-formatted date will file it in the wrong period. Format per the buyer's locale and never abbreviate the date.
  • Long line item lists overflow the first page and break the layout. Repeat the column headers on each page, keep totals and the payment block together rather than stranded alone, and number the pages.
  • Rounding applied per line and rounding applied to the total produce different answers. Pick one rule, apply it everywhere, and make sure the printed lines add up to the printed total.
  • A zero-value or fully discounted invoice is legitimate and must render without a division error or an empty totals block.
  • The download link must not be guessable from the invoice number. Anyone with the URL should not be able to enumerate other customers' invoices.

Definition of done

9
  • Issuing an invoice assigns the next number with no gaps and no duplicates under concurrent creation.
  • An issued invoice reproduces identically after customer, price, or tax settings change.
  • Issued invoices cannot be edited; corrections are made by credit note or replacement.
  • Currency, tax labels, and dates render according to the buyer's country.
  • Invoices with many line items paginate with repeated headers and an intact totals block.
  • Printed line totals sum exactly to the printed invoice total.
  • Invoice documents are readable only by the buyer and authorised staff.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.