Merge branch 'develop' into gli-1933

This commit is contained in:
vishalsingh.qlo325
2024-07-08 15:21:01 +05:30
56 changed files with 918 additions and 454 deletions

View File

@@ -1049,22 +1049,27 @@ class AdminCustomersControllerCore extends AdminController
$customer = new Customer();
if (Validate::isEmail($customer_email)) {
$customer->getByEmail($customer_email);
}
if ($customer->id) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
if ($customer->id) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
$this->display = 'edit';
return $customer;
} elseif (trim(Tools::getValue('passwd')) == '') {
$this->validateRules();
$this->errors[] = Tools::displayError('Password can not be empty.');
$this->display = 'edit';
} elseif ($customer = parent::processAdd()) {
$this->context->smarty->assign('new_customer', $customer);
return $customer;
}
} else {
$this->errors[] = Tools::displayError('Invalid email address.');
$this->display = 'edit';
return $customer;
} elseif (trim(Tools::getValue('passwd')) == '') {
$this->validateRules();
$this->errors[] = Tools::displayError('Password can not be empty.');
$this->display = 'edit';
} elseif ($customer = parent::processAdd()) {
$this->context->smarty->assign('new_customer', $customer);
return $customer;
}
return false;
}
public function processUpdate()
{
if (Validate::isLoadedObject($this->object)) {
@@ -1075,7 +1080,10 @@ class AdminCustomersControllerCore extends AdminController
$customer = new Customer();
if (Validate::isEmail($customer_email)) {
$customer->getByEmail($customer_email);
} else {
$this->errors[] = Tools::displayError('Invalid email address.');
}
if (($customer->id) && ($customer->id != (int)$this->object->id)) {
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
}

View File

@@ -2992,7 +2992,7 @@ class AdminNormalProductsControllerCore extends AdminController
->setUseSearch(false)
->setFullTree(0)
->setSelectedCategories($categories)
->setUseBulkActions(false);
->setUseBulkActions(true);
$data->assign(array('default_category' => $default_category,
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
@@ -3508,7 +3508,7 @@ class AdminNormalProductsControllerCore extends AdminController
->setRoomsOnly(false)
->setSelectedHotels($selectedElements['hotels'])
->setSelectedRoomTypes($selectedElements['room_types'])
->setUseBulkActions(false)
->setUseBulkActions(true)
->setAccessedHotels(HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 0));
$data->assign('hotel_tree', $tree->render());

View File

@@ -5278,20 +5278,23 @@ class AdminOrdersControllerCore extends AdminController
// update order detail for selected aditional services
foreach ($selectedAdditonalServices['additional_services'] as $service) {
$serviceOrderDetail = new OrderDetail($service['id_order_detail']);
if ($service['quantity'] >= $serviceOrderDetail->product_quantity) {
$cart_quantity = $service['quantity'];
if ($service['product_price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
$cart_quantity = $cart_quantity * $product_quantity;
}
if ($cart_quantity >= $serviceOrderDetail->product_quantity) {
$serviceOrderDetail->delete();
} else {
$order_detail->total_price_tax_incl -= Tools::ps_round($service['total_price_tax_incl'], 6);
$order_detail->total_price_tax_excl -= Tools::ps_round($service['total_price_tax_excl'], 6);
$serviceOldQuantity = $serviceOrderDetail->product_quantity;
$serviceOrderDetail->product_quantity = $serviceOldQuantity - $service['quantity'];
$serviceOrderDetail->total_price_tax_incl -= Tools::ps_round($service['total_price_tax_incl'], 6);
$serviceOrderDetail->total_price_tax_excl -= Tools::ps_round($service['total_price_tax_excl'], 6);
$serviceOrderDetail->product_quantity -= $cart_quantity;
// update taxes
$res &= $order_detail->updateTaxAmount($order);
$res &= $serviceOrderDetail->updateTaxAmount($order);
// Save order detail
$res &= $order_detail->update();
$res &= $serviceOrderDetail->update();
}
}
/*End*/

View File

@@ -2202,10 +2202,14 @@ class AdminProductsControllerCore extends AdminController
}
if (!$res) {
$this->errors[] = sprintf(
Tools::displayError('The %s field is invalid.'),
call_user_func(array($className, 'displayFieldName'), $field, $className)
);
if (Tools::strtolower($field) == 'wholesale_price') {
$this->errors[] = Tools::displayError('The Pre-tax operating cost field is invalid.');
} else {
$this->errors[] = sprintf(
Tools::displayError('The %s field is invalid.'),
call_user_func(array($className, 'displayFieldName'), $field, $className)
);
}
}
}
}