Cost-of-goods + margin-driven pricing — derive menu prices from material costs #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracks the COGS / pricing layer of #2 (
bistroandfulltiers).Background
The user's vision:
Restaurants today set menu prices by gut feel + competitor-watching,
or by spreadsheet labor. We have all the inputs already in the
extension (or imminent in #3): we know what each material cost, we
know what goes into each item, we know labor / overhead allocation.
Adding a margin slider gives a derived recommended price — and ties
naturally into the libra (Beancount-flavored) accounting module
the user maintains in a sibling extension.
What this issue owns
walking its #3 and aggregating
material_batch.unit_cost_msat * recipe_line.qty_per_serving.Average over the most-recent N batches (FIFO or rolling avg —
configurable).
menu price. Operator can:
menu_items.priceis updated;warning when actual margin diverges;
pricerecalculates whenever a newmaterial_batchlands.COGS, current margin %, and a colored indicator when margin
drifts under a configurable floor.
accounting record (revenue line + COGS line + tax line)
shaped for libra's ledger consumption. Either:
Decide as part of this issue.
Behavior
manual | auto | suggest.pot of soup → 4 bowls). COGS divides by
yield_qty.cost_msat_deltaderived the same way from its own mini-recipe. The customer
pays
price + sum(price_delta); the COGS stack mirrors withcogs_msat + sum(cost_msat_delta).precision when materials are priced in fiat (e.g. GTQ).
Conversions happen at batch time using LNbits's exchange-
rate plumbing, not at order time.
Operator UX
cost breakdown, current margin, slider for target margin,
suggested price.
default margin floor (warns when actual margin drops below).
list — useful when material prices spike.
Tiering (per #2)
expansion). Margin badge shown.
recipes). All three pricing modes available. libra integration
on.
Stretch
material costs fluctuate.
carnitas, your margin would recover by 8 points."
with low aging stock.
optionally embed a footer hash of the COGS basis the prices
were derived from. Auditable trail.
Acceptance
recipe_lines.cost_msat_per_unit(denormalized; recomputedwhen batches land) OR a view that computes on read.
menu_items.pricing_mode,.target_margin_pct,.computed_cogs_msat.services/pricing.py.See also
margin trail)
~/dev/shared/extensions/libra—the accounting target)
References