Never put another customer's number on your invoice

If the invoice cannot prove which contract belongs to this job, it refuses to look one up rather than guessing.

What it is

The contract lookup is keyed on the estimate link id — the bond between the job and its paperwork. When that id is missing the lookup is abandoned and the estimate snapshot stands, instead of falling back to 'the newest contract in the business'.

Also called: wrong contract price on invoice · someone else's total showed up · cross-project billing error

See it
Never put another customer's number on your invoice
Prepared for
Ivy Brubaker
1140 Ridge Line Rd · Fair Play
Shell package$37,113
Concrete & site$10,775
Doors & windows$7,183
Trim & finish$4,789
Total
$59,860
Signature
Hard to screenshot — best shown as a small diagram of the lookup chain with the 'no link id → stop' branch highlighted. Logic lives in loadEstimateForJob in src/components/invoices/InvoiceEditor.tsx. Sample data — no customer information appears here.
How it works
  1. 1The estimate link's id is selected explicitly even though nothing renders it, because the contract query filters on it.
  2. 2If the id is absent the code throws before querying, and the estimate snapshot is used.
  3. 3The contract query filters on estimate_link_id plus status fully_executed, newest counter-signed first.
Why we built it

A missing identifier vanished out of the request instead of failing, so the contract lookup quietly widened to the newest signed contract anywhere in the business. That put one customer's $180,944.01 onto a different customer's invoice, and would have put the same figure on every other job's invoice too. The lookup now refuses to run without an identifier: a search that cannot be narrowed returns nothing rather than returning somebody else's contract price.

The problem
  • A dropped query filter silently widening a lookup to every record in the business.
  • One customer's contract value appearing on another's invoice.
Sound familiar?
What you get
A missing link produces no price rather than the wrong price.
Cross-customer contamination is structurally impossible on this path.

See it on your own jobs

Twenty minutes, your numbers, no slide deck. We’ll build one of your real buildings in front of you and send you the estimate link at the end — yours to keep either way.

or keep browsing features →