Added validation for impact value when impact type is percentage for the advance price rule
This commit is contained in:
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user