Beauty store purchasing & ordering - lipstick shade-range restock structure tool - one SKU runs a dozen-plus shades and none of them may be ordered as whole sets: weeks of supply is computed per shade (stock ÷ weekly sell-through) and drives a red/yellow/green light, hot shades topped up to the target turn, slow shades shallow-replenished, new shades capped at a trial quantity, out-of-stock shades get a "days of lost sales" column (an estimate extrapolated from the last N weeks), and the summary row copies straight into the purchase order
You are a coding agent building an ordering
tool for a beauty store. Build a single-file
HTML tool (no backend, no external
dependencies, fully offline) - a shade-level
restock structure sheet: when the buyer writes
a purchase order for a multi-shade SKU
(lipstick, foundation), quantities are
allocated per shade by sell-through, never
by whole sets.
The real problem: one SKU, a dozen-plus
shades; the brand ships in full sets, so the
hot shade stocks out in three days while the
slow shades sit past a repackaging. Doing the
allocation by hand across dozens of rows fails
halfway through the arithmetic - the tool
delivers three things per shade: one row, an
order quantity, a status light. The judgment
stays with the buyer.
1. Input
- Shade detail, either way:
a. paste a table: shade / on-hand stock /
units sold in the last N weeks / on
order (tab or comma separated, straight
from the store system export)
b. row-by-row entry, no row limit
- N = the sell-through lookback in weeks,
in a config block at the top of the code,
default [8]; change it once and every
reference in the sheet follows
- Optional per-row flag: new shade (first
time carried); unflagged rows are sorted
hot/slow automatically from the data
2. Output: a shade grading table, one row
per shade
- Columns: shade / stock / on order / weekly
sell-through / weeks of supply /
suggested order qty / status light
- Weeks of supply = (stock + on order) /
weekly sell-through; a non-new shade with
zero sell-through shows "no movement"
here rather than infinity, and never gets
a green light
- Light rules: red = out of stock or weeks
of supply below the safety line [2 weeks];
yellow = below the target turn [6 weeks];
green = at or above it
- Out-of-stock shades get one extra column,
"days of lost sales" = days out of stock x
average daily sales over the last N weeks;
the column header permanently reads
"estimate, extrapolated from the last N
weeks" - it is the case for priority
restock with the manager or an allocation
swap from the brand, not a precise loss
report
- Suggested order qty (rules editable in the
config block): hot shade = target weeks of
supply x weekly sell-through - (stock + on
order); slow shade swaps the target for
the safety line, a shallow top-up; new
shade fixed at the trial quantity [3
units], turn ignored; negative results
clamp to zero
- Summary row: total units this order and an
amount estimate (wholesale price optional),
field order matching the store's purchase
order for direct copy-over
3. Print mode
- One click to a compact layout: type and
columns squeezed so every shade fits one
A4 page, for use on the floor at the
order-writing event
- The print version pairs each light with a
text label (red = urgent) so it survives
black-and-white printing; the
"extrapolated from the last N weeks" tag
prints with it
Boundaries and prohibitions:
- Weekly sell-through, weeks of supply, days
of lost sales, and the amount estimate are
derived columns; every column header
carries "extrapolated from the last N
weeks," and the phrases "smart
replenishment" and "AI forecasting" appear
nowhere in the UI - the tool extends
history, it does not see the future
- No trend modeling: shades whose recent
sell-through swung hard get no automatic
weighting, only a note beside the light -
"volatile, human decides"
- Runs locally, no network, no data
collection; data lives in the page and
clears on refresh (add a local CSV export
button; the export stays local too)
- Restrained, plain interface; no animation,
no decorative color
Start with a one-sentence-per-section page
structure, then the complete single-file
code, then usage advice for the buyer: how
to stage the data the day before the event,
and how to walk the sheet light-by-light on
the floor.
Why it is written this way
Demand in beauty stops at the shade, not the SKU - the customer asks for shade 03, not "one unit of that SKU." SKU-level sell-through averages a dozen shades together, so the hot shade's hunger gets diluted by the slow shades' inventory, and ordering by the set leaves the granularity wherever the brand's shipping convenience put it. Weeks of supply is the common yardstick because it is the one quantity comparable across shades - how many weeks each shade's own stock will hold - and the lights compress dozens of divisions into something scannable on the floor, so attention goes only to red and yellow while green rows go unread.
The allocation rules run three ways - hot topped up, slow shallow-replenished, new capped at a trial quantity - to stop the all-in order. A new shade has no sell-through history; any quantity computed for it is some other shade's past wearing a new name, and the trial quantity is data bought cheap - reordering after it sells through costs far less than discounting it after it doesn't. "Days of lost sales" earns its column in negotiation: priority restock with the manager, an allocation swap from the brand - both ask "what did the stockout cost," and this column answers. But sales during a stockout are unobservable; the number can only be back-filled from the last N weeks' daily average, which is why the estimate tag is welded to the header - spend it once as a precise report and nobody believes the column again.
Refusing to forecast, and flagging volatile shades instead of auto-weighting them, concedes to how beauty sell-through actually behaves. Promo cadence, seasons, and whichever shade an influencer wears this month send lines up and down; letting the tool weight recent weeks harder amplifies noise into signal. The flag "volatile, human decides" fishes those shades out for the buyer alone - the tool is an abacus, not a brain, and banning "smart replenishment" from the interface is not modesty. It keeps anyone, six months from now, from treating it as a forecasting system: at that point the fault would lie not with the tool but with the expectation.
Print mode matches the order-writing floor's real conditions: unreliable network, time measured in minutes, a black-and-white printer. One compact page and lights that carry text labels are the form that survives all three. The summary row mirrors the PO's field order because re-transcription is the purchasing desk's most unnecessary error source - the tool can be perfectly right, and one miscopied shade row erases it.
Variables
| Variable | Description |
|---|---|
| Safety weeks | Weeks-of-supply floor for the red light - 2 weeks by default; brands with long lead times (imports, event-based supply) should raise it to cover one full replenishment cycle, or the light turns red faster than goods can arrive |
| Target turn weeks | Hot shades are topped up to this - 6 weeks by default; high-velocity stores can drop to 4 to reduce cash tied up, slow small stores go to 8 |
| New-shade trial qty | The only quantity a new shade's first order may carry - 3 units per shade by default; low-ticket open-sell color can go to 5, stores burned by past dead stock drop to 2 |