Grain & oil store purchasing - reorder point and safety stock tool - safety stock as lead time x daily average x a volatility multiplier the human sets, order quantities rounded up to whole cases and aligned to the supplier's delivery days, and a pre-holiday mode that is one manual switch, never a forecast
You are a coding agent. Build a single-file HTML
"grain & oil reorder point calculator" for
whoever handles ordering in the store. Runs
locally, offline, no external dependencies.
Positioning (design to this, not inventory
software): the grain & oil ordering dilemma is
concrete - goods move by the case, so
over-ordering parks capital in slow stock that
then lives through a risky summer, while
under-ordering means a restaurant calling for
goods today goes unserved, and losing one
monthly account costs more than a week of
overstock. The tool answers exactly one
question: which SKUs crossed their order line
today, and how many cases to order. It
deliberately contains no demand forecasting
model and touches neither capital planning nor
price comparison.
Features:
1. SKU records
- Product / case pack (bags or jugs per case) /
supplier (dropdown) / that supplier's
delivery days (weekday) / lead time (days
from order to arrival)
- Sections preloaded for rice, flour, oil,
mixed grains; editable
2. Daily entry (one screen a day)
- Today's sales per SKU (cases, decimals
allowed for loose-stock conversion)
- Arrival log: which orders landed today and
how many cases - on-hand updates itself
3. Reorder calculation (visible on open)
- Daily average: rolling [averaging window]
days
- Safety stock = lead time x daily average x
[volatility multiplier]
- Order line = lead time x daily average +
safety stock
- SKUs where on-hand + on-order < order line
go on the "order today" list
- Suggested quantity = enough to cover
[coverage days], rounded up to whole cases,
aligned to supplier delivery days: the last
order window before the next delivery day
highlights "miss today, wait a week"
4. Pre-holiday switch (a manual setting, not
a forecast)
- Next to coverage days and the multiplier
sits a "pre-holiday mode" toggle: on, it
applies [pre-holiday coverage] and
[pre-holiday multiplier] - two higher
presets
- A fixed line beside the switch: "This tool
does not understand the holidays. Set
pre-holiday parameters yourself."
- When to switch it on and for how long is
entirely human; the tool auto-detects no
"peak season" of any kind
Hard constraints:
- The volatility multiplier is a manual
parameter; "max daily sales / average" over
the window displays as a reference value
only, never auto-applies - adopting it takes
an explicit click
- Order suggestions round up to whole cases
and say so: "rounding adds N days of cover,"
never hidden
- Data in browser localStorage, JSON export/
import; preload 8 SKUs x 30 days of sample
data (one night-before-stockout scenario,
one pre-holiday uplift), so the calculation
shows itself on first open
You must not:
- No forecasting models - no curve fitting, no
"smart prediction of next month's sales";
historical average x human multiplier, and
that is all
- Nothing about capital lockup, price
comparison, or supplier scoring - anything
beyond how many cases stays out
- No automatic ordering, no interface to any
supplier system
Why it is written this way
"The volatility multiplier is a manual parameter" is the load-bearing boundary of this prompt. Ordering tools most often die by growing a demand forecast: the model fits a rising curve, the tool starts "recommending" far beyond historical sales - and grain & oil demand steps (pre-holiday stocking, a new restaurant opening down the street) are exactly the signals absent from history. Order by the fitted curve and you get either a festival stockout or a storeroom full of overstock in March. The human watches the "max daily / average" reference and sets the multiplier; the tool applies it, every day, without complaint. Judgment stays with the person; repetition goes to the tool.
Aligning suggested quantities to supplier delivery days reflects the actual time structure of grain & oil supply: most suppliers do not deliver daily - they run fixed routes two or three weekdays a week. Miss today's order window and the order line silently recalculates against next week's arrival. That constraint is harder than any inventory formula, which is why the tool must shout "miss today, wait a week" instead of quietly displaying an abstract reorder point.
Pre-holiday mode is a manual switch, never an algorithm, with "this tool does not understand the holidays" written beside it - an honesty clause. Festival demand is a step change, not an amplified wiggle, and every history-based extrapolation is wrong in front of it. Leaving the uplift to the human and the boundary on the screen is what makes the tool safe to order by. The sample data ships with a night-before-stockout scenario because a first-time user should see what failing to order looks like before trusting what ordering looks like - a tool persuades by demonstration, not by documentation.
Variables
| Variable | Description |
|---|---|
| Volatility multiplier | How much safety stock amplifies volatility - start from "max daily sales / average" in the window and round up; stores serving restaurants need a higher multiplier than pure retail |
| Averaging window | Days in the daily average - too short and one big order skews it, too long and it reacts too late to a real slowdown; pick between roughly 7 and 14 days against the lead time |
| Coverage days | How many days a suggested order should cover - set by capital and storeroom capacity; keep a separate pre-holiday value, the two presets stored apart |