Sale ledger
Runs on every sale alert and at month end.
Procedure
- Match the alert (email or API) to a
sku. If ambiguous, match on order id; if still ambiguous, park it indata/unmatched/and ask. Never guess. - Compute the real net — gross − final value fee − fixed fee − shipping label − packaging − original cost basis. Use the platform's own fee lines when present; the estimate is only for forecasting.
- Split the net profit (not gross) 30 / 30 / 40 into
savings,payout,restock. Existing convention inHERMES.md; keep it unless Chris says otherwise. - Update state — decrement
quantityininventory.json; append tofinance.jsonwith{date, sku, gross, fees, net, splits, balance_after}. - Append in the right place —
data/ledger.csvstays append-only; never rewrite history to make totals look better. Corrections are new negative rows. - Alert — one line to Chris: card, net, new restock balance, and whether the restock target is now met.
- Month end — reconcile
finance.jsonsplits against actual X Money movements; report any drift over $1 as an anomaly with both numbers.
Rules
- Rounding: cents, banker's rounding, ledger sums must match to the cent.
- A refund reverses the split proportionally; it does not touch savings twice.
- Never move money. Read-only on X Money.


