From 82e093465753852451c459a6745ff023498f7afe Mon Sep 17 00:00:00 2001 From: makombe Date: Tue, 19 Mar 2024 08:02:17 +0300 Subject: [PATCH] (fix):Correctly set onOrBefore date affecting incremental generation of queue numbers --- .../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();