Tea shop purchasing & ordering - spring-harvest pre-order capital calculator - a single-file tool that computes per-category order ranges from your own sell-through only, outputs ranges never point values, and when capital runs short hands you a cut order
Build me a single-file HTML tool (no
dependencies, opens by double-click, works
offline) for spring pre-order volume and
capital planning. I handle purchasing for a
tea shop.
[INPUTS] (all hand-entered; the tool ships with
zero default values and zero "industry
reference" numbers)
1. Per category row: tea name / last-year
same-period actual sales (kg) / stockout
days last year (if any) / current stock (kg)
/ pre-order price per kg / discount and
deposit ratio (%) / supplier cap (kg, blank
if none)
2. Globals: total available capital / caution
factor (my expected this-year versus
last-year demand ratio - 0.9 if I expect a
dip)
[RULES]
1. Three numbers per category:
- Floor = last-year same-period sales x
caution factor - current stock (min 0).
Rationale: protect the repeat customer
base first
- Cap = back-computed from capital: after
every category's floor is funded,
remaining capital spread across
categories either evenly or by last-year
sales share - show both allocations side
by side and let me choose
- Supplier cap, where entered, truncates as
a hard ceiling
2. Output is a RANGE (floor - cap), never a
single recommended value; any category whose
floor exceeds its cap (capital shortfall)
turns red and enters the "cut zone"
3. Cut zone ranking by demand certainty: zero
stockout days plus large volume = cut last;
small volume or a stockout history = cut
first
4. Deposit table: deposit for floor and for cap
per category, totals row checked against
available capital, overruns in red
[OUTPUT]
- Main table: tea / floor / cap / deposit range
/ in cut zone?
- Cut-order priority list, each line with a one-
sentence reason citing only my inputs
- Sensitivity section: at caution factor
+/-0.1, how many category floors move - so I
see how much the verdict hangs on one
assumption
- Print/export button producing a plain-text
version for the owner or the supplier
[HARD CONSTRAINTS]
- No built-in industry numbers of any kind
(average sell-through, typical discounts):
missing input means the cell stays empty with
a "please fill in" flag - never a quiet
default
- Sensitivity touches the caution factor only;
do not wiggle other parameters on your own
initiative
- Chinese interface, single file, no external
resources, fully offline
- Display precision to 0.1 kg and whole
currency units - no fake precision beyond
that
Why it is written this way
Spring pre-orders concentrate a tea shop's annual capital stress: the deposit goes out now, the leaf arrives months later, and green tea past summer is a depreciating clock. The tool's core design is computing floor and cap separately - the floor from the repeat base (what sold last year is the hardest fact in the room), the cap from the money (there is exactly this much of it). The space between them is the actual decision space. A tool that prints a point value looks decisive but hides the uncertainty inside it; a range puts the uncertainty on the table and leaves the cutting to the human.
"No built-in industry defaults" is written into the hard constraints as anti-nonsense for the coding agent. Agents building calculators love to seed "industry average shrink 3%" or "typical margin 50%" - numbers they don't actually possess. Once a default renders, users believe it. Forcing every cell empty and every gap flagged keeps the tool a calculator rather than a pseudoscience generator.
The cut order ranks on "zero stockout days and large volume" because those two fields are demand-certainty evidence the user supplied, with no forecasting involved: a category that stocked out last year never established its demand, so cutting it costs least. The whole tool runs on retrospective data (what happened last year) and touches exactly one forward-looking knob - the caution factor - which is then stress-tested alone in the sensitivity section, so the fragility of the one assumption stays visible.
Variables
| Variable | Description |
|---|---|
| Caution factor | Expected demand versus last year - the only forward assumption; sweep 0.85-1.0 in sensitivity rather than committing to one number |
| Deposit ratio | Deposit as a share of payment the supplier requires - can differ per category; enter per row |
| Allocation mode | Leftover capital spread evenly or by sales share - display both, choose manually; the tool never chooses for you |