From 210af0df7fb3e56445cbf83378963122202dc224 Mon Sep 17 00:00:00 2001 From: Makombe Kennedy Date: Tue, 19 Mar 2024 22:08:52 +0300 Subject: [PATCH] (fix):Correctly set onOrBefore date affecting incremental generation of queue numbers (#63) --- .../openmrs/module/queue/api/impl/QueueEntryServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java b/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java index cb36f69..3eb1426 100644 --- a/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/queue/api/impl/QueueEntryServiceImpl.java @@ -176,7 +176,7 @@ public String generateVisitQueueNumber(Location location, Queue queue, Visit vis Date onOrAfter = Date.from(LocalDateTime.now().with(LocalTime.MIN).atZone(ZoneId.systemDefault()).toInstant()); criteria.setStartedOnOrAfter(onOrAfter); Date onOrBefore = Date.from(LocalDateTime.now().with(LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant()); - criteria.setStartedOnOrAfter(onOrBefore); + criteria.setStartedOnOrBefore(onOrBefore); Long nextQueueNumber = getCountOfQueueEntries(criteria) + 1; String paddedString = StringUtils.leftPad(String.valueOf(nextQueueNumber), 3, "0"); String serviceName = queue.getName().toUpperCase();