Project

General

Profile

Bug #692

Updated by Roshni Harish. 10 days ago

When billing or dispensing a drug that has multiple batches in stock, dispensing, the batch expiring that expires first should be picked/billed against first (FEFO — First-Expiry-First-Out), so that older stock is used up before newer stock. picked first. This has been reported as not happening — the earliest-expiring batch is not getting used first. 

 Impact 
 If the earliest-expiring batch is genuinely not prioritised, near-expiry stock can sit unused while later-expiring stock gets sold or dispensed instead, so the near-expiry stock eventually expires on the shelf. This causes direct financial loss (write-offs), unnecessary wastage, and for Schedule drugs, potential compliance/traceability concerns around dispensing from the wrong batch. 

 Environment 
 Reported as happening in production. Also checked live in the test environment (Vetri Vivega Medical Center, vvmc.test.clinq.health), Pharmacy > Counter Sale, on 02 Nov 2026. 

 Steps to Reproduce 
 No specific steps are available for the production report yet (no drug name, batch numbers, or bill number given). 

 In the test environment, tried: 1. Find a drug with two or more non-quarantined, non-expired batches at different expiry dates in the same store (e.g., Amoxicillin 500mg: batch GLN4455 expiring 12 Sep 2028, and batch “wert” expiring 23 Oct 2036, both in Main Store). 2. Go to Pharmacy > Counter Sale > New Counter Sale and add that drug. 3. Check which batch the line item is billed against. 

 Expected 
 Expected: When billing or dispensing a drug with multiple batches in stock, the system should bill/dispense against the batch with the earliest expiry date among batches that are actually eligible (not expired, not on quarantine/hold). now.

Back