From 9de0c494352aad72afe1a381ed5a1e41fdd99a14 Mon Sep 17 00:00:00 2001 From: David B Malkovsky Date: Tue, 19 Nov 2024 16:13:59 -0500 Subject: [PATCH] Chore: simplify and make obvious date comparison being done (#1455) --- .../org/isf/medicalstock/manager/MovStockInsertingManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/isf/medicalstock/manager/MovStockInsertingManager.java b/src/main/java/org/isf/medicalstock/manager/MovStockInsertingManager.java index e0925356e..19b586dd3 100644 --- a/src/main/java/org/isf/medicalstock/manager/MovStockInsertingManager.java +++ b/src/main/java/org/isf/medicalstock/manager/MovStockInsertingManager.java @@ -214,7 +214,7 @@ private void validateLot(List errors, Lot lot, boolean check if (lot.getDueDate() == null) { errors.add(new OHExceptionMessage(MessageBundle.getMessage("angal.medicalstock.insertavalidduedate.msg"))); } - if (lot.getPreparationDate() != null && lot.getDueDate() != null && lot.getPreparationDate().compareTo(lot.getDueDate()) > 0) { + if (lot.getPreparationDate() != null && lot.getDueDate() != null && lot.getPreparationDate().isAfter(lot.getDueDate())) { errors.add(new OHExceptionMessage(MessageBundle.getMessage("angal.medicalstock.thepreparationdatecannotbyaftertheduedate.msg"))); } }