Braised-food shop owner-operator - have a coding agent build a single-file break-even calculator: fixed costs, margin, shrinkage in; the daily sales you must clear, out
Build me a single-file HTML break-even calculator for a braised-food shop
owner. Opens by double-click, works offline, data never leaves the machine.
Inputs (two sets side by side - off-season and peak season, identical
fields):
- Monthly fixed costs: rent, labor (including a wage you pay yourself),
utilities and gas, packaging
- Trading days per month
- Blended gross margin (%): from actual cost vs actual selling prices,
using the last three months' real numbers, not estimates
- Shrinkage rate (%): spoilage plus markdown losses as a share of sales -
again the last three months' actuals
- Average ticket
Calculation:
- Effective margin = blended gross margin - shrinkage rate
- Daily break-even sales = monthly fixed costs / trading days /
effective margin
- Daily break-even transactions = daily break-even sales / average
ticket, rounded up
- The result area always shows the arithmetic itself with the user's own
numbers substituted in, so the owner can verify how the figure was
reached; a black-box number alone is not acceptable
Must-handle errors (loudly on the page, never silent):
- Effective margin <= 0: show "with this margin and shrinkage
combination, no sales volume saves you," and point at whether margin
is too low or shrinkage too high
- Any input empty or zero: that side shows "incomplete inputs" instead
of a number
- Shrinkage >= 80% of gross margin: compute normally but add a warning
line - "shrinkage is eating four-fifths of your margin; cutting
shrinkage beats selling more"
Output area:
- Off-season / peak-season columns side by side: daily break-even sales,
daily break-even transactions, effective margin
- A "compare" box: enter current actual average daily sales, and each
column shows "how far from break-even each day" or "how far past it"
Hard requirements:
- Single file, no build step, no external CDN or fonts
- No accounts, no cloud sync, no local storage; refresh clears
everything - this is deliberate, do not add persistence on your own
initiative
- One fixed line of small text at the bottom: "calculated from actual
realized margin and shrinkage, not estimates"
Why it is written this way
The break-even formula fits in one line; owners never get the formula wrong, they get the definitions wrong. First, shrinkage: braised food is same-day stock, whatever isn't sold by close evaporates straight out of margin - five points of shrinkage equals a five-point margin cut, and the shop's real safety margin is much thinner than it feels. Second, their own wage: pricing family labor at zero yields the "not losing capital" line, not the "worth doing" line. Both definitions are locked into the tool's input instructions ("including a wage you pay yourself," "last three months' actuals") - more reliable than writing them in a notebook nobody re-reads.
Showing the arithmetic beside every result is trust built for people who don't grant trust by default. An owner instinctively distrusts a number of unknown provenance; display the formula with his own inputs substituted and he can audit it at a glance - the tool is only worth what that number is worth to him. Side-by-side seasons is the same instinct: braised food peaks in summer and spikes before holidays, and a single-set break-even calculation hands out false comfort all through the off-season.
The "shrinkage at four-fifths of margin" warning line is a deliberately planted priority judgment: in that range, pushing sales harder is the wrong lever - the leak to plug is shrinkage. The tool doesn't make that decision for the owner; it puts the number where he can't look past it. And the "no local storage" line comes from real experience with coding agents: leave it unsaid and you'll most likely get localStorage persistence plus a settings page bolted on - pure liability for a tool that's opened, consulted, and closed.
Variables
| Variable | Notes |
|---|---|
| Blended margin basis | Must be the last three months' actuals - a new shop with no history should hand-derive a conservative version from supplier cost prices first |
| Shrinkage basis | Spoilage plus markdown losses as a share of sales - markdown losses, not just spoilage, are the bigger half |
| Wage you pay yourself | Must sit inside fixed-cost labor - at zero, the tool draws the "not losing capital" line, not the "worth doing" line |