From a4ef6e60cd4faebf6f60546dc7ff866c92314b80 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 13 Mar 2025 16:34:40 +0530 Subject: [PATCH] Added validation for impact value when impact type is percentage for the advance price rule --- .../controllers/admin/AdminHotelFeaturePricesSettings.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php index 7cd48a1ee..830d1a635 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php @@ -480,6 +480,10 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController } else { if (!Validate::isPrice($impactValue)) { $this->errors[] = $this->l('Invalid value of impact value.'); + } else if ($priceImpactType == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE + && $impactValue > 100 // check if percentage added is greater then 100 + ) { + $this->errors[] = $this->l('Invalid value of impact value.'); } } @@ -651,6 +655,10 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController } else { if (!Validate::isPrice($impactValue)) { $this->errors[] = $this->l('Invalid value of impact value.'); + } else if ($priceImpactType == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE + && $impactValue > 100 // check if percentage added is greater then 100 + ) { + $this->errors[] = $this->l('Invalid value of impact value.'); } }