# What happens to stock and profit when you record a sale?

> Saving a sale writes one stock-out movement per line at the item's current weighted-average cost, reduces stock, draws down the oldest expiry batch first, freezes that cost on the line for profit, counts one sale toward your monthly cap, and assigns an invoice number. Ingredients are not touched unless the sale auto-produces.

_Category: Daily use · Updated 2026-10-18 · Canonical: https://jogan.cloud/help/what-happens-when-you-record-a-sale_

Everything below happens in one transaction: either the whole sale is recorded or nothing is, so a shortage can never leave a half-recorded sale behind.

## Step by step

1. **Cap check.** One sale is reserved against your plan's monthly sales limit. At the cap, the sale is refused. See [The monthly sales limit](https://jogan.cloud/help/monthly-sales-limit).
2. **Stock check.** Each line is checked against the item's current stock. A shortfall refuses the sale unless auto-produce is ticked.
3. **Auto-produce (optional).** For each short item with a recipe, a production run is recorded for the shortfall, rounded up to whole batches: components leave stock at their average cost, the finished item enters at the rolled-up cost. This is the only situation in which a sale touches ingredients.
4. **Stock-out per line.** A `sale` movement is written for each line, costed at the item's weighted-average cost at that moment. The item's stock falls by the quantity.
5. **Batch draw-down.** For expiry-tracked items, the quantity is taken from the batch expiring soonest, spilling into the next when one runs out. The movement records which lots it drew from.
6. **Cost frozen on the line.** Each line stores the unit price and the cost at sale, so profit is fixed now and does not change when future purchases move the average.
7. **Invoice number.** `INV-` plus the sale's date (the day you picked, for a backdated sale) and a daily sequence, unique in your workspace.

## Does a sale deduct recipe ingredients?

Not normally. Ingredients are consumed when you **run production**, which is when the finished item is made and added to stock. A sale then deducts the finished item. If you sell things you make to order and do not want a separate production step, tick **Auto-produce items not yet in stock** on the sale; Jogan runs the recipe for the shortfall as part of the sale. See [How to run production](https://jogan.cloud/help/run-production).

## What you see afterwards

- **Items**: the item's stock is lower.
- **Stock**: a `Sale` movement for each line with the cost used.
- **Batches**: the batch quantity is lower; a batch at zero shows as Sold out.
- **Dashboard**: Today's sales and Today's profit include it.
- **Reports → Sales / Profit**: totals and the by-item breakdown include it. See [How profit is calculated](https://jogan.cloud/help/how-profit-is-calculated).

## Undoing it

Only an Admin can delete a sale. Deletion restores the stock and the batch quantities it drew from and removes it from the reports. See [How to fix a mistake](https://jogan.cloud/help/fix-a-mistake).
