Batches & expiry
Batch numbers, expiry dates, and first-expired-first-out.
A batch-tracked product's stock is not one number but a set of batches — each delivery its own lot, with its own cost, dates and quantity. Batch tracking is switched on per product (with expiry tracking on top), and once it is on, every intake names its batch.
Who can do this: the same permissions as adjusting stock — batches are edited on the product's stock page.
Your batch numbers have one shape: the letter B followed by exactly 5 digits — the form says it plainly: "Batch number must be the letter B followed by 5 digits, for example B00042." Numbers outside that shape belong to the system: batches minted by quarantine holds, returns and opening-stock seeds carry their own prefixes, and typing one gets "That batch number is reserved for the system." You will see system batches in the batch editor — leave them be; they are the record of where that stock came from.
Each batch carries its quantity, what it cost to bring in, an optional sale price, and — with expiry tracking — its expiry and manufacture dates.
Sales drain batches soonest-expiry-first (undated batches last), so the stock that spoils first leaves first without anyone thinking about it. The batch editor shows exactly which lots remain — and, as it says itself, the sum of the batch quantities is what computes the physical stock on hand.
The Expiring products tab lists stock whose batch has a date within the next 90 days — including already-expired stock still on the shelf. Products can also set a shelf-life alert of their own.