From e928368638ff0ed42a249005dff62de6e4dcbf8e Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 10 Sep 2025 15:17:04 +0530 Subject: [PATCH 001/176] Fixed: Incorrect information on the room type page regarding max capacity in front office --- themes/hotel-reservation-theme/product.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/product.tpl b/themes/hotel-reservation-theme/product.tpl index 9492fbc86..67f4a03fe 100644 --- a/themes/hotel-reservation-theme/product.tpl +++ b/themes/hotel-reservation-theme/product.tpl @@ -238,13 +238,13 @@ {/block} {block name='product_info_tab_room_guests'} - {if isset($room_type_info['adults']) && isset($room_type_info['children']) } + {if isset($room_type_info['max_adults']) && isset($room_type_info['max_children']) }
{l s='Max Capacity'}
-

{$room_type_info['adults']} {l s='Adults'}, {$room_type_info['children']} {if $room_type_info['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if} ({l s='Max guests'}: {$room_type_info['max_guests']|escape:'htmlall':'UTF-8'})

+

{$room_type_info['max_adults']} {l s='Adults'}, {$room_type_info['max_children']} {if $room_type_info['max_children'] > 1}{l s='Children'}{else}{l s='Child'}{/if} ({l s='Max guests'}: {$room_type_info['max_guests']|escape:'htmlall':'UTF-8'})

{/if} From 8bee1d8378ee295a07b962883ccb5a416109048b Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 10 Sep 2025 15:54:05 +0530 Subject: [PATCH 002/176] Fixed: Getting Access denied issue on the back-office --- classes/Profile.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/classes/Profile.php b/classes/Profile.php index 1a9dabda2..39637163a 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -141,11 +141,18 @@ class ProfileCore extends ObjectModel ); } } else { - $result = Db::getInstance()->executeS(' - SELECT * - FROM `'._DB_PREFIX_.'access` a - LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab - WHERE `id_profile` = '.(int)$id_profile); + if ($result = Db::getInstance()->executeS(' + SELECT * FROM `'._DB_PREFIX_.'access` a + LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab + WHERE `id_profile` = '.(int)$id_profile) + ) { + foreach ($result as $key => $profileAccess) { + $result[$key]['view'] = (int) $profileAccess['view']; + $result[$key]['delete'] = (int) $profileAccess['delete']; + $result[$key]['add'] = (int) $profileAccess['add']; + $result[$key]['edit'] = (int) $profileAccess['edit']; + } + } foreach ($result as $row) { self::$_cache_accesses[$id_profile][$type][$row[$type]] = $row; From 1a853640df47d6ae4e729606cf0837403e6f98e9 Mon Sep 17 00:00:00 2001 From: amandeep sharma qlo Date: Tue, 28 Oct 2025 11:32:27 +0530 Subject: [PATCH 003/176] Fixed: Improper Session Invalidation --- classes/Cookie.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/Cookie.php b/classes/Cookie.php index de404e6ae..ef31241ee 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -332,6 +332,14 @@ class CookieCore $this->logout(); } + if (isset($this->_content['id_customer']) && isset($this->_content['passwd']) && (int)$this->_content['id_customer']) { + if (Validate::isLoadedObject($objCustomer = new Customer((int)$this->_content['id_customer']))) { + if ($objCustomer->passwd != $this->_content['passwd']) { + $this->logout(); + } + } + } + if (!isset($this->_content['date_add'])) { $this->_content['date_add'] = date('Y-m-d H:i:s'); } From cd9c51ce63ac3f84f7d6fd0bf0c1a3d4fdcf59cd Mon Sep 17 00:00:00 2001 From: amandeep sharma qlo Date: Thu, 6 Nov 2025 21:09:34 +0530 Subject: [PATCH 004/176] [Fix]: Open Redirection --- classes/controller/AdminController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 67d88e69a..cf38cfc5b 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1417,8 +1417,8 @@ class AdminControllerCore extends Controller } elseif ($this->postImage($object->id) && !count($this->errors) && $this->_redirect) { $parent_id = (int)Tools::getValue('id_parent', 1); // Specific back redirect - if ($back = Tools::getValue('back')) { - $this->redirect_after = urldecode($back).'&conf=4'; + if (($back = Tools::secureReferrer(Tools::getValue('back'))) && $back != __PS_BASE_URI__) { + $this->redirect_after=urldecode($back).'&conf=4'; } // Specific scene feature // @todo change stay_here submit name (not clear for redirect to scene ... ) From ea5ae9c3aecb91709c15b193fe6fdc625caa6f55 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Mon, 24 Nov 2025 13:37:38 +0530 Subject: [PATCH 005/176] Fixed : Need to add id elem in the callback for the start Tree --- admin/themes/default/template/helpers/tree/tree.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/helpers/tree/tree.tpl b/admin/themes/default/template/helpers/tree/tree.tpl index c81b96460..8942abe52 100644 --- a/admin/themes/default/template/helpers/tree/tree.tpl +++ b/admin/themes/default/template/helpers/tree/tree.tpl @@ -123,7 +123,7 @@ function startTree(idElem) { if (typeof $.fn.tree === 'undefined') { - setTimeout(startTree, 100); + setTimeout(function() { startTree(idElem); }, 100); return; } From 5b1bca050e97c249d168800d5083e9b337a24566 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 27 Nov 2025 16:40:03 +0530 Subject: [PATCH 006/176] Fixed: use is_object instead of isset --- classes/controller/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 67d88e69a..65442ce7d 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2387,7 +2387,7 @@ class AdminControllerCore extends Controller $must_have_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST); if (!empty($must_have_module_list) && $must_have_module_list_xml = @simplexml_load_string($must_have_module_list)) { $must_have_module_list_array = array(); - if (is_object($country_module_list_xml->module)) { + if (is_object($must_have_module_list_xml->module)) { foreach ($must_have_module_list_xml->module as $l => $mo) { $all_module_list[] = (string)$mo->name; } From 12b1aeb4b26dfe4ee2ab57385da53c05befbcaad Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 4 Dec 2025 12:26:19 +0530 Subject: [PATCH 007/176] remove installbulk action and add new feature to enable/ disable multiple modules at once in back office --- .../template/controllers/modules/js.tpl | 22 +++++++++ .../template/controllers/modules/list.tpl | 13 ++++-- controllers/admin/AdminModulesController.php | 45 ++++++++++++++++++- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/admin/themes/default/template/controllers/modules/js.tpl b/admin/themes/default/template/controllers/modules/js.tpl index d91c1b3bb..e1d8e4d65 100644 --- a/admin/themes/default/template/controllers/modules/js.tpl +++ b/admin/themes/default/template/controllers/modules/js.tpl @@ -65,6 +65,28 @@ document.location.href=currentIndex+'&token='+token+'&'+action+'='+module_list.substring(1, module_list.length); } + // Module bulk enable/disable + function update_modules_activation_bulk(action) + { + var modules = document.getElementsByName('modules'); + var module_list = ''; + var type = 'enabled'; + + for (var i = 0; i < modules.length; i++) + { + if (modules[i].checked == true) + { + module_list += '|'+modules[i].value; + } + } + if(action=='bulkDisable'){ + type = 'disabled'; + } + + document.location.href=currentIndex+'&token='+token+'&bulkEnable=1&type='+type+'&modules='+module_list.substring(1, module_list.length); + } + + $('document').ready( function() { // ScrollTo if (anchor != '') diff --git a/admin/themes/default/template/controllers/modules/list.tpl b/admin/themes/default/template/controllers/modules/list.tpl index 6166962a4..3674543fe 100644 --- a/admin/themes/default/template/controllers/modules/list.tpl +++ b/admin/themes/default/template/controllers/modules/list.tpl @@ -191,11 +191,18 @@
{if isset($selectedRoomDemands) && $selectedRoomDemands} From f3ec5908477140676888e4123e675bd9de3e4e6c Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Fri, 26 Dec 2025 17:33:33 +0530 Subject: [PATCH 019/176] Fixed: Issue faced while adding an order message during back office order placement. --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index cd2874dba..eee3c18b8 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -3593,7 +3593,7 @@ class AdminOrdersControllerCore extends AdminController $messages = array_merge($customerMessages, $messages); usort($messages, function ($a, $b) { - return strtotime($a['date_add']) < strtotime($b['date_add']); + return (strtotime($a['date_add']) < strtotime($b['date_add'])) ? 1 : -1; }); } From 05809592fc975eb6440bdcd83fbb4fcce4069580 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Mon, 29 Dec 2025 16:59:45 +0530 Subject: [PATCH 020/176] Padding will be only added where there are child elements of #center_column --- themes/hotel-reservation-theme/css/global.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/css/global.css b/themes/hotel-reservation-theme/css/global.css index 1c8ecf2e3..7fb667b55 100644 --- a/themes/hotel-reservation-theme/css/global.css +++ b/themes/hotel-reservation-theme/css/global.css @@ -5776,10 +5776,13 @@ textarea { background: #fff; } #columns { + padding: 0; +} +#columns:has(#center_column > *) { position: relative; padding-bottom: 50px; - padding-top: 15px; } - + padding-top: 15px; +} #index .tab-content { margin-top: 35px; margin-bottom: 34px; } From 01376d81fc5849fa2b23d54e9fd5c0439b3931d4 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Wed, 31 Dec 2025 15:57:19 +0530 Subject: [PATCH 021/176] Fixed: add more condition to check messages --- controllers/admin/AdminOrdersController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index eee3c18b8..de1e9eaa6 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -3591,10 +3591,11 @@ class AdminOrdersControllerCore extends AdminController } } - $messages = array_merge($customerMessages, $messages); - usort($messages, function ($a, $b) { - return (strtotime($a['date_add']) < strtotime($b['date_add'])) ? 1 : -1; - }); + if($messages = array_merge($customerMessages, $messages)){ + usort($messages, function ($a, $b) { + return (strtotime($a['date_add']) < strtotime($b['date_add'])) ? 1 : -1; + }); + } } // send hotel standalone and standalone products From 6690f4a79838ceef52e7758f4bfabe7c4e13cb2b Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Mon, 5 Jan 2026 11:49:34 +0530 Subject: [PATCH 022/176] Fixed:Order status issue during reallocation when the admin upgrades the room category. --- .../classes/HotelBookingDetail.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index fbf4ba1c6..8bdbbfdeb 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -2317,6 +2317,23 @@ class HotelBookingDetail extends ObjectModel OrderReturnDetail::deleteReturnDetailByIdBookingDetail($objOldHotelBooking->id_order, $idHotelBooking); } + $totalPaid = (float)$objOrder->getTotalPaid(); + $orderTotal = (float)$objOrder->getOrderTotal(); + $currentState = $objOrder->getCurrentOrderState(); + if (Validate::isLoadedObject($currentState)) { + $idEmployee = (int) $context->employee->id; + if ($totalPaid < $orderTotal && $currentState->id == Configuration::get('PS_OS_PAYMENT_ACCEPTED')) { + $objOrder->setCurrentState( + Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'), + $idEmployee + ); + } elseif ($totalPaid >= $orderTotal && $currentState->id == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')) { + $objOrder->setCurrentState( + Configuration::get('PS_OS_PAYMENT_ACCEPTED'), + $idEmployee + ); + } + } // =============================================================== // END Delete Process of the old booking // =============================================================== From cec5fb73900cf6f0a763cdf9a23b4a136170cf94 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Mon, 5 Jan 2026 19:06:51 +0530 Subject: [PATCH 023/176] Update the text of the 'view room' to the 'View property' at our properties page in the front-office --- themes/hotel-reservation-theme/our-properties.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/hotel-reservation-theme/our-properties.tpl b/themes/hotel-reservation-theme/our-properties.tpl index 094f83dff..88f46e6ac 100644 --- a/themes/hotel-reservation-theme/our-properties.tpl +++ b/themes/hotel-reservation-theme/our-properties.tpl @@ -74,7 +74,7 @@ {$hotel['email']}

- {l s='View Rooms'} + {l s='View Property'} {if ($hotel['latitude'] != 0 || $hotel['longitude'] != 0) && $viewOnMap} {l s='View on map'} {/if} From 5531ca62ce394a65574c7df90bcef62d11a1e82f Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 8 Jan 2026 15:29:13 +0530 Subject: [PATCH 024/176] Fixed: tax calculation issue when the room type price is 0 --- .../classes/HotelRoomTypeFeaturePricing.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index 66c23e044..dd4f7da37 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -284,11 +284,11 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $featureImpactPriceTI = 0; $productPriceTI = Product::getPriceStatic((int) $id_product, 1, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, 0, $id_group); $productPriceTE = Product::getPriceStatic((int) $id_product, 0, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, 0, $id_group); - if ($productPriceTE) { - $taxRate = (($productPriceTI-$productPriceTE)/$productPriceTE)*100; - } else { - $taxRate = 0; - } + $id_address = HotelRoomType::getHotelIdAddressByIdProduct($id_product); + $objAddress = new Address($id_address); + $id_tax_rule_group = Product::getIdTaxRulesGroupByIdProduct((int)$id_product); + $tax_calculator = TaxManagerFactory::getManager($objAddress, $id_tax_rule_group)->getTaxCalculator(); + $taxRate = $tax_calculator->getTotalRate(); if (is_array($occupancy) && count($occupancy)) { $quantity = count($occupancy); From fc298af2059d1b3c1dc81356a7fa7219bc85c173 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Thu, 8 Jan 2026 15:47:15 +0530 Subject: [PATCH 025/176] Fixed: Export option is not working correctly in case of filter data --- classes/controller/AdminController.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 67d88e69a..d9e3657ab 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -876,13 +876,9 @@ class AdminControllerCore extends Controller $filters = array(); if (isset($this->list_id)) { foreach ($_POST as $key => $value) { - // only process the filter fields. - if (stripos($key, $this->list_id.'Filter_') !== 0) { - continue; - } if (is_array($value)) { - if ($value[0] === '' && $value[1] === '') { + if (isset($value[0], $value[1]) && $value[0] === '' && $value[1] === '') { $value = ''; } else { $value = json_encode($value); @@ -899,13 +895,9 @@ class AdminControllerCore extends Controller } foreach ($_GET as $key => $value) { - // only process the filter fields. - if (stripos($key, $this->list_id.'Filter_') !== 0) { - continue; - } if (is_array($value)) { - if ($value[0] === '' && $value[1] === '') { + if (isset($value[0], $value[1]) && $value[0] === '' && $value[1] === '') { $value = ''; } else { $value = json_encode($value); From 858e1797be79eeb08450229710cd088c276df844 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 9 Jan 2026 15:32:54 +0530 Subject: [PATCH 026/176] fixed Incorrect message on the admin products on trying to enable the room type if the hotel is inactive --- controllers/admin/AdminProductsController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index bf4321607..dacb1a554 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2023,6 +2023,14 @@ class AdminProductsControllerCore extends AdminController if (($error = $this->object->validateFieldsLang(false, true)) !== true) { $this->errors[] = $error; } + if(!count($this->errors)){ + $objHotelRoomType = new HotelRoomType(); + $roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->object->id); + $objHotelBranchInformation = new HotelBranchInformation((int)$roomTypeInfo['id_hotel']); + if(!$objHotelBranchInformation->active){ + $this->errors[] = $this->l('Enable the hotel first to update status.'); + } + } if (count($this->errors)) { return false; From 2c02b40ccf6646b963543d64a10a4e8ced836fe8 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Tue, 13 Jan 2026 12:50:36 +0530 Subject: [PATCH 027/176] Update the license notice in the function that creates the index file --- classes/Tools.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 47b95a4aa..2ffec4434 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -2608,29 +2608,26 @@ FileETag none public static function getDefaultIndexContent() { return ' -* @copyright 2007-'.date('Y').' PrestaShop SA -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 */ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); From e7ebcd0e735df3ba673a9d0a2b6a541d2c6623c2 Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Wed, 14 Jan 2026 13:53:55 +0530 Subject: [PATCH 028/176] Fixed: getting warnings in the aded or edit room type after enabling the cache in the BO. --- classes/cache/Cache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/cache/Cache.php b/classes/cache/Cache.php index aa91c3119..fde022518 100644 --- a/classes/cache/Cache.php +++ b/classes/cache/Cache.php @@ -231,7 +231,9 @@ abstract class CacheCore if ($ttl < 0) { $ttl = 0; } - + if(!is_array($this->keys)){ + $this->keys = []; + } $this->keys[$key] = ($ttl == 0) ? 0 : time() + $ttl; $this->_writeKeys(); return true; From a6b27ba29902bb907a44ac32b9c0381b9fb460ce Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Wed, 14 Jan 2026 19:59:44 +0530 Subject: [PATCH 029/176] Vulnerability Issue fixed --- modules/qlohotelreview/views/js/hook/review.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/qlohotelreview/views/js/hook/review.js b/modules/qlohotelreview/views/js/hook/review.js index 57227636a..2a30ce2ef 100644 --- a/modules/qlohotelreview/views/js/hook/review.js +++ b/modules/qlohotelreview/views/js/hook/review.js @@ -147,7 +147,7 @@ var QhrReviewImages = { reader.readAsDataURL(file); }, removeFile: function(iInput, iFile) { - var input = $('.images-field input.input-images').get(iInput); + var input = $('.images-field input.input-images').eq(iInput); var files = $(input).get(0).files; var dataTransfer = new DataTransfer(); $(files).each(function(iiFile, file) { @@ -155,7 +155,10 @@ var QhrReviewImages = { dataTransfer.items.add(file); } }); - input.files = dataTransfer.files; + input.get(0).files = dataTransfer.files; + if (input.get(0).files.length === 0) { + input.remove(); + } }, resetPreviews: function() { $('.previews-wrap').html(''); From b2a5b523b6580bcde96c66fee5cfc5915b87ecbe Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Wed, 14 Jan 2026 20:03:58 +0530 Subject: [PATCH 030/176] fixed Vulnerability issue while uploading images in hotel reviews --- modules/qlohotelreview/controllers/front/default.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/qlohotelreview/controllers/front/default.php b/modules/qlohotelreview/controllers/front/default.php index 0156e3112..c380cd5f7 100644 --- a/modules/qlohotelreview/controllers/front/default.php +++ b/modules/qlohotelreview/controllers/front/default.php @@ -85,6 +85,16 @@ class QloHotelReviewDefaultModuleFrontController extends ModuleFrontController } } + if (is_array($_FILES) && array_key_exists('images', $_FILES) ) { + $allowedExtensions = array('jpg', 'png'); + foreach ($_FILES['images']['name'] as $key => $imageName) { + $extension = Tools::strtolower(pathinfo($imageName, PATHINFO_EXTENSION)); + if (!in_array($extension, $allowedExtensions)) { + $errors['general'][] = $imageName . ' ' . $objModule->l('is not a supported image format.','default'); + } + } + } + if (!count($errors['by_key']) && !count($errors['general'])) { $customerReview = QhrHotelReview::getByCustomer( $objOrder->id_customer, From 909651a022a1b36b18dced094ac4b9e61f35d0a5 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Thu, 15 Jan 2026 14:49:50 +0530 Subject: [PATCH 031/176] Feature added Disable location and Hotel field for 1 property --- modules/hotelreservationsystem/classes/HotelHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index a196694f5..3ac83dea4 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1040,8 +1040,8 @@ class HotelHelper $home_banner_default_title = $homeBannerTitleLang[$objDefaultLanguage->iso_code]; } - Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 1); - Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 1); + Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 0); + Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 0); Configuration::updateValue('WK_HOTEL_NAME_SEARCH_THRESHOLD', 5); Configuration::updateValue('WK_SEARCH_AUTO_FOCUS_NEXT_FIELD', 1); Configuration::updateValue('WK_ROOM_LEFT_WARNING_NUMBER', 10); From a6b1d8a6b47d256f4b4fe9d2d27b845d7f481d52 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Thu, 15 Jan 2026 15:04:53 +0530 Subject: [PATCH 032/176] removed code related to other pr --- modules/qlohotelreview/controllers/front/default.php | 10 ---------- modules/qlohotelreview/views/js/hook/review.js | 7 ++----- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/modules/qlohotelreview/controllers/front/default.php b/modules/qlohotelreview/controllers/front/default.php index c380cd5f7..0156e3112 100644 --- a/modules/qlohotelreview/controllers/front/default.php +++ b/modules/qlohotelreview/controllers/front/default.php @@ -85,16 +85,6 @@ class QloHotelReviewDefaultModuleFrontController extends ModuleFrontController } } - if (is_array($_FILES) && array_key_exists('images', $_FILES) ) { - $allowedExtensions = array('jpg', 'png'); - foreach ($_FILES['images']['name'] as $key => $imageName) { - $extension = Tools::strtolower(pathinfo($imageName, PATHINFO_EXTENSION)); - if (!in_array($extension, $allowedExtensions)) { - $errors['general'][] = $imageName . ' ' . $objModule->l('is not a supported image format.','default'); - } - } - } - if (!count($errors['by_key']) && !count($errors['general'])) { $customerReview = QhrHotelReview::getByCustomer( $objOrder->id_customer, diff --git a/modules/qlohotelreview/views/js/hook/review.js b/modules/qlohotelreview/views/js/hook/review.js index 2a30ce2ef..57227636a 100644 --- a/modules/qlohotelreview/views/js/hook/review.js +++ b/modules/qlohotelreview/views/js/hook/review.js @@ -147,7 +147,7 @@ var QhrReviewImages = { reader.readAsDataURL(file); }, removeFile: function(iInput, iFile) { - var input = $('.images-field input.input-images').eq(iInput); + var input = $('.images-field input.input-images').get(iInput); var files = $(input).get(0).files; var dataTransfer = new DataTransfer(); $(files).each(function(iiFile, file) { @@ -155,10 +155,7 @@ var QhrReviewImages = { dataTransfer.items.add(file); } }); - input.get(0).files = dataTransfer.files; - if (input.get(0).files.length === 0) { - input.remove(); - } + input.files = dataTransfer.files; }, resetPreviews: function() { $('.previews-wrap').html(''); From 21d8abb68c5ef57f3c37877f023bbd7cbbc6d425 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Thu, 15 Jan 2026 15:11:25 +0530 Subject: [PATCH 033/176] Update Name field in Manager Room Type form --- .../default/template/controllers/products/informations.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/products/informations.tpl b/admin/themes/default/template/controllers/products/informations.tpl index fdfa02ee0..0e9c5c676 100644 --- a/admin/themes/default/template/controllers/products/informations.tpl +++ b/admin/themes/default/template/controllers/products/informations.tpl @@ -104,7 +104,7 @@
{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}
From bd80ce244937839e100a67b3cd2deeec23936cc6 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Thu, 15 Jan 2026 17:25:31 +0530 Subject: [PATCH 034/176] Option to add VAT number in invoice --- pdf/invoice.summary-tab.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdf/invoice.summary-tab.tpl b/pdf/invoice.summary-tab.tpl index 8f3fdae04..064af953a 100644 --- a/pdf/invoice.summary-tab.tpl +++ b/pdf/invoice.summary-tab.tpl @@ -28,11 +28,19 @@ {l s='Invoice Date' pdf='true'} {l s='Order Reference' pdf='true'} {l s='Order date' pdf='true'} + {if $addresses.invoice->vat_number} + {l s='VAT Number' pdf='true'} + {/if} {$title|escape:'html':'UTF-8'} {dateFormat date=$order->invoice_date full=0} {$order->getUniqReference()} {dateFormat date=$order->date_add full=0} + {if $addresses.invoice->vat_number} + + {$addresses.invoice->vat_number} + + {/if} From 970138f30584782cd7e5eca66b628c45cd327fe2 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Fri, 16 Jan 2026 11:45:24 +0530 Subject: [PATCH 035/176] Give an option at performance tab for enabling or disabling Debug mode --- .../admin/AdminPerformanceController.php | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php index 415dabab0..064693774 100644 --- a/controllers/admin/AdminPerformanceController.php +++ b/controllers/admin/AdminPerformanceController.php @@ -29,6 +29,11 @@ */ class AdminPerformanceControllerCore extends AdminController { + public const DEBUG_MODE_SUCCEEDED = 0; + public const DEBUG_MODE_ERROR_NO_READ_ACCESS = 1; + public const DEBUG_MODE_ERROR_NO_WRITE_ACCESS = 2; + public const DEBUG_MODE_ERROR_NO_DEFINITION_FOUND = 3; + public function __construct() { $this->bootstrap = true; @@ -169,6 +174,24 @@ class AdminPerformanceControllerCore extends AdminController ), 'hint' => $this->l('Enable or disable non QloApps Modules.') ), + array( + 'type' => 'switch', + 'label' => $this->l('Debug mode'), + 'name' => 'debug_mode', + 'class' => 't', + 'is_bool' => true, + 'values' => array( + array( + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + 'hint' => $this->l('Enable or disable debug mode. Debug mode will enable extended error reporting.') + ), array( 'type' => 'switch', 'label' => $this->l('Disable all overrides'), @@ -196,6 +219,7 @@ class AdminPerformanceControllerCore extends AdminController ); $this->fields_value['native_module'] = Configuration::get('PS_DISABLE_NON_NATIVE_MODULE'); + $this->fields_value['debug_mode'] = _PS_MODE_DEV_; $this->fields_value['overrides'] = Configuration::get('PS_DISABLE_OVERRIDES'); } @@ -885,6 +909,14 @@ class AdminPerformanceControllerCore extends AdminController if (Tools::isSubmit('submitAddconfiguration')) { Configuration::updateGlobalValue('PS_DISABLE_NON_NATIVE_MODULE', (int)Tools::getValue('native_module')); Configuration::updateGlobalValue('PS_DISABLE_OVERRIDES', (int)Tools::getValue('overrides')); + + $debugValue = ((int) Tools::getValue('debug_mode') === (int)1) ? 'true' : 'false'; + $result = $this->changePsModeDevValue($debugValue); + + if ($result !== self::DEBUG_MODE_SUCCEEDED) { + $this->errors[] = $this->l('Unable to update debug mode. Please check file permissions.'); + } + Tools::generateIndex(); } @@ -894,6 +926,42 @@ class AdminPerformanceControllerCore extends AdminController } } + public function changePsModeDevValue($value) + { + if ($this->isDefinesReadable()) { + return $this->updateDebugModeValueInMainFile($value); + } + + return self::DEBUG_MODE_ERROR_NO_READ_ACCESS; + } + + public function isDefinesReadable() + { + return is_readable(_PS_ROOT_DIR_ . '/config/defines.inc.php'); + } + + public function updateDebugModeValueInMainFile($value) + { + $filename = _PS_ROOT_DIR_ . '/config/defines.inc.php'; + $cleanedFileContent = php_strip_whitespace($filename); + $fileContent = Tools::file_get_contents($filename); + + if (!preg_match('/define\(\'_PS_MODE_DEV_\', ([a-zA-Z]+)\);/Ui', $cleanedFileContent)) { + return self::DEBUG_MODE_ERROR_NO_DEFINITION_FOUND; + } + + $fileContent = preg_replace('/define\(\'_PS_MODE_DEV_\', ([a-zA-Z]+)\);/Ui', 'define(\'_PS_MODE_DEV_\', ' . $value . ');', $fileContent); + if (!@file_put_contents($filename, $fileContent)) { + return self::DEBUG_MODE_ERROR_NO_WRITE_ACCESS; + } + + if (function_exists('opcache_invalidate')) { + @opcache_invalidate($filename); + } + + return self::DEBUG_MODE_SUCCEEDED; + } + public function displayAjaxTestServer() { /* PrestaShop demo mode */ From 7739d9b117290106872cca733b0ee83397338b2f Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Mon, 19 Jan 2026 11:53:08 +0530 Subject: [PATCH 036/176] seo-preview feature added --- .../normal_products/input_text_lang.tpl | 1 - .../controllers/normal_products/seo.tpl | 15 +- .../controllers/products/input_text_lang.tpl | 1 - .../template/controllers/products/seo.tpl | 15 +- .../controllers/products/seo_preview.tpl | 141 ++++++++++++++++++ js/admin.js | 9 -- .../admin/AdminAddHotelController.php | 16 +- .../admin/add_hotel/helpers/form/form.tpl | 10 ++ 8 files changed, 176 insertions(+), 32 deletions(-) create mode 100644 admin/themes/default/template/controllers/products/seo_preview.tpl diff --git a/admin/themes/default/template/controllers/normal_products/input_text_lang.tpl b/admin/themes/default/template/controllers/normal_products/input_text_lang.tpl index 88df423a8..2ba53ad1a 100644 --- a/admin/themes/default/template/controllers/normal_products/input_text_lang.tpl +++ b/admin/themes/default/template/controllers/normal_products/input_text_lang.tpl @@ -36,7 +36,6 @@ class="form-control {if isset($input_class)}{$input_class} {/if}" name="{$input_name}_{$language.id_lang}" value="{$input_value[$language.id_lang]|default:''|escape:'html'}" - onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();" onblur="updateLinkRewrite();" {if isset($required)} required="required"{/if} {if isset($maxchar)} data-maxchar="{$maxchar}"{/if} diff --git a/admin/themes/default/template/controllers/normal_products/seo.tpl b/admin/themes/default/template/controllers/normal_products/seo.tpl index 3fa31fe6a..55e0c0e4a 100644 --- a/admin/themes/default/template/controllers/normal_products/seo.tpl +++ b/admin/themes/default/template/controllers/normal_products/seo.tpl @@ -91,16 +91,11 @@
-
-
- {foreach from=$languages item=language} -
- {l s='The product link will look like this:'}
- {if isset($rewritten_links[$language.id_lang][0])}{$rewritten_links[$language.id_lang][0]|escape:'html':'UTF-8'}{/if}{if isset($product->id)}{$product->link_rewrite[$language.id_lang]|escape:'html':'UTF-8'}{/if}{if isset($rewritten_links[$language.id_lang][1])}{$rewritten_links[$language.id_lang][1]|escape:'html':'UTF-8'}{/if} -
- {/foreach} -
-
+ {include file="controllers/products/seo_preview.tpl" + languages = $languages + preview_link = $rewritten_links|default:'' + inputs = ['meta_title'=>$product->meta_title ,'meta_description' => $product->meta_description,'link_rewrite' => $product->link_rewrite] + }
-
-
- {foreach from=$languages item=language} -
- {l s='The product link will look like this:'}
- {if isset($rewritten_links[$language.id_lang][0])}{$rewritten_links[$language.id_lang][0]|escape:'html':'UTF-8'}{/if}{if isset($product->id)}{$product->link_rewrite[$language.id_lang]|escape:'html':'UTF-8'}{/if}{if isset($rewritten_links[$language.id_lang][1])}{$rewritten_links[$language.id_lang][1]|escape:'html':'UTF-8'}{/if} -
- {/foreach} -
-
+ {include file="controllers/products/seo_preview.tpl" + languages = $languages + preview_link = $rewritten_links|default:'' + inputs = ['meta_title'=>$product->meta_title ,'meta_description' => $product->meta_description,'link_rewrite' => $product->link_rewrite] + } + {include file="controllers/products/seo_preview.tpl" + languages = $languages + preview_link = $rewrite_url|default:'' + inputs = [ + 'meta_title' => $meta_title_info, + 'meta_description' => $meta_description_info, + 'link_rewrite' => $link_rewrite_info, + 'meta_keywords' => $meta_keywords_info + ] + } {hook h='displayAdminAddHotelFormSeoTabAfter' id_hotel=$hook_arg_id_hotel}
From fe2147a547532ec7bd3e6584861998e69e37f909 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Mon, 19 Jan 2026 12:32:13 +0530 Subject: [PATCH 037/176] fixed Dashboard Occupancy panel issue --- controllers/admin/AdminStatsController.php | 91 ++++--------- .../classes/HotelBookingDetail.php | 124 ++++++++++++++++++ 2 files changed, 153 insertions(+), 62 deletions(-) diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index ba6b3b371..bdfa27c73 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -1385,70 +1385,37 @@ class AdminStatsControllerCore extends AdminStatsTabController public static function getOccupancyData($dateFrom, $dateTo, $idsHotel = false) { - if ($dateFrom == $dateTo) { - $dateTo = date('Y-m-d', strtotime('+1 day', strtotime($dateTo))); - } - + $objHotelBookingDetail = new HotelBookingDetail(); + $objHotelBranchInformation = new HotelBranchInformation(); + $allHotels = $objHotelBranchInformation->getAllHotels(); $occupancyData = array('count_total' => 0, 'count_occupied' => 0, 'count_available' => 0, 'count_unavailable' => 0); - - $countTotal = self::getTotalRooms($idsHotel, true); - $occupancyData['count_total'] = $countTotal; - - // Occupied rooms are booked rooms that are not refunded in the date range - $countOccupied = 0; - $occupiedRooms = Db::getInstance()->executeS( - 'SELECT DISTINCT hbd.`id_room` - FROM `'._DB_PREFIX_.'htl_booking_detail` hbd - LEFT JOIN `'._DB_PREFIX_.'htl_room_information` hri - ON (hri.`id` = hbd.`id_room`) - LEFT JOIN `'._DB_PREFIX_.'product` p - ON (p.`id_product` = hri.`id_product`) - WHERE p.`active` = 1 - AND hbd.`is_refunded` = 0 - AND IF(hbd.`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT .', hbd.`date_from` < DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") AND hbd.`date_from` < \''.pSQL($dateTo).'\' AND DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\', hbd.`date_from` < \''.pSQL($dateTo).'\' AND hbd.`date_to` > \''.pSQL($dateFrom).'\')'. - HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd') - ); - - if ($occupiedRooms) { - $occupiedRooms = array_column($occupiedRooms, 'id_room'); - $occupancyData['count_occupied'] = count($occupiedRooms); - } else { - $occupancyData['count_occupied'] = 0; + if($idsHotel == 0){ + $dataStats = [ + 'num_unavail'=> 0, + 'num_booked'=> 0, + 'num_avail'=> 0, + 'total_rooms'=> 0, + ]; + foreach ($allHotels as $hotel) { + $idhotel = (int) $hotel['id']; + $bookingData = $objHotelBookingDetail->getDateWiseBooking($dateFrom , $dateTo , $idhotel); + $dataStats['num_avail'] += $bookingData['stats']['available']; + $dataStats['num_unavail'] += $bookingData['stats']['unavailable']; + $dataStats['num_booked'] += $bookingData['stats']['booked']; + $dataStats['total_rooms'] += $bookingData['stats']['total_rooms']; + } + $occupancyData['count_available'] = $dataStats['num_avail']; + $occupancyData['count_occupied'] = $dataStats['num_booked']; + $occupancyData['count_unavailable'] = $dataStats['num_unavail']; + $occupancyData['count_total'] = $dataStats['total_rooms']; } - - // Unavailable rooms are rooms that are not booked for the date range and in the inactive status - $countUnavailable = Db::getInstance()->getValue( - 'SELECT COUNT(hri.`id`) - FROM `'._DB_PREFIX_.'htl_room_information` hri - LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hbi - ON (hbi.`id` = hri.`id_hotel`) - LEFT JOIN `'._DB_PREFIX_.'product` p - ON (p.`id_product` = hri.`id_product`) - WHERE p.`active` = 1 '. - ($occupiedRooms ? ' AND hri.`id` NOT IN ('.implode(',', $occupiedRooms).')' : ''). - ' AND hri.`id_status` = '.(int) HotelRoomInformation::STATUS_INACTIVE. - HotelBranchInformation::addHotelRestriction($idsHotel, 'hbi', 'id') - ); - $occupancyData['count_unavailable'] = $countUnavailable; - - // Available rooms are rooms that are not booked for the date range and in the temporary inactive for the date range - $countDisabled = Db::getInstance()->getValue( - 'SELECT IFNULL(COUNT(hri.`id`), 0) - FROM `'._DB_PREFIX_.'htl_room_information` hri - LEFT JOIN `'._DB_PREFIX_.'htl_room_disable_dates` hrdd - ON (hrdd.`id_room` = hri.`id`) - LEFT JOIN `'._DB_PREFIX_.'product` p - ON (p.`id_product` = hri.`id_product`) - WHERE hri.`id_status` = '.(int) HotelRoomInformation::STATUS_TEMPORARY_INACTIVE. - ($occupiedRooms ? ' AND hri.`id` NOT IN ('.implode(',', $occupiedRooms).')' : ''). - ' AND ("'.pSQL($dateTo).'" > hrdd.`date_from` AND "'.pSQL($dateFrom).'" < hrdd.`date_to`) - AND p.`active` = 1'. - (!is_null($idsHotel) ? HotelBranchInformation::addHotelRestriction($idsHotel, 'hri') : '') - ); - $occupancyData['count_unavailable'] += $countDisabled; - - $occupancyData['count_available'] = $occupancyData['count_total'] - $occupancyData['count_occupied'] - $occupancyData['count_unavailable']; - + else{ + $bookingData = $objHotelBookingDetail->getDateWiseBooking($dateFrom , $dateTo , $idsHotel); + $occupancyData['count_available'] = $bookingData['stats']['available']; + $occupancyData['count_occupied'] = $bookingData['stats']['booked']; + $occupancyData['count_unavailable'] = $bookingData['stats']['unavailable']; + $occupancyData['count_total'] = $bookingData['stats']['total_rooms']; + } return $occupancyData; } diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index fbf4ba1c6..dc475e073 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -3781,4 +3781,128 @@ class HotelBookingDetail extends ObjectModel return parent::add($auto_date, $null_values); } + //Datewise Booking Data + public function getDateWiseBooking($dateFrom, $dateTo, $idHotel) + { + $objBookingDetail = new HotelBookingDetail(); + if ($dateFrom == $dateTo) { + $dateTo = date('Y-m-d', strtotime($dateTo . ' +1 day')); + } + $bookingParams = [ + 'date_from' => $dateFrom, + 'date_to' => $dateTo, + 'search_available'=> 1, + 'search_partial' => 1, + 'search_booked' => 1, + 'search_unavai' => 1, + 'hotel_id' => $idHotel, + ]; + $bookingData = $objBookingDetail->getBookingData($bookingParams); + $bookedDates = []; + $unavailableDates = []; + if (!empty($bookingData['rm_data'])) { + foreach ($bookingData['rm_data'] as $key => $roomType) { + // get all rooms of room type + $rooms = HotelRoomInformation::getHotelRoomsInfo( + $bookingParams['hotel_id'], + $roomType['id_product'] + ); + foreach ($rooms ?: [] as $room) { + $bookingData['rm_data'][$key]['all_rooms'][$room['id']] = [ + 'id_room' => $room['id'], + 'room_num' => $room['room_num'], + ]; + } + // booked rooms date mapping + foreach ($roomType['data']['booked'] ?: [] as $bookedRoom) { + foreach ($bookedRoom['detail'] as $detail) { + for ( + $d = date('Y-m-d', strtotime($detail['date_from'])); + $d < date('Y-m-d', strtotime($detail['date_to'])); + $d = date('Y-m-d', strtotime('+1 day', strtotime($d))) + ) { + $bookedDates[$d][$roomType['id_product']][$bookedRoom['id_room']] = + $bookedRoom['id_room']; + } + } + } + // unavailable rooms date mapping + foreach ($roomType['data']['unavailable'] ?: [] as $unavailableRoom) { + foreach ($unavailableRoom['detail'] as $detail) { + for ( + $d = date('Y-m-d', strtotime($detail['date_from'])); + $d < date('Y-m-d', strtotime($detail['date_to'])); + $d = date('Y-m-d', strtotime('+1 day', strtotime($d))) + ) { + $unavailableDates[$d][$roomType['id_product']][$unavailableRoom['id_room']] = + $unavailableRoom['id_room']; + } + } + } + } + } + $response = [ + 'data' => [], + 'stats' => [ + 'total_rooms' => 0, + 'available' => 0, + 'booked' => 0, + 'unavailable' => 0, + ], + ]; + for ( + $currentDate = date('Y-m-d', strtotime($dateFrom)); + $currentDate < date('Y-m-d', strtotime($dateTo)); + $currentDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate))) + ) { + $nextDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate))); + + $dateWiseInfo = [ + 'id_hotel' => $idHotel, + 'date_from' => $currentDate, + 'date_to' => $nextDate, + 'room_types'=> [], + ]; + foreach ($bookingData['rm_data'] ?: [] as $roomType) { + $allRooms = $roomType['all_rooms'] ?: []; + // available initially all rooms + $available = $allRooms; + $booked = []; + $unavai = []; + // remove booked + if (!empty($bookedDates[$currentDate][$roomType['id_product']])) { + $booked = array_intersect_key( + $allRooms, + $bookedDates[$currentDate][$roomType['id_product']] + ); + $available = array_diff_key($available, $booked); + } + // remov unavailable + if (!empty($unavailableDates[$currentDate][$roomType['id_product']])) { + $unavai = array_intersect_key( + $allRooms, + $unavailableDates[$currentDate][$roomType['id_product']] + ); + $available = array_diff_key($available, $unavai); + } + $response['stats']['available'] += count($available); + $response['stats']['booked'] += count($booked); + $response['stats']['unavailable'] += count($unavai); + $response['stats']['total_rooms'] += count($allRooms); + + $dateWiseInfo['room_types'][] = [ + 'id_room_type' => $roomType['id_product'], + 'name' => $roomType['name'], + 'rooms' => [ + 'available' => $available, + 'booked' => $booked, + 'unavailable' => $unavai, + ], + ]; + } + $response['data'][] = $dateWiseInfo; + } + + return$response; + } } From b8f0a27e66c3b508f98ba7244e2d0122afba885d Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Tue, 20 Jan 2026 12:40:02 +0530 Subject: [PATCH 038/176] Fixed: disable room types should not be visible in the suggestion during room reallocation. --- .../hotelreservationsystem/classes/HotelBookingDetail.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index fbf4ba1c6..8b383bd04 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -1814,10 +1814,12 @@ class HotelBookingDetail extends ObjectModel $availableRoomTypes = array(); $context = Context::getContext(); foreach ($avail_rooms as $roomInfo) { - $availableRoomTypes[$roomInfo['id_product']]['id_product'] = $roomInfo['id_product']; $objProduct = new Product($roomInfo['id_product'], false, $context->language->id); - $availableRoomTypes[$roomInfo['id_product']]['room_type_name'] = $objProduct->name; - $availableRoomTypes[$roomInfo['id_product']]['rooms'][] = $roomInfo; + if($objProduct->active){ + $availableRoomTypes[$roomInfo['id_product']]['id_product'] = $roomInfo['id_product']; + $availableRoomTypes[$roomInfo['id_product']]['room_type_name'] = $objProduct->name; + $availableRoomTypes[$roomInfo['id_product']]['rooms'][] = $roomInfo; + } } return $availableRoomTypes; From 1959df04dcc552fd535bccc9ed3547650100b8bf Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Tue, 20 Jan 2026 12:42:31 +0530 Subject: [PATCH 039/176] Fixed: disable room types should not be visible in the suggestion during room reallocation. --- modules/hotelreservationsystem/classes/HotelBookingDetail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 8b383bd04..680e7bf79 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -1815,7 +1815,7 @@ class HotelBookingDetail extends ObjectModel $context = Context::getContext(); foreach ($avail_rooms as $roomInfo) { $objProduct = new Product($roomInfo['id_product'], false, $context->language->id); - if($objProduct->active){ + if(Validate::isLoadedObject($objProduct) && $objProduct->active){ $availableRoomTypes[$roomInfo['id_product']]['id_product'] = $roomInfo['id_product']; $availableRoomTypes[$roomInfo['id_product']]['room_type_name'] = $objProduct->name; $availableRoomTypes[$roomInfo['id_product']]['rooms'][] = $roomInfo; From 1a517d8601cc8cb0f69d5019760383e4efde19c4 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Tue, 20 Jan 2026 15:07:43 +0530 Subject: [PATCH 040/176] Prevent enabling duplicate advanced price rules with the same restrictions --- .../admin/AdminHotelFeaturePricesSettings.php | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php index d5731d87f..4fe79e3d0 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelFeaturePricesSettings.php @@ -219,6 +219,56 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController } + public function processBulkEnableSelection() + { + if (!is_array($this->boxes) || empty($this->boxes)) { + return parent::processBulkEnableSelection(); + } + + $objFeaturePriceRule = new HotelRoomTypeFeaturePricingRestriction(); + $result = true; + + foreach ($this->boxes as $id) { + $objFeaturePricing = new $this->className((int)$id); + + if ($objFeaturePricing->active) { + continue; + } + + if ( + $objFeaturePricing->getDuplicateRestrictions( + $objFeaturePricing->id_product, + $objFeaturePricing->getGroups($objFeaturePricing->id), + $objFeaturePricing->id, + $objFeaturePriceRule->getRestrictionsByIdFeaturePrice($objFeaturePricing->id), + ) + ) { + $this->errors[] = sprintf( + $this->l('Advanced price rule ID %d: Another advanced price rule with similar conditions already exists. Please update the existing rule before enabling this one.'), + (int) $id + ); + return; + } + + $objFeaturePricing->setFieldsToUpdate(array('active' => true)); + $objFeaturePricing->active = 1; + $isUpdated = (bool) $objFeaturePricing->update(); + $result &= $isUpdated; + + if (!$isUpdated) { + $this->errors[] = sprintf($this->l('Can\'t update #%d status.'), (int) $id); + } + } + + if ($result) { + $this->redirect_after = self::$currentIndex.'&conf=5&token='.$this->token; + } else { + $this->errors[] = $this->l('An error occurred while updating the status.'); + } + + return $result; + } + public function initToolbar() { parent::initToolbar(); From fae6dff86f896e570a9bc90477dc327df83f2a0d Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Wed, 21 Jan 2026 17:17:38 +0530 Subject: [PATCH 041/176] customer service improvement --- .../controllers/orders/helpers/view/view.tpl | 6 +- .../orders/modals/_add_room_booking.tpl | 6 + .../orders/modals/_delete_room_booking.tpl | 54 ++++++++ .../orders/modals/_edit_room_tab_content.tpl | 6 + .../orders/modals/_room_reallocation.tpl | 12 ++ classes/PaymentModule.php | 6 +- controllers/admin/AdminCartsController.php | 1 + .../admin/AdminCustomerThreadsController.php | 23 +++- controllers/admin/AdminOrdersController.php | 99 ++++++++++++++- controllers/front/OrderDetailController.php | 2 +- install/data/xml/configuration.xml | 4 +- js/admin/orders.js | 120 ++++++++++++------ js/admin/reallocation.js | 1 + 13 files changed, 284 insertions(+), 56 deletions(-) create mode 100644 admin/themes/default/template/controllers/orders/modals/_delete_room_booking.tpl diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index c0c841758..32887116b 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -720,11 +720,11 @@ {$message['elastname']|escape:'html':'UTF-8'}{else}{$message['cfirstname']|escape:'html':'UTF-8'} {$message['clastname']|escape:'html':'UTF-8'} {/if},   - {dateFormat date=$message['date_add']} + {dateFormat date=$message.date_add full=1} - {if ($message['private'] == 1)} + {* {if ($message['private'] == 1)} {l s='Private'} - {/if} + {/if} *}

{if !$smarty.foreach.customerMessage.last}
{/if} diff --git a/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl b/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl index b9e6524cf..d63ce2421 100644 --- a/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl +++ b/admin/themes/default/template/controllers/orders/modals/_add_room_booking.tpl @@ -128,6 +128,12 @@ {/if} +
+
+ + +
+
{if isset($invoices_collection) && sizeof($invoices_collection)} +
+
+ + +
+
+ +
+
+ + +
+
-
+
id_customer) && $cart->id_customer && isset($customer) && $customer }style="display:none;"{/if} class="form-group">
-
+
+ {if isset($cart->id_customer) && $cart->id_customer && isset($customer) && $customer } +
+
+
+ {$customer->firstname} {$customer->lastname} #{$customer->id} +
+ {$customer->email}
+
+ +
+
+ {/if} +
{*
{include file='controllers/orders/_current_cart_details_data.tpl'} - @@ -163,7 +163,7 @@
- + ({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='hotelreservationsystem'})
diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl index 6dfd81da5..2557827b9 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl @@ -84,7 +84,7 @@
- + ({l s='Below' mod='hotelreservationsystem'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='hotelreservationsystem'})
@@ -126,7 +126,7 @@
- + ({l s='Below' mod='hotelreservationsystem'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='hotelreservationsystem'})
diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index aacaa38b0..3066b6250 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -696,37 +696,26 @@ $(document).ready(function() { if (childElement) { var totalChilds = $(this).closest('.occupancy_info_block').find('.guest_child_age').length; - if (max_child_in_room == 0 || totalChilds < max_child_in_room) { - element.val(elementVal); - $(this).closest('.occupancy_info_block').find('.children_age_info_block').show(); + element.val(elementVal); + $(this).closest('.occupancy_info_block').find('.children_age_info_block').show(); - var roomBlockIndex = parseInt($(this).closest('.occupancy_info_block').attr('occ_block_index')); + var roomBlockIndex = parseInt($(this).closest('.occupancy_info_block').attr('occ_block_index')); - var childAgeSelect = '
'; - childAgeSelect += ''; - childAgeSelect += '
'; - - $(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect); - - // set input field value - $(this).closest('.occupancy_count_block').find('.occupancy_count > span').text(elementVal); - } else { - if (elementVal >= max_child_in_room) { - if (elementVal == 0) { - showOccupancyError(no_children_allowed_txt, $(this).closest(".occupancy_info_block")); - } else { - showOccupancyError(max_children_txt, $(this).closest(".occupancy_info_block")); + var childAgeSelect = '
'; + childAgeSelect += ''; + childAgeSelect += '
'; + + $(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect); + + // set input field value + $(this).closest('.occupancy_count_block').find('.occupancy_count > span').text(elementVal); + } else { element.val(elementVal); @@ -934,19 +923,21 @@ $(document).ready(function() { // set positions of popups when required if (page_name == 'index') { - $('#hotel_location, #id_hotel_button, #guest_occupancy').focus(function () { + $('#hotel_location, #id_hotel_button_chosen, #guest_occupancy').focus(function () { setBookingSearchPositions(); + console.log('11111'); }); - // after chosen has been initialized $('select#id_hotel_button').on('chosen:ready', function() { $('#id_hotel_button_chosen .chosen-search input').focus(function () { setBookingSearchPositions(); + console.log('2222'); }); }); $('#daterange_value').click(function () { setBookingSearchPositions(); + console.log('3333'); }); } }); @@ -987,8 +978,8 @@ function setGuestOccupancy() // position dropdowns function setBookingSearchPositions() { // calculate available spaces + console.log("Aradhana"); let searchForm = $('#search_hotel_block_form'); - let inputFieldsAndDropdowns = [ { input: $('#hotel_location'), dropdown: $('.location_search_results_ul')}, { input: $('.hotel-selector-wrap'), dropdown: $('#id_hotel_button_chosen .chosen-drop')}, @@ -1018,7 +1009,8 @@ function setBookingSearchPositions() { positionClass = 'top'; } } - + console.log(positionClass); + console.log(inputFieldsAndDropdowns); // position dropdowns $(inputFieldsAndDropdowns).each(function (i, inputFieldAndDropdown) { inputFieldAndDropdown.dropdown.removeClass('top bottom').addClass(positionClass); diff --git a/themes/hotel-reservation-theme/global.tpl b/themes/hotel-reservation-theme/global.tpl index 55a1cdd44..eaa7cd71a 100644 --- a/themes/hotel-reservation-theme/global.tpl +++ b/themes/hotel-reservation-theme/global.tpl @@ -62,7 +62,6 @@ {addJsDef is_occupancy_wise_search=$is_occupancy_wise_search|boolval} {addJsDef occupancy_required_for_booking=$occupancy_required_for_booking|boolval} {addJsDef max_child_age=$max_child_age} -{addJsDef max_child_in_room=$max_child_in_room} {addJsDefL name='max_occupancy_reached_txt'}{l s='Maximum room occupancy reached' js=1}{/addJsDefL} {addJsDefL name='max_adults_txt'}{l s='Maximum adult occupancy reached' js=1}{/addJsDefL} diff --git a/themes/hotel-reservation-theme/js/occupancy.js b/themes/hotel-reservation-theme/js/occupancy.js index fddb7006f..56b59edea 100644 --- a/themes/hotel-reservation-theme/js/occupancy.js +++ b/themes/hotel-reservation-theme/js/occupancy.js @@ -58,8 +58,6 @@ $(document).ready(function(){ let max_child_in_room; if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) { max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val(); - } else { - max_child_in_room = window.max_child_in_room; } if (elementVal < max_child_in_room && elementVal < max_allowed_for_current) { element.val(elementVal + 1); From 8d1280df8156b8c404f96e9f6114d27e8f10e801 Mon Sep 17 00:00:00 2001 From: aradhana kumari Date: Thu, 12 Feb 2026 15:31:06 +0530 Subject: [PATCH 058/176] Remove other branch changes --- cache/smarty/cache/index.php | 2 +- cache/smarty/compile/index.php | 2 +- classes/order/OrderSlip.php | 25 ++- classes/pdf/HTMLTemplateOrderSlip.php | 15 +- config/defines.inc.php | 2 +- controllers/admin/AdminSlipController.php | 187 +++--------------- js/admin/slips.js | 45 ----- .../views/js/wk-room-search-block.js | 7 +- 8 files changed, 56 insertions(+), 229 deletions(-) diff --git a/cache/smarty/cache/index.php b/cache/smarty/cache/index.php index ffdebb428..91e3c84b0 100644 --- a/cache/smarty/cache/index.php +++ b/cache/smarty/cache/index.php @@ -1,6 +1,6 @@ id_currency); $order_slip = new OrderSlip(); @@ -368,6 +365,17 @@ class OrderSlipCore extends ObjectModel } $price = (float)$product_row['unit_price']; + + $order_slip_resume = OrderSlip::getProductSlipResume((int)$order_detail->id); + + if ($quantity + $order_slip_resume['product_quantity'] > $order_detail->product_quantity) { + $quantity = $order_detail->product_quantity - $order_slip_resume['product_quantity']; + } + + if ($quantity == 0) { + continue; + } + if (!Tools::isSubmit('cancelProduct') && $order->hasBeenPaid()) { $order_detail->product_quantity_refunded += $quantity; } @@ -434,8 +442,11 @@ class OrderSlipCore extends ObjectModel $order_slip->{'total_products_tax_'.$inc_or_ex_2} -= (float)$amount && !$amount_choosen ? (float)$amount : 0; $order_slip->amount = $amount_choosen ? (float)$amount : $order_slip->{'total_products_tax_'.$inc_or_ex_1}; - if (isset($orderSlipType) && $orderSlipType) { - $order_slip->order_slip_type = $orderSlipType; + if ((float)$amount && !$amount_choosen) { + $order_slip->order_slip_type = 1; + } + if (((float)$amount && $amount_choosen)) { + $order_slip->order_slip_type = 2; } if (!$order_slip->add()) { @@ -675,4 +686,4 @@ class OrderSlipCore extends ObjectModel } return true; } -} +} \ No newline at end of file diff --git a/classes/pdf/HTMLTemplateOrderSlip.php b/classes/pdf/HTMLTemplateOrderSlip.php index 01e3f555c..5f07573ca 100644 --- a/classes/pdf/HTMLTemplateOrderSlip.php +++ b/classes/pdf/HTMLTemplateOrderSlip.php @@ -143,6 +143,15 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice $this->order->total_paid_tax_excl += $this->order->total_shipping_tax_excl; $total_cart_rule = 0; + if ($this->order_slip->order_slip_type == 1 && is_array($cart_rules = $this->order->getCartRules($this->order_invoice->id))) { + foreach ($cart_rules as $cart_rule) { + if ($tax_excluded_display) { + $total_cart_rule += $cart_rule['value_tax_excl']; + } else { + $total_cart_rule += $cart_rule['value']; + } + } + } $this->smarty->assign(array( 'order' => $this->order, @@ -150,8 +159,8 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice 'order_details' => $this->order->products, 'roomsDetails' => $roomsDetails, 'productsDetails' => $productsDetails, - 'cart_rules' => false, - 'amount_choosen' => false, + 'cart_rules' => $this->order_slip->order_slip_type == 1 ? $this->order->getCartRules($this->order_invoice->id) : false, + 'amount_choosen' => $this->order_slip->order_slip_type == 2 ? true : false, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), @@ -423,4 +432,4 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice return $taxes_breakdown; } -} +} \ No newline at end of file diff --git a/config/defines.inc.php b/config/defines.inc.php index d78f92763..f16e93903 100644 --- a/config/defines.inc.php +++ b/config/defines.inc.php @@ -26,7 +26,7 @@ /* Debug only */ if (!defined('_PS_MODE_DEV_')) { - define('_PS_MODE_DEV_', true); + define('_PS_MODE_DEV_', false); } /* Compatibility warning */ define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false); diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index 1b767a2f5..426146c23 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -115,96 +115,33 @@ class AdminSlipControllerCore extends AdminController public function initPageHeaderToolbar() { - if (empty($this->display)) { - $this->page_header_toolbar_btn['new_credit_slip'] = array( - 'href' => self::$currentIndex . '&add' . $this->table . '&token=' . $this->token, - 'desc' => $this->l('Add new credit slip', null, null, false), - 'icon' => 'process-icon-new' - ); - } - parent::initPageHeaderToolbar(); } public function renderForm() { - if ($this->display == 'add') { - $order = new Order(); - $orderList = $order->getOrdersWithInformations(); - foreach ($orderList as &$order) { - $order['order_label'] = $order['reference'] . ' #' . (int) $order['id_order']; - } - unset($order); - - $this->fields_form = array( - 'legend' => array( - 'title' => $this->l('Credit slip'), - 'icon' => 'icon-print' + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Print a PDF'), + 'icon' => 'icon-print' + ), + 'input' => array( + array( + 'type' => 'date', + 'label' => $this->l('From'), + 'name' => 'date_from', + 'maxlength' => 10, + 'required' => true, + 'hint' => $this->l('Format: 2011-12-31 (inclusive).') ), - 'description' => $this->l('Kindly check the credit slip again before saving it, as it cannot be changed once created.'), - 'input' => array( - array( - 'type' => 'select', - 'label' => $this->l('Order id'), - 'name' => 'id_order', - 'required' => true, - 'hint' => $this->l('Select id order'), - 'class' => 'chosen', - 'options' => array( - 'query' => $orderList, - 'id' => 'id_order', - 'name' => 'order_label' - ) - ), - array( - 'type' => 'select', - 'label' => $this->l('Booking Detail'), - 'name' => 'id_booking_detail', - 'required' => true, - 'options' => array( - 'query' => array(), - 'id' => 'id', - 'name' => 'booking_label' - ) - ), - array( - 'type' => 'text', - 'label' => $this->l('Amount of credit slip'), - 'hint' => $this->l('Enter the amount of the credit slip for the customer'), - 'name' => 'credit_slip_amount', - 'required' => true, - 'col' => 2, - 'suffix' => $this->context->currency->sign, - ), - ), - 'submit' => array( - 'title' => $this->l('Save'), - 'name' => 'submitCreditSlip', + array( + 'type' => 'date', + 'label' => $this->l('To'), + 'name' => 'date_to', + 'maxlength' => 10, + 'required' => true, + 'hint' => $this->l('Format: 2012-12-31 (inclusive).') ) - ); - } else { - $this->fields_form = array( - 'legend' => array( - 'title' => $this->l('Print a PDF'), - 'icon' => 'icon-print' - ), - 'input' => array( - array( - 'type' => 'date', - 'label' => $this->l('From'), - 'name' => 'date_from', - 'maxlength' => 10, - 'required' => true, - 'hint' => $this->l('Format: 2011-12-31 (inclusive).') - ), - array( - 'type' => 'date', - 'label' => $this->l('To'), - 'name' => 'date_to', - 'maxlength' => 10, - 'required' => true, - 'hint' => $this->l('Format: 2012-12-31 (inclusive).') - ) ), 'submit' => array( 'title' => $this->l('Generate PDF file'), @@ -212,7 +149,6 @@ class AdminSlipControllerCore extends AdminController 'icon' => 'process-icon-download-alt' ) ); - } $this->fields_value = array( 'date_from' => date('Y-m-d'), @@ -225,67 +161,7 @@ class AdminSlipControllerCore extends AdminController public function postProcess() { - if (Tools::getValue('submitCreditSlip')) { - if (empty(trim(Tools::getValue('credit_slip_amount')))) { - $this->errors[] = $this->l('Amount is required for the generate credit slip'); - } - if (!count($this->errors)) { - $objOrder = new Order(Tools::getValue('id_order')); - $creditAmount = Tools::getValue('credit_slip_amount'); - $idBookingDetail = Tools::getValue('id_booking_detail'); - $customer = new Customer($objOrder->id_customer); - $bookingList = array(); - $objHotelBookingDetail = new HotelBookingDetail($idBookingDetail); - - if ($idHtlBooking = $objHotelBookingDetail->id) { - $numDays = HotelHelper::getNumberOfDays( - $objHotelBookingDetail->date_from, - $objHotelBookingDetail->date_to - ); - - $idOrderDetail = $objHotelBookingDetail->id_order_detail; - - $bookingList = array( - array( - 'id_htl_booking' => $idHtlBooking, - 'id_order_detail' => $idOrderDetail, - 'quantity' => $numDays, - 'num_days' => $numDays, - 'unit_price' => (float) $creditAmount / $numDays, - 'amount' => (float) $creditAmount, - ) - ); - } - - if (!$idCreditSlip = OrderSlip::create($objOrder, $bookingList, 0, $creditAmount, $creditAmount, 0 , OrderSlip::MANUAL_CREDIT_SLIP_TYPE)) { - $this->errors[] = $this->l('A credit slip cannot be generated. '); - } else { - - Hook::exec('actionOrderSlipAdd', array('order' => $objOrder, 'bookingList' => $bookingList)); - - $params['{credit_slip_url}'] = $this->context->link->getPageLink('order-slip', true); - - @Mail::Send( - (int)$objOrder->id_lang, - 'credit_slip', - Mail::l('New credit slip generated for you', (int)$objOrder->id_lang), - $params, - $customer->email, - $customer->firstname.' '.$customer->lastname, - null, - null, - null, - null, - _PS_MAIL_DIR_, - true, - (int)$objOrder->id_shop - ); - } - Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token . '&conf=3'); - } else { - return parent::postProcess(); - } - } else if (Tools::getValue('submitAddorder_slip')) { + if (Tools::getValue('submitAddorder_slip')) { if (!Validate::isDate(Tools::getValue('date_from'))) { $this->errors[] = $this->l('Invalid "From" date'); } @@ -360,13 +236,9 @@ class AdminSlipControllerCore extends AdminController $this->initTabModuleList(); $this->initToolbar(); $this->initPageHeaderToolbar(); - if ($this->display != "add") { $this->content .= $this->renderList(); - } $this->content .= $this->renderForm(); - if ($this->display != "add") { $this->content .= $this->renderOptions(); - } $this->context->smarty->assign(array( 'content' => $this->content, @@ -470,30 +342,15 @@ class AdminSlipControllerCore extends AdminController $this->ajaxDie(json_encode($response)); } - public function ajaxProcessGetBookingDetails() - { - $idOrder = (int) Tools::getValue('id_order'); - $objOrder = new Order($idOrder); - $currency = Currency::getCurrency((int)$objOrder->id_currency); - $objHotelBookingDetail = new HotelBookingDetail(); - $bookingDetails = $objHotelBookingDetail->getBookingDataByOrderId($idOrder); - - die(Tools::jsonEncode(array( - 'bookings' => $bookingDetails, - 'currency' => $currency - ))); - } - public function setMedia() { parent::setMedia(); Media::addJsDef( array( 'admin_order_slip_tab_link' => $this->context->link->getAdminLink('AdminSlip'), - 'ajax_booking_url' => $this->context->link->getAdminLink('AdminSlip', true), ) ); $this->addJS(_PS_JS_DIR_.'admin/slips.js'); } -} +} \ No newline at end of file diff --git a/js/admin/slips.js b/js/admin/slips.js index 7d5c10e79..c133888e7 100644 --- a/js/admin/slips.js +++ b/js/admin/slips.js @@ -103,49 +103,4 @@ $(document).ready(function() { }); }); } - - $('select[name="id_order"]').on('change', function () { - - var idOrder = $(this).val(); - - if (!idOrder) return; - - $.ajax({ - url: ajax_booking_url, - type: 'POST', - dataType: 'json', - data: { - ajax: 1, - action: 'GetBookingDetails', - id_order: idOrder - }, - success: function (response) { - - var $bookingSelect = $('select[name="id_booking_detail"]'); - $bookingSelect.empty(); - - if (response.bookings.length > 0) { - $.each(response.bookings, function (index, booking) { - $bookingSelect.append( - $('