Project

General

Profile

Actions

Bug #692

open
MN MN

Batch Expiring First Not Always Picked for Billing or Dispensing

Bug #692: Batch Expiring First Not Always Picked for Billing or Dispensing

Added by Medha N. 13 days ago. Updated 4 days ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
-
Start date:
10/30/2026
Due date:
% Done:

0%

Estimated time:
Resolved By:

Description

When billing or dispensing a drug that has multiple batches in stock, the batch expiring first should be picked/billed against first (FEFO — First-Expiry-First-Out), so that older stock is used up before newer stock. 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).

Actions

Also available in: PDF Atom