diff --git a/admin/themes/default/sass/partials/_content.sass b/admin/themes/default/sass/partials/_content.sass index 54165bdf3..ab40342f3 100644 --- a/admin/themes/default/sass/partials/_content.sass +++ b/admin/themes/default/sass/partials/_content.sass @@ -16,7 +16,7 @@ body @include float(left) #content.bootstrap - padding: 90px 10px 0 + padding: 100px 10px 0 @include transition-property(margin) @include transition-duration(0.4s) @include transition-timing-function(ease-out) diff --git a/admin/themes/default/sass/partials/_header.sass b/admin/themes/default/sass/partials/_header.sass index f58be6050..a1ebadd42 100644 --- a/admin/themes/default/sass/partials/_header.sass +++ b/admin/themes/default/sass/partials/_header.sass @@ -24,6 +24,10 @@ #header_shopname @extend .navbar-brand text-decoration: none +.bootstrap + #header_shopname + @media (max-width: $screen-tablet) + @include padding(9px, 5px, 9px, 40px) #header_notifs_icon_wrapper @extend .nav diff --git a/admin/themes/default/sass/partials/_toolbar.sass b/admin/themes/default/sass/partials/_toolbar.sass index 01566d268..d74310693 100644 --- a/admin/themes/default/sass/partials/_toolbar.sass +++ b/admin/themes/default/sass/partials/_toolbar.sass @@ -1,6 +1,5 @@ .page-head width: 100% - height: 78px padding: 0 margin: 0 position: fixed @@ -18,14 +17,22 @@ font-weight: bold color: #363A41 white-space: nowrap - @include padding(31px, 0, 0, ($widthSidebarNav+20px)) - @media (max-width: $screen-tablet) - @include padding(26px, 0, 0, 70px) + @include padding(31px, 0, 20px, ($widthSidebarNav+20px)) + @media (max-width: $screen-phone) + @include padding(26px, 0, 55px, 70px) + @media (min-width: $screen-phone) and (max-width: $screen-tablet) + @include padding(26px, 0, 25px, 70px) a border-bottom: dotted 1px white &:hover color: black border-color: black + h2.page-title.configure + @include padding(31px, 0, 35px, ($widthSidebarNav+20px)) + @media (max-width: $screen-phone) + @include padding(26px, 0, 60px, 70px) + @media (min-width: $screen-phone) and (max-width: $screen-tablet) + @include padding(26px, 0, 40px, 70px) a color: white text-decoration: none @@ -42,6 +49,8 @@ background-color: transparent!important @include right(0) top: 18px + @media (max-width: $screen-tablet) + top: 25px @media (max-width: $screen-sm) #toolbar-nav border: none diff --git a/admin/themes/default/template/controllers/modules/configure.tpl b/admin/themes/default/template/controllers/modules/configure.tpl index 3fcf6569c..24b6560a0 100644 --- a/admin/themes/default/template/controllers/modules/configure.tpl +++ b/admin/themes/default/template/controllers/modules/configure.tpl @@ -26,7 +26,7 @@ {block name=pageTitle} -

+

{l s='Configure'}

{$module_display_name}

diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index 5c355a4f5..08fbeaf3e 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -17,7 +17,9 @@ * @license https://store.webkul.com/license.html *} +{if !isset($ajax) || !$ajax}
+{/if}
{l s='Cart Details'} @@ -51,7 +53,7 @@

{$data.room_type|escape:'html':'UTF-8'}

- {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))} + {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))} {dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date} {if $occupancy_required_for_booking} @@ -187,6 +189,7 @@
+{if !isset($ajax) || !$ajax} {* Modal for extra demands *} @@ -220,3 +223,4 @@ #add_new_room_services_block { display: none;} +{/if} diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index bffa8d544..ddb07016a 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -1701,67 +1701,67 @@ $('#back_to_service_btn').hide(); }); - // Add new custom service: Show hide new custom service form - $(document).on('click', '#btn_new_room_service', function() { - $('#add_new_room_services_block').show(); - $('#back_to_service_btn').show(); - $('#room_type_services_desc').hide(); - }); + // Add new custom service: Show hide new custom service form + $(document).on('click', '#btn_new_room_service', function() { + $('#add_new_room_services_block').show(); + $('#back_to_service_btn').show(); + $('#room_type_services_desc').hide(); + }); - // Add new custom service: change auto added option - $(document).on('change', '#add_new_room_services_form input[name="new_service_auto_added"]', function() { - var room_type_tax_rule_group_exist = $("#room_type_tax_rule_group_exist").val(); - if ($(this).val() == 1) { - $("#new_service_price_tax_rule_container").hide(); - $("#new_service_price_addition_type_container").show(); - $("#new_service_qty_container").hide(); - } else { - $("#new_service_price_addition_type_container").hide(); - $("#new_service_qty_container").show(); - $("#new_service_price_tax_rule_container").show(); - } - }); + // Add new custom service: change auto added option + $(document).on('change', '#add_new_room_services_form input[name="new_service_auto_added"]', function() { + var room_type_tax_rule_group_exist = $("#room_type_tax_rule_group_exist").val(); + if ($(this).val() == 1) { + $("#new_service_price_tax_rule_container").hide(); + $("#new_service_price_addition_type_container").show(); + $("#new_service_qty_container").hide(); + } else { + $("#new_service_price_addition_type_container").hide(); + $("#new_service_qty_container").show(); + $("#new_service_price_tax_rule_container").show(); + } + }); - // Add new custom service to the room - $(document).on('submit', '#add_new_room_services_form', function(e) { - e.preventDefault(); - var form_data = new FormData(this); - form_data.append('ajax', true); - form_data.append('action', 'addNewRoomServices'); + // Add new custom service to the room + $(document).on('submit', '#add_new_room_services_form', function(e) { + e.preventDefault(); + var form_data = new FormData(this); + form_data.append('ajax', true); + form_data.append('action', 'addNewRoomServices'); - $(".loading_overlay").show(); - $.ajax({ - type: 'POST', - headers: { - "cache-control": "no-cache" - }, - url: "{$link->getAdminLink('AdminCarts')|addslashes}", - dataType: 'JSON', - cache: false, - data: form_data, - processData: false, - contentType: false, - success: function(jsonData) { - if (!jsonData.hasError) { - if (jsonData.service_panel) { - $('#room_type_service_product_desc').replaceWith(jsonData.service_panel); - } - showSuccessMessage(txtExtraDemandSucc); - } else { - var errorHtml = error_found_txt + ':
'; - errorHtml += '
    '; - $.each(jsonData.errors, function(key, errorMsg) { - errorHtml += '
  1. ' + errorMsg + '
  2. '; - }); - errorHtml += '
'; - showErrorMessage(errorHtml); - } - }, - complete: function() { - $(".loading_overlay").hide(); - } - }); - }); + $(".loading_overlay").show(); + $.ajax({ + type: 'POST', + headers: { + "cache-control": "no-cache" + }, + url: "{$link->getAdminLink('AdminCarts')|addslashes}", + dataType: 'JSON', + cache: false, + data: form_data, + processData: false, + contentType: false, + success: function(jsonData) { + if (!jsonData.hasError) { + if (jsonData.service_panel) { + $('#room_type_service_product_desc').replaceWith(jsonData.service_panel); + } + showSuccessMessage(txtExtraDemandSucc); + } else { + var errorHtml = error_found_txt + ':
'; + errorHtml += '
    '; + $.each(jsonData.errors, function(key, errorMsg) { + errorHtml += '
  1. ' + errorMsg + '
  2. '; + }); + errorHtml += '
'; + showErrorMessage(errorHtml); + } + }, + complete: function() { + $(".loading_overlay").hide(); + } + }); + }); $(document).on('click', '.change_room_type_service_product', function() { if ($(this).prop('checked')) { @@ -1770,6 +1770,7 @@ $("#selected_service_product_"+$(this).val()).val(0); } }); + $(document).on('submit', '#update_selected_room_services_form', function(e) { e.preventDefault(); var form_data = new FormData(this); @@ -1815,7 +1816,6 @@
{block name="leadin"}{/block}
-{include file='controllers/orders/_current_cart_details_data.tpl'} {* If cart has errors the do not allow to proceed with this cart *}
@@ -1905,6 +1905,7 @@
-->*} + {include file='controllers/orders/_current_cart_details_data.tpl'}
-
+
-

{l s="Stay Overs" mod='dashguestcycle'}

+

{l s='Occupied Rooms' mod='dashguestcycle'}

- +

diff --git a/modules/hotelreservationsystem/classes/HotelBookingDemands.php b/modules/hotelreservationsystem/classes/HotelBookingDemands.php index 416ec2d67..8cca590ba 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDemands.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDemands.php @@ -204,7 +204,7 @@ class HotelBookingDemands extends ObjectModel } // Rounding as per configurations - $totalAmount += Tools::processPriceRounding($amount, $quantity); + $totalAmount = Tools::processPriceRounding($amount, $quantity); $values .= '('.(int)$this->id.','.(int)$idTax.','.(float)$amount.','. (float)$totalAmount.'),'; diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 97f037fcd..dd9e603e4 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -62,6 +62,7 @@ class HotelBookingDetail extends ObjectModel public $adults; public $children; public $child_ages; + public $planned_check_out; public $date_add; public $date_upd; @@ -124,6 +125,7 @@ class HotelBookingDetail extends ObjectModel 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 255, 'required' => true), 'check_in_time' => array('type' => self::TYPE_STRING, 'required' => true), 'check_out_time' => array('type' => self::TYPE_STRING, 'required' => true), + 'planned_check_out' => array('type' => self::TYPE_STRING, 'required' => true), 'adults' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'children' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'child_ages' => array('type' => self::TYPE_STRING), @@ -1872,6 +1874,7 @@ class HotelBookingDetail extends ObjectModel $reallocatedBookingId = 0; // get the cart booking data for the given booking if (Validate::isLoadedObject($objOldHotelBooking = new HotelBookingDetail($idHotelBooking))) { + $objectHotelBookingFrom = clone $objOldHotelBooking; $objHotelRoomInfo = new HotelRoomInformation($idRoom); $idNewRoomType = $objHotelRoomInfo->id_product; if ($objOldHotelBooking->id_product != $idNewRoomType) { @@ -2098,6 +2101,7 @@ class HotelBookingDetail extends ObjectModel if ($result &= $objBookingDetail->save()) { $reallocatedBookingId = $objBookingDetail->id; + $objectHotelBookingTo = $objBookingDetail; // Get Booking Demands of the old booking to add in the new booking creation $objBookingDemand = new HotelBookingDemands(); if ($oldBookingDemands = $objBookingDemand->getRoomTypeBookingExtraDemands( @@ -2278,6 +2282,7 @@ class HotelBookingDetail extends ObjectModel $result &= $objOldHotelBooking->save(); $reallocatedBookingId = $objOldHotelBooking->id; + $objectHotelBookingTo = $objOldHotelBooking; } if ($result && $reallocatedBookingId) { @@ -2286,6 +2291,8 @@ class HotelBookingDetail extends ObjectModel array( 'id_htl_booking_from' => $idHotelBooking, 'id_htl_booking_to' => $reallocatedBookingId, + 'objectHotelBookingFrom' => $objectHotelBookingFrom, + 'objectHotelBookingTo' => $objectHotelBookingTo, ) ); @@ -3660,4 +3667,18 @@ class HotelBookingDetail extends ObjectModel return $result; } + + public function add($auto_date = true, $null_values = false) + { + if (!$this->planned_check_out) { + $objHotelBranchInfo = new HotelBranchInformation((int) $this->id_hotel); + $dateTo = new DateTime($this->date_to); + $timeParts = explode(':', $objHotelBranchInfo->check_out); + $dateTo->setTime($timeParts[0], $timeParts[1]); + + $this->planned_check_out = $dateTo->format('Y-m-d H:i:s'); + } + + return parent::add($auto_date, $null_values); + } } diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 137697e46..7182faf92 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -24,17 +24,17 @@ class HotelHelper { $objModule = new HotelreservationSystem(); $jsVars = array( - 'display_name' => $objModule->l('Display', 'HotelHelper', false, true), - 'records_name' => $objModule->l('records per page', 'HotelHelper', false, true), - 'no_product' => $objModule->l('No records found', 'HotelHelper', false, true), - 'show_page' => $objModule->l('Showing page', 'HotelHelper', false, true), - 'show_of' => $objModule->l('of', 'HotelHelper', false, true), - 'no_record' => $objModule->l('No records available', 'HotelHelper', false, true), - 'filter_from' => $objModule->l('filtered from', 'HotelHelper', false, true), - 't_record' => $objModule->l('total records', 'HotelHelper', false, true), - 'search_item' => $objModule->l('Search', 'HotelHelper', false, true), - 'p_page' => $objModule->l('Previous', 'HotelHelper', false, true), - 'n_page' => $objModule->l('Next', 'HotelHelper', false, true), + 'display_name' => $objModule->l('Display', 'HotelHelper', true), + 'records_name' => $objModule->l('records per page', 'HotelHelper', true), + 'no_product' => $objModule->l('No records found', 'HotelHelper', true), + 'show_page' => $objModule->l('Showing page', 'HotelHelper', true), + 'show_of' => $objModule->l('of', 'HotelHelper', true), + 'no_record' => $objModule->l('No records available', 'HotelHelper',true), + 'filter_from' => $objModule->l('filtered from', 'HotelHelper', true), + 't_record' => $objModule->l('total records', 'HotelHelper', true), + 'search_item' => $objModule->l('Search', 'HotelHelper', true), + 'p_page' => $objModule->l('Previous', 'HotelHelper', true), + 'n_page' => $objModule->l('Next', 'HotelHelper', true), ); Media::addJsDef($jsVars); @@ -2231,6 +2231,10 @@ class HotelHelper $objProduct->price_calculation_method = $serviceProduct['price_calculation_method']; $objProduct->is_virtual = 1; $objProduct->indexed = 1; + if ($objProduct->auto_add_to_cart && $objProduct->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM) { + $objProduct->id_tax_rules_group = 0; + } + $objProduct->save(); $idProduct = $objProduct->id; diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index 484311892..56b672313 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -153,6 +153,7 @@ class HotelReservationSystemDb `comment` text NOT NULL, `check_in` datetime NOT NULL, `check_out` datetime NOT NULL, + `planned_check_out` datetime NOT NULL, `date_from` datetime NOT NULL, `date_to` datetime NOT NULL, `total_price_tax_excl` decimal(20,6) NOT NULL, diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index fd1ef9d93..6b9a82692 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -651,8 +651,8 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $totalPrice['total_price_tax_excl'] = 0; $featureImpactPriceTE = 0; $featureImpactPriceTI = 0; - $productPriceTI = Product::getPriceStatic((int) $id_product, true, false, 6, null, false, $use_reduc); - $productPriceTE = Product::getPriceStatic((int) $id_product, false, false, 6, null, false, $use_reduc); + $productPriceTI = Product::getPriceStatic((int) $id_product, 1, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 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, $id_group); if ($productPriceTE) { $taxRate = (($productPriceTI-$productPriceTE)/$productPriceTE)*100; } else { diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php index d8a236f66..2d7059469 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php @@ -239,6 +239,13 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel $totalPrice += $product['total_price_tax_excl']; } } else { + $taxes = OrderDetailCore::getTaxListStatic($product['id_order_detail']); + $tax_temp = array(); + foreach ($taxes as $tax) { + $obj = new Tax($tax['id_tax']); + $tax_temp[] = sprintf('%1$s%2$s%%', ($obj->rate + 0), ' '); + } + $product_tax_label = implode(', ', $tax_temp); if (isset($selectedAdditionalServices['additional_services'])) { $selectedAdditionalServices['total_price_tax_excl'] += $product['total_price_tax_excl']; $selectedAdditionalServices['total_price_tax_incl'] += $product['total_price_tax_incl']; @@ -257,6 +264,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel 'unit_price_tax_incl' => $product['unit_price_tax_incl'], 'total_price_tax_excl' => $product['total_price_tax_excl'], 'total_price_tax_incl' => $product['total_price_tax_incl'], + 'product_tax_label' => $product_tax_label, ); } else { $selectedAdditionalServices['id_order'] = $product['id_order']; @@ -282,6 +290,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel 'unit_price_tax_incl' => $product['unit_price_tax_incl'], 'total_price_tax_excl' => $product['total_price_tax_excl'], 'total_price_tax_incl' => $product['total_price_tax_incl'], + 'product_tax_label' => $product_tax_label, ), ); } diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php index 8feb56940..ffb137c2f 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductPrice.php @@ -110,7 +110,8 @@ class RoomTypeServiceProductPrice extends ObjectModel $useTax = null, $id_cart = false, $id_address = null, - $use_reduc= 1 + $use_reduc= 1, + $idGroup = null ) { if ($useTax === null) $useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true; @@ -135,7 +136,8 @@ class RoomTypeServiceProductPrice extends ObjectModel true, null, true, - (int)$idProductRoomType + (int)$idProductRoomType, + $idGroup ); Hook::exec('actionServicePriceModifier', diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 19223bf00..f21791e18 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -222,6 +222,7 @@ class AdminAddHotelController extends ModuleAdminController $smartyVars['ps_img_dir'] = _PS_IMG_.'l/'; $smartyVars['MAX_GLOBAL_BOOKING_DATE'] = (Configuration::get('MAX_GLOBAL_BOOKING_DATE')); $smartyVars['GLOBAL_PREPARATION_TIME'] = Configuration::get('GLOBAL_PREPARATION_TIME'); + $smartyVars['WK_ORDER_REFUND_ALLOWED'] = Configuration::get('WK_ORDER_REFUND_ALLOWED'); $this->context->smarty->assign($smartyVars); @@ -322,6 +323,10 @@ class AdminAddHotelController extends ModuleAdminController } } + if ($activeRefund && !Configuration::get('WK_ORDER_REFUND_ALLOWED')) { + $this->errors[] = $this->l('Enable order refunds to allow hotel-wise refunds.'); + } + // validate Friendly URL values if (!trim(Tools::getValue('link_rewrite_'.$defaultLangId))) { $this->errors[] = $this->l('Friendly URL is required at least in '). diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index c4f70e5d2..6cbe0183c 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -747,13 +747,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController } } else { // remove room from cart - $objHotelCartBookingData = new HotelCartBookingData($id_cart_book_data); - if ($objHotelCartBookingData->deleteCartBookingData( - $obj_booking_dtl->id_cart, - $objHotelCartBookingData->id_product, - $objHotelCartBookingData->id_room, - $objHotelCartBookingData->date_from, - $objHotelCartBookingData->date_to + if ((Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData((int) $id_cart_book_data))) + && $objHotelCartBookingData->deleteCartBookingData( + $objHotelCartBookingData->id_cart, + $objHotelCartBookingData->id_product, + $objHotelCartBookingData->id_room, + $objHotelCartBookingData->date_from, + $objHotelCartBookingData->date_to )) { $response['success'] = true; if ($ajax_delete) { @@ -994,7 +994,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', null, true), 'PS_BACKDATE_ORDER_ALLOW' => $PS_BACKDATE_ORDER_ALLOW, // 'check_calender_var' => $check_calender_var, - 'txtSomeErr' => $this->l('Some error occurred. Please try again.'), + 'txtSomeErr' => $this->l('Some error occurred. Please try again.', null, true), 'no_rm_avail_txt' => $this->l('No room available.', null, true), 'no_realloc_rm_avail_txt' => $this->l('No room available for reallocation.', null, true), 'no_realloc_rm_type_avail_txt' => $this->l('No room type available for reallocation.', null, true), diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php index cb297db48..91b3b8dbe 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php @@ -1,4 +1,26 @@ errors) && !Tools::getValue('WK_ORDER_REFUND_ALLOWED')) { + $objHotelBranchInfo = new HotelBranchInformation(); + if ($hotels = $objHotelBranchInfo->getAllHotels()) { + foreach ($hotels as $hotel) { + $objHotelBranchInfo = new HotelBranchInformation($hotel['id']); + if ($objHotelBranchInfo->active_refund) { + $objHotelBranchInfo->active_refund = 0; + $objHotelBranchInfo->save(); + } + } + } + } + } + public function setMedia() { parent::setMedia(); diff --git a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js index 86850226e..81587d0b8 100644 --- a/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js +++ b/modules/hotelreservationsystem/views/js/admin/hotel_rooms_booking.js @@ -506,16 +506,14 @@ $(document).ready(function() { opt: 0, }, success: function(result) { - if (result) { - if (!(result.success)) { - $(".cart_booking_btn").attr('disabled', 'true'); - } + if (!result.success) { + $(".cart_booking_btn").attr('disabled', 'true'); + } else { $("#htl_rooms_list").empty().append(result.data.room_tpl); refreshCartData(); refreshStatsData(); calendar.refetchEvents(); initBookingList(); - var panel_btn = $(".tab-pane tr td button[data-id-cart-book-data='" + id_cart_book_data + "']"); panel_btn.attr('data-id-cart', ''); @@ -527,7 +525,6 @@ $(document).ready(function() { panel_btn.removeClass('part_delete_cart_data').addClass('par_add_cart'); panel_btn.removeClass('btn-danger').addClass('btn-primary').html(add_to_cart); - } } }); diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index abe5510d2..7ce92e749 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -482,20 +482,20 @@ {hook h='displayAdminAddHotelFormRefundPoliciesTabBefore' id_hotel=$hook_arg_id_hotel} {if isset($hotel_info.id) && $hotel_info.id} + {if isset($WK_ORDER_REFUND_ALLOWED) && !$WK_ORDER_REFUND_ALLOWED} +
+ {l s='To enable hotel-wise refunds, activate order refunds in' mod='hotelreservationsystem'} {l s='Manage Order Refund Rules' mod='hotelreservationsystem'} +
+ {/if}
- - + - - - + diff --git a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php index 9f90bf623..8a0c2335e 100644 --- a/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php +++ b/modules/wkroomsearchblock/classes/WkRoomSearchHelper.php @@ -264,6 +264,21 @@ class WkRoomSearchHelper )); } + $totalColumns = 9;// min value + if ($locationEnabled) { + $totalColumns += 4; + } + + if (!(count($hotelsInfo) <= 1 && !$smartyVars['show_hotel_name'])) { + $totalColumns += 5; + } + + if (Configuration::get('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) { + $totalColumns += 4; + } + + $smartyVars['total_columns'] = $totalColumns; + Context::getContext()->smarty->assign($smartyVars); } } diff --git a/modules/wkroomsearchblock/views/js/wk-room-search-block.js b/modules/wkroomsearchblock/views/js/wk-room-search-block.js index 36d0a4205..e18babcb7 100644 --- a/modules/wkroomsearchblock/views/js/wk-room-search-block.js +++ b/modules/wkroomsearchblock/views/js/wk-room-search-block.js @@ -337,23 +337,6 @@ const BookingSearchManager = { return true; }, } -function updateGridColumns() { - const gridContainer = $('#search_hotel_block_form > .grid'); - $(gridContainer).each(function() { - const gridItems = $(this).find('div.grid-item'); - let totalColumns = 0; - - Array.from(gridItems).forEach(item => { - totalColumns += parseInt(getComputedStyle(item).getPropertyValue('--col-span')); - }); - - $(this).css('grid-template-columns', `repeat(${totalColumns}, 1fr)`); - - Array.from(gridItems).forEach(item => { - item.style.gridColumn = `span ${getComputedStyle(item).getPropertyValue('--col-span')}`; - }); - }) -} $(document).ready(function() { // initialize booking search fields diff --git a/modules/wkroomsearchblock/views/templates/hook/landingPageSearch.tpl b/modules/wkroomsearchblock/views/templates/hook/landingPageSearch.tpl index 0849db558..e1173253d 100644 --- a/modules/wkroomsearchblock/views/templates/hook/landingPageSearch.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/landingPageSearch.tpl @@ -23,7 +23,7 @@ {if isset($hotels_info) && count($hotels_info)}
-
+ diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index d7f89bc11..0b560896f 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -20,10 +20,10 @@
{hook h='displaySearchFormFieldsBefore'} {block name="search_form_fields_wrapper"} -
+
{block name='search_form_location'} {if isset($location_enabled) && $location_enabled} -
+