Batches and expiry now follow real stock
Batches now belong to a branch and move with every sale, return, transfer, count and write-off, so expiry lists match the stock on the shelf.
What changed
- Each batch belongs to a branch. Existing batches were placed in the branch that holds the stock.
- Sales take stock from the batch with the earliest expiry first. A named batch can still be picked, and expired batches are used last but never block a sale.
- Returns and voids put stock back into its batch.
- Receiving a purchase creates or tops up batches at landed cost, and purchase returns take from them.
- Adjustments, damage, stock counts and transfers move batches too.
Expiry lists, the pharmacy dashboard, low stock, the stock report and the catalog now read batches per branch.