How Batch Allocation Works in ERPNext Pharma
In ERPNext Pharma, batch allocation happens as an order moves from Sales Order through Pick List to Delivery Note. Because finished products are tracked as batched items, the system requires a batch to be assigned for every quantity dispatched, so no product leaves without a recorded batch number.
When a Warehouse user creates the Delivery Note against a Sales Order, ERPNext Pharma prompts for batch selection from available finished-goods stock. ERPNext batch allocation draws on batch-wise inventory in the Stock Ledger, so the user allocates from batches that actually exist in the dispatch warehouse. The allocated batch and quantity are recorded on the Delivery Note, creating a permanent link between the customer order and the specific batch shipped.
First-Expiry-First-Out Allocation
Pharmaceutical stock must generally move so that the earliest-expiring product ships first, and ERPNext Pharma supports this through expiry-aware allocation. FEFO batch picking (first-expiry-first-out) prioritizes batches with the nearest expiry date when stock is allocated to a dispatch.
- Expiry-Ordered Selection: ERPNext Pharma can present or auto-select batches in first-expiry-first-out order, helping the Warehouse ship the earliest-expiring stock first and reduce write-offs.
- Expiry Date Control : With expiry date control, the system checks each batch's expiry against dispatch, so product that is expired or within a defined shelf-life buffer is not allocated.
- Shelf-Life Requirements: Where a customer or market requires a minimum remaining shelf life, batches that fail that threshold can be prevented from being selected for that order.
This keeps batch-wise dispatch aligned with expiry discipline rather than depending on manual checks at the loading bay.
Dispatching Only Quality-Released Batches
A defining control in ERPNext Pharma is that only batches cleared by quality may ship. Batch allocation is connected to the quality status carried on each batch, so unreleased stock cannot be dispatched.
Finished batches held in a quarantine warehouse or carrying an under-test or rejected status are not available for allocation to a Delivery Note. Only batches that QA has released reflected in ERPNext Pharma through the batch's status and its warehouse location can be selected for dispatch. For example, if a QC investigation places a batch on hold, that batch is unavailable to Warehouse for shipping until QA releases it. This QC-released batch dispatch control ensures the quality decision made in ERPNext Pharma is enforced at the point of dispatch, not left to manual coordination.
Batch Documentation at Dispatch
Every shipment must carry accurate batch documentation, and ERPNext Pharma generates it from the same records used for allocation.
- Batch-Wise Delivery Note: The Delivery Note records each batch number, quantity, and expiry shipped, providing the customer-facing document that reflects exactly what was sent.
- Certificate of Analysis Linkage: Because the batch is identified on the dispatch, the corresponding certificate of analysis and quality records can be associated with the shipment for regulated markets.
- Consistent Electronic Records: Batch, expiry, and quantity are stored as ERPNext electronic records, so the shipping document, stock movement, and inventory ledger all reflect the same batch data.
This keeps dispatch documentation consistent with the physical goods and removes the transcription errors that arise when batch details are written out separately.
Traceability and Recall Readiness
The most important compliance outcome of batch allocation is complete traceability from batch to customer. Because ERPNext Pharma records the exact batch on every Delivery Note, the group can answer the questions a recall demands.
If a batch must be recalled, Warehouse and Regulatory teams can use ERPNext Pharma's batch-wise reports to identify every customer and shipment that received that batch, along with quantities and dates. This product recall readiness turns a potentially chaotic exercise into a controlled query against dispatch records. The same batch traceability supports routine audits, where an inspector may ask to see where a specific batch was distributed, and the answer comes directly from the linked Sales Order and Delivery Note history.
Controlled Access and Audit Trail
Batch allocation is protected by ERPNext Pharma's user permissions and role-based access control, so only authorized Warehouse and QA roles can allocate, release, or dispatch batches. Every allocation, Delivery Note, and stock movement carries the audit trail who acted, when, and against which batch and company. Because allocation, quality status, and dispatch all reference the same batch records, the trail from manufacture to customer is continuous and defensible, supporting audit readiness for both routine inspection and any post-market investigation.
Frequently Asked Questions
How does ERPNext Pharma allocate batches to a customer order?
As an order moves from Sales Order through Pick List to Delivery Note, ERPNext Pharma requires a batch to be assigned for every dispatched quantity, since finished products are tracked as batched items. The Warehouse user selects batches from available finished-goods stock in the Stock Ledger, and the allocated batch and quantity are recorded on the Delivery Note. This creates a permanent link between the customer order and the exact batch shipped.
How does first-expiry-first-out work during dispatch?
ERPNext Pharma supports expiry-aware allocation, presenting or auto-selecting batches in first-expiry-first-out order so the earliest-expiring stock ships first. The system checks each batch's expiry at dispatch, preventing expired stock or product within a defined shelf-life buffer from being allocated. Where a market requires a minimum remaining shelf life, batches failing that threshold can be blocked for that order, keeping dispatch aligned with expiry discipline automatically.
Can unreleased or quarantined batches be dispatched?
No. Batch allocation is tied to each batch's quality status and warehouse location in ERPNext Pharma. Batches held in quarantine or carrying an under-test or rejected status are not available for selection on a Delivery Note. Only batches QA has released can be allocated for dispatch, so a batch placed on hold during a QC investigation cannot ship until it is released. This enforces the quality decision at the point of dispatch.
What batch documentation is produced at dispatch?
The Delivery Note records each batch number, quantity, and expiry shipped, giving the customer-facing document that reflects exactly what was sent. Because the batch is identified on the dispatch, the corresponding certificate of analysis and quality records can be associated with the shipment for regulated markets. Batch, expiry, and quantity are stored as ERPNext electronic records, so the shipping document, stock movement, and ledger stay consistent.
How does batch allocation support product recalls?
Because ERPNext Pharma records the exact batch on every Delivery Note, batch-wise reports can identify every customer, shipment, quantity, and date that received a given batch. In a recall, Warehouse and Regulatory teams query these dispatch records to trace distribution quickly and completely, rather than reconstructing it manually. The same batch-to-customer link supports routine audits where an inspector asks where a specific batch was distributed.
How does the feature maintain traceability and audit readiness?
Allocation, quality status, and dispatch all reference the same batch records, so the trail from manufacture to customer is continuous. Every allocation, Delivery Note, and stock movement carries ERPNext Pharma's audit trail who acted, when, and against which batch. Combined with batch-wise reporting, this lets teams demonstrate exactly where each batch went and confirm that only appropriate batches were dispatched, supporting inspection and post-market investigation.
Which departments use batch allocation for sales and dispatch?
Warehouse performs allocation and creates Delivery Notes, QA controls which batches are released and available to ship, and Regulatory relies on the batch-to-customer traceability for recalls and market compliance. Sales teams reference batch and expiry information on orders where relevant. Because all functions work on the same ERPNext Pharma batch records under role-based access control, dispatch decisions stay controlled and consistently documented.
Conclusion
Batch allocation for sales and dispatch governs which finished-product batches ship to which customers, entirely within ERPNext Pharma. By requiring batch selection on every Delivery Note, applying first-expiry-first-out and expiry checks, and allowing only QA-released batches to be dispatched, ERPNext Pharma ensures appropriate stock leaves the facility and shipping documents reflect exactly what was sent. The recorded batch-to-customer link delivers the traceability regulators expect, turning recall response into a controlled query and supporting routine audits. Protected by role-based access control and a complete audit trail, the feature gives Warehouse, QA, and Regulatory teams controlled, fully documented dispatch and dependable batch traceability across pharmaceutical distribution.