Batches and expiry dates: finding out who received what
A suspect batch, and one question: which customers got it? Batches, expiry dates, picking by expiry, quality inspections and alerts, for plants and food.

A supplier calls the quality manager: a batch of material delivered three weeks ago has a defect. The question follows straight away. Where did that batch go? Some of it may still be in the store, some has been used in production, and finished goods have already left for customers. To find out, the quality manager opens the receiving log, then the production sheets, then the delivery notes filed by date, hoping someone wrote the batch number down at every step.
In a pharmacy or a food business the scene looks different: an expired box found on the shelf while newer stock was waiting behind it.
Why the batch number gets lost along the way
The batch number is often written down once, at receipt, and then nobody carries it any further. Production mixes several batches without saying so. Delivery notes give the item and the quantity, rarely the batch. In the store, people pick whatever is at the front, and the expiry date is discovered when the product has already expired.
While nothing goes wrong, nobody notices. On the day a batch has to be recalled, the company has a few hours to rebuild a path that nobody followed, and it often ends up recalling far more than it needs to, because it cannot tell where to stop.
A batch that follows every movement
In FlexiERP an item can be tracked by batch. The batch carries its number, the item, the manufacturing date, the expiry date, the initial quantity and the quantity still available. Numbers can be generated with an automatic prefix. For single pieces, such as a machine or a piece of equipment, the serial number takes over, with its warranty.
The batch does not stop at the store. The workshop’s job card records actual material consumption by batch, and the delivery note shows the batch delivered. The batch history then traces every movement: where it came from, which work orders consumed it, which delivery notes shipped it, and therefore which customers received it. For food products in Morocco, ONSSA requires exactly this kind of batch traceability.
First to expire, first out
Shelf life is set on the item record. When a delivery is prepared and the item is tracked by batch, the batch offered follows the order of expiry dates by default, the nearest first. The storekeeper no longer has to dig through the shelf for the right pallet.
A dedicated report flags batches approaching their date, and the stock ageing report shows stock that has stopped moving. A look at both at the start of the day is enough to know what to sell first and what not to reorder.
Quality inspections tied to the batch
Quality inspection happens at receipt, on a batch, and in production as well. The inspector enters the measured parameters, the application compares them with the inspection template and its minimum and maximum values, and the batch is accepted or rejected. A non-conformity can be linked to an item, a batch or a procedure, and it moves through its stages: open, investigated, root cause found, action launched, closed. A customer complaint comes up the same way. The quality dashboard shows inspections, non-conformities and scrap that is qualified and traced.
The batch on the delivery note also serves the invoice, which is created from that note with the quantities actually delivered. In the electronic invoicing model announced by the DGI, pending its decree, every invoice would be checked by the tax platform before it reaches the customer; the calendar will be set by the decree. An invoice that carries over the delivery, the customer’s ICE, VAT stated separately and a number in its series is the kind of data that passes that check. FlexiERP keeps that data structured and complete, and FlexiGlob sets up the connection with the tax platform as part of the deployment, once the format is published.
One condition remains that software cannot meet alone: the batch has to be entered at receipt, every time, even on the busiest days. Once that habit is in place, a batch’s path can be traced from its history, without digging through binders.


