From 9d166362a7a75aba5a1ff305e5e06cf9367a184f Mon Sep 17 00:00:00 2001 From: Avinash Rajesh Date: Wed, 17 Jun 2026 15:17:55 +0530 Subject: [PATCH] Latest Notification Is Determined Using String Comparison Changes: - Added #include "StringHelper.h" to MenuHelper.h for utility functions. - Updated displayNewNotification() to compare notification IDs using util::extractNumber() instead of raw string comparison. - Ensured numeric ordering of notifications by extracting and comparing integer values from IDs. - Preserved existing notification selection logic while improving accuracy of ID comparisons. Fixes #2081 --- .../Trenser.VehicleServiceSystem/views/MenuHelper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/MenuHelper.h b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/MenuHelper.h index a92bead..c87707a 100644 --- a/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/MenuHelper.h +++ b/Trenser.VehicleServiceSystem/Trenser.VehicleServiceSystem/views/MenuHelper.h @@ -28,6 +28,7 @@ Date: 21-May-2026 #include "Utility.h" #include "Validator.h" #include "Vector.h" +#include "StringHelper.h" /* Function: displayAllServices @@ -1430,7 +1431,7 @@ inline void displayNewNotification(util::Vector notificatio } else { - if (notification->getId() < notifications[index]->getId()) + if (util::extractNumber(notification->getId()) < util::extractNumber(notifications[index]->getId())) { notification = notifications[index]; } @@ -1450,4 +1451,4 @@ inline void displayNewNotification(util::Vector notificatio MB_OK | MB_ICONINFORMATION); } -} \ No newline at end of file +}