Added validation for impact value when impact type is percentage for the advance price rule

This commit is contained in:
vishalsingh.qlo325
2025-03-13 16:34:40 +05:30
parent c0a3358ad3
commit a4ef6e60cd

View File

@@ -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.');
}
}