Merge branch 'develop' into gli-2459

This commit is contained in:
vishalsingh.qlo325
2025-03-28 15:26:44 +05:30
34 changed files with 389 additions and 272 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -26,7 +26,7 @@
{block name=pageTitle}
<h2 class="page-title">
<h2 class="page-title configure">
{l s='Configure'}
</h2>
<h4 class="page-subtitle">{$module_display_name}</h4>

View File

@@ -17,7 +17,9 @@
* @license https://store.webkul.com/license.html
*}
{if !isset($ajax) || !$ajax}
<div class="panel form-horizontal" id="customer_cart_details">
{/if}
<div class="panel-heading">
<i class="icon-shopping-cart"></i>
{l s='Cart Details'}
@@ -51,7 +53,7 @@
<td>
<p>{$data.room_type|escape:'html':'UTF-8'}</p>
</td>
{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'))}
<td>{dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date}</td>
{if $occupancy_required_for_booking}
<td>
@@ -187,6 +189,7 @@
</table>
</div>
</div>
{if !isset($ajax) || !$ajax}
</div>
{* Modal for extra demands *}
@@ -229,3 +232,4 @@
#rooms_extra_demands .room_demand_detail {
padding: 15px 15px 0px 15px;}
</style>
{/if}

View File

@@ -127,7 +127,7 @@
</div>
{if sizeof($invoices_collection)}
<div class="form-group">
<div class="form-group" style="display: none;">
<label class="control-label">{l s='Invoice'}</label>
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
<optgroup class="existing" label="{l s='Existing'}">

View File

@@ -127,6 +127,15 @@
</div>
</div>
</div>
<div class="product_invoice" style="display: none;">
<select name="product_invoice" class="edit_product_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" {if $invoice->id == $data.id_order_invoice}selected="selected"{/if}>
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
</option>
{/foreach}
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" id="submitRoomChange" class="btn btn-primary"><i class="icon icon-bed"></i> &nbsp;{l s="Update Rooms"}</button>

View File

@@ -409,7 +409,7 @@
html += '</select>';
html += '</td>';
html += '<td class="col-sm-3 center">';
html += '<input class="form-control" type="text" name="'+prefix+'[floor]">';
html += '<input class="form-control" type="text" name="'+prefix+'[comment]">';
html += '</td>';
html += '<td class="center col-sm-2">';
html += '<a class="btn btn-default deactiveDatesModal disabled" data-toggle="modal" data-target="#deactiveDatesModal">';

View File

@@ -284,7 +284,7 @@
if (typeof data[index] == 'string')
$.growl.error({ title: "", message: data[index]});
});
else if (quicklink_list)
else
{
$("#header_quick ul.dropdown-menu").html(quicklink_list);
showSuccessMessage(update_success_msg);

View File

@@ -323,11 +323,12 @@ class CustomerCore extends ObjectModel
if ($carts) {
$objHtlCartData = new HotelCartBookingData();
foreach ($carts as $cart) {
$objCart = new Cart($cart['id_cart']);
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart WHERE id_cart='.(int)$cart['id_cart']);
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart_product WHERE id_cart='.(int)$cart['id_cart']);
// delete rows from hotel booking cart table
$objHtlCartData->deleteCartBookingData($cart['id_cart'], 0, 0, 0, 0, 0);
if ($cart['id_cart']) {
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart WHERE id_cart='.(int)$cart['id_cart']);
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'cart_product WHERE id_cart='.(int)$cart['id_cart']);
// delete rows from hotel booking cart table
$objHtlCartData->deleteCartBookingData($cart['id_cart'], 0, 0, 0, 0, 0);
}
}
}

View File

@@ -503,11 +503,13 @@ class TabCore extends ObjectModel
public static function recursiveTab($id_tab, $tabs)
{
$admin_tab = Tab::getTab((int)Context::getContext()->language->id, $id_tab);
$tabs[] = $admin_tab;
if ($admin_tab['id_parent'] > 0) {
$tabs = Tab::recursiveTab($admin_tab['id_parent'], $tabs);
if ($admin_tab = Tab::getTab((int)Context::getContext()->language->id, $id_tab)) {
$tabs[] = $admin_tab;
if (isset($admin_tab['id_parent']) && $admin_tab['id_parent'] > 0) {
$tabs = Tab::recursiveTab($admin_tab['id_parent'], $tabs);
}
}
return $tabs;
}

View File

@@ -666,7 +666,7 @@ class AdminControllerCore extends Controller
));
/* BEGIN - Backward compatibility < 1.6.0.3 */
$this->breadcrumbs[] = $tabs[0]['name'];
$this->breadcrumbs[] = isset($tabs[0]['name']) ? $tabs[0]['name'] : '' ;
$navigation_pipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$this->context->smarty->assign('navigationPipe', $navigation_pipe);
/* END - Backward compatibility < 1.6.0.3 */

View File

@@ -347,9 +347,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
if ($type_value)
if (isset($customer->id)) {
$cart_obj = new Cart($this->order->id_cart);
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $cart_obj->id_guest, $type_value['product_id'], $customer->id, $type_value['id_order_detail']);
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $cart_obj->id_guest, $type_value['product_id'], $customer->id);
} else {
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $customer->id_guest, $type_value['product_id'], 0, $type_value['id_order_detail']);
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $customer->id_guest, $type_value['product_id'], 0);
}
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
@@ -376,40 +376,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
$var_quant = (int)$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($data_v['total_price_tax_excl']);
// For order refund
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
} else {
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0,
0,
$type_value['id_order_detail']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1,
0,
$type_value['id_order_detail']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
@@ -443,33 +412,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
0
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
@@ -480,18 +422,71 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['total_price_tax_excl'] = 0;
$cart_htl_data[$type_key]['date_diff'][$date_join]['total_price_tax_incl'] = 0;
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0;
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = 0;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = 0;
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] = 0;
// For order refund
$cart_htl_data[$type_key]['date_diff'][$date_join]['id_room'] = $data_v['id_room'];
$totalDemandsPriceTE += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
$totalDemandsPriceTI += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
}
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0,
$data_v['id']
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1,
$data_v['id']
);
$totalDemandsPriceTE += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
$totalDemandsPriceTI += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['total_price_tax_excl'] += $data_v['total_price_tax_excl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['total_price_tax_incl'] += $data_v['total_price_tax_incl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
@@ -537,6 +532,13 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
}
}
foreach ($cart_htl_data[$type_key]['date_diff'] as $date_join => $val) {
$num_days = $val['num_days'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $val['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $val['total_price_tax_excl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount'] += ($val['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + ($cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']/$num_days);
}
// calculate averages now
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);

View File

@@ -612,10 +612,24 @@ class AdminCartsControllerCore extends AdminController
$cart_detail_data = array();
$cart_detail_data_obj = new HotelCartBookingData();
$cart_detail_data_obj->updateIdCurrencyByIdCart($id_cart, $currency->id);
$cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart);
if ($cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart)) {
$objRoomType = new HotelRoomType();
foreach ($cart_detail_data as $key => $cart_data) {
$cart_detail_data[$key]['room_type_info'] = $objRoomType->getRoomTypeInfoByIdProduct($cart_data['id_product']);
}
}
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
$this->context->smarty->assign(array(
'cart_detail_data' => $cart_detail_data,
'currency' => new Currency((int)$this->context->cart->id_currency),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'ajax' => true
));
$tpl_path = 'default/template/controllers/orders/_current_cart_details_data.tpl';

View File

@@ -224,7 +224,7 @@ class AdminEmailsControllerCore extends AdminController
if (!defined('_PS_HOST_MODE_')) {
$this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices'][1] =
$this->l('Use PHP\'s mail() function (recommended; works in most cases)');
$this->l('Use PHP\'s mail() function');
}
ksort($this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices']);

View File

@@ -855,6 +855,7 @@ class AdminOrdersControllerCore extends AdminController
$this->context->smarty->assign(
array(
'order' => $objOrder,
'invoices_collection' => $objOrder->getInvoicesCollection(),
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
)
@@ -895,89 +896,92 @@ class AdminOrdersControllerCore extends AdminController
&& ($productLineData = Tools::getValue('product_line_data'))
) {
$productLineData = json_decode($productLineData, true);
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($productLineData['id_order_detail']))) {
$productLineData['id_order_invoice'] = $objOrderDetail->id_order_invoice;
$smartyVars = array(
'order' => $objOrder,
'data' => $productLineData,
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'orderEdit' => 1,
);
$smartyVars = array(
'order' => $objOrder,
'data' => $productLineData,
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'orderEdit' => 1,
);
$objCurrency = new Currency($objOrder->id_currency);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objCurrency = new Currency($objOrder->id_currency);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$smartyVars['id_booking_detail'] = $productLineData['id'];
$smartyVars['id_booking_detail'] = $productLineData['id'];
$objBookingDemand = new HotelBookingDemands();
$objBookingDemand = new HotelBookingDemands();
// set context currency So that we can get prices in the order currency
$this->context->currency = $objCurrency;
// set context currency So that we can get prices in the order currency
$this->context->currency = $objCurrency;
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
0,
0,
0,
0,
1,
0,
1,
$productLineData['id']
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
// get room type additional demands
$objRoomDemands = new HotelRoomTypeDemand();
if ($roomTypeDemands = $objRoomDemands->getRoomTypeDemands($idProduct)) {
foreach ($roomTypeDemands as &$demand) {
// if demand has advance options then set demand price as first advance option price.
if (isset($demand['adv_option']) && $demand['adv_option']) {
$demand['price'] = current($demand['adv_option'])['price'];
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
0,
0,
0,
0,
1,
0,
1,
$productLineData['id']
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
$smartyVars['roomTypeDemands'] = $roomTypeDemands;
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$productLineData['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
// get room type additional demands
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) {
if ($additionalServices) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
// get room type additional demands
$objRoomDemands = new HotelRoomTypeDemand();
if ($roomTypeDemands = $objRoomDemands->getRoomTypeDemands($idProduct)) {
foreach ($roomTypeDemands as &$demand) {
// if demand has advance options then set demand price as first advance option price.
if (isset($demand['adv_option']) && $demand['adv_option']) {
$demand['price'] = current($demand['adv_option'])['price'];
}
}
$smartyVars['roomTypeDemands'] = $roomTypeDemands;
}
$smartyVars['roomTypeServiceProducts'] = $roomTypeServiceProducts;
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$productLineData['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
// get room type additional demands
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) {
if ($additionalServices) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
}
}
}
$smartyVars['roomTypeServiceProducts'] = $roomTypeServiceProducts;
}
$objOrderReturn = new OrderReturn();
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrder->id, 0, 1);
$smartyVars['refundReqBookings'] = $refundReqBookings;
$smartyVars['invoices_collection'] = $objOrder->getInvoicesCollection();
$this->context->smarty->assign($smartyVars);
$modal = array(
'modal_id' => 'edit-room-booking-modal',
'modal_class' => 'modal-lg order_detail_modal',
'modal_title' => '<i class="icon icon-bed"></i> &nbsp'.$this->l('Edit Room'),
'modal_content' => $this->context->smarty->fetch('controllers/orders/modals/_edit_room_booking.tpl'),
);
$this->context->smarty->assign($modal);
$response['hasError'] = 0;
$response['modalHtml'] = $this->context->smarty->fetch('modal.tpl');
}
$objOrderReturn = new OrderReturn();
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrder->id, 0, 1);
$smartyVars['refundReqBookings'] = $refundReqBookings;
$this->context->smarty->assign($smartyVars);
$modal = array(
'modal_id' => 'edit-room-booking-modal',
'modal_class' => 'modal-lg order_detail_modal',
'modal_title' => '<i class="icon icon-bed"></i> &nbsp'.$this->l('Edit Room'),
'modal_content' => $this->context->smarty->fetch('controllers/orders/modals/_edit_room_booking.tpl'),
);
$this->context->smarty->assign($modal);
$response['hasError'] = 0;
$response['modalHtml'] = $this->context->smarty->fetch('modal.tpl');
}
die(Tools::jsonEncode($response));
@@ -4408,14 +4412,15 @@ class AdminOrdersControllerCore extends AdminController
}
}
// Create Order detail information
$order_detail = new OrderDetail();
$order_detail->createList($order, $cart, $order->getCurrentOrderState(), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
// update totals amount of order
$order->total_products += (float)$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS);
$order->total_products_wt += (float)$cart->getOrderTotal($use_taxes, Cart::ONLY_PRODUCTS);
// Create Order detail information
$order_detail = new OrderDetail();
// In case there is no room in the order the the create list will not add taxes as total_products is zero.
$order_detail->createList($order, $cart, $order->getCurrentOrderState(), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
@@ -4871,8 +4876,6 @@ class AdminOrdersControllerCore extends AdminController
if (isset($order_invoice)) {
// Apply changes on OrderInvoice
$order_invoice->total_products += (float)$diff_price_tax_excl;
$order_invoice->total_products_wt += (float)$diff_price_tax_incl;
$order_invoice->total_paid_tax_excl += (float)$diff_price_tax_excl;
$order_invoice->total_paid_tax_incl += (float)$diff_price_tax_incl;
}
@@ -4884,10 +4887,6 @@ class AdminOrdersControllerCore extends AdminController
$order->total_products_wt += (float)$diff_price_tax_incl;
$order->total_products_wt = $order->total_products_wt > 0 ? $order->total_products_wt : 0;
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$res &= $order->update();
}
@@ -4912,10 +4911,6 @@ class AdminOrdersControllerCore extends AdminController
}
}
// Save order invoice
if (isset($order_invoice)) {
$res &= $order_invoice->update();
}
if ($qty_diff != 0) {
$cartQty = $qty_diff;
@@ -5041,7 +5036,6 @@ class AdminOrdersControllerCore extends AdminController
)) {
// update extra demands total prices if dates are changes (price calc method for each day)
if ($extraDemands) {
$order = new Order($id_order);
foreach ($extraDemands as $demand) {
if (isset($demand['extra_demands']) && $demand['extra_demands']) {
foreach ($demand['extra_demands'] as $rDemand) {
@@ -5066,23 +5060,23 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDemand->total_price_tax_incl = $demandPriceTI;
$objBookingDemand->save();
$order_invoice->total_paid_tax_excl -= $rDemand['total_price_tax_excl'];
$order_invoice->total_paid_tax_incl -= $rDemand['total_price_tax_incl'];
$order_invoice->total_paid_tax_excl += (float)$objBookingDemand->total_price_tax_excl;
$order_invoice->total_paid_tax_incl += (float)$objBookingDemand->total_price_tax_incl;
}
}
}
}
// change order total save
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
}
if (isset($orderServiceProducts)
&& is_array($orderServiceProducts)
&& count($orderServiceProducts)
) {
$order = new Order((int) $id_order);
foreach ($orderServiceProducts as $orderServiceProduct) {
if (isset($orderServiceProduct['additional_services'])
&& is_array($orderServiceProduct['additional_services'])
@@ -5128,6 +5122,12 @@ class AdminOrdersControllerCore extends AdminController
$objOrderDetail->product_quantity += ($newProductQuantity - $oldProductQuantity);
$objOrderDetail->save();
$order_invoice->total_paid_tax_excl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$order_invoice->total_paid_tax_incl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
$order_invoice->total_paid_tax_excl += (float)$newTotalPriceTaxExcl;
$order_invoice->total_paid_tax_incl += (float)$newTotalPriceTaxIncl;
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $unitPriceTaxExcl;
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $unitPriceTaxIncl;
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $newTotalPriceTaxExcl;
@@ -5137,14 +5137,21 @@ class AdminOrdersControllerCore extends AdminController
}
}
}
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
}
}
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
// Save order invoice
if (isset($order_invoice)) {
$order_invoice->total_products = $order_invoice->total_paid_tax_excl;
$order_invoice->total_products_wt = $order_invoice->total_paid_tax_incl;
$res &= $order_invoice->update();
}
if (is_array(Tools::getValue('product_quantity'))) {
$view = $this->createTemplate('_customized_data.tpl')->fetch();
} else {
@@ -5524,8 +5531,8 @@ class AdminOrdersControllerCore extends AdminController
// Update Order
// values changes as values are calculated accoding to the quantity of the product by webkul
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal() - $roomExtraDemandTI, _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false) - $roomExtraDemandTE, _PS_PRICE_COMPUTE_PRECISION_);
$order->total_products -= ($diff_products_tax_excl + $additionlServicesTE);
$order->total_products = $order->total_products > 0 ? $order->total_products : 0;
@@ -5594,15 +5601,15 @@ class AdminOrdersControllerCore extends AdminController
$objOrderCartRule->delete();
}
// If no rooms left in the order, Update Order total and discounts to 0
$order->total_discounts = 0;
$order->total_discounts_tax_incl = 0;
$order->total_discounts_tax_excl = 0;
$order->total_paid = 0;
$order->total_paid_tax_incl = 0;
$order->total_paid_tax_excl = 0;
$order->update();
}
// If no rooms left in the order, Update Order total and discounts to 0
$order->total_discounts = 0;
$order->total_discounts_tax_incl = 0;
$order->total_discounts_tax_excl = 0;
$order->total_paid = 0;
$order->total_paid_tax_incl = 0;
$order->total_paid_tax_excl = 0;
$order->update();
}
// Assign to smarty informations in order to show the new product line
@@ -6136,7 +6143,7 @@ class AdminOrdersControllerCore extends AdminController
$del_id = Tools::getValue('del_id');
$room_id = Tools::getValue('id_room');
$obj_hotel_cart_detail = new HotelCartBookingData();
$deleted = $obj_hotel_cart_detail->deleteRowById($del_id);
$deleted = $obj_hotel_cart_detail->deleteCartBookingData($cart_id, $id_product, $room_id, $dt_frm, $dt_to);
if ($deleted) {
HotelRoomTypeFeaturePricing::deleteByIdCart($cart_id, $id_product, $room_id, $dt_frm, $dt_to );
$obj_product_process = new HotelCartBookingData();

View File

@@ -85,11 +85,12 @@ class AdminPPreferencesControllerCore extends AdminController
'PS_PRODUCT_SHORT_DESC_LIMIT' => array(
'title' => $this->l('Max size of short description'),
'hint' => $this->l('Set the maximum size of room type short description (in characters).'),
'validation' => 'isInt',
'validation' => 'isUnsignedInt',
'cast' => 'intval',
'type' => 'text',
'suffix' => $this->l('characters'),
'class' => 'fixed-width-xl',
'desc' => $this->l('If set to 0, the maximum limit will be 400 characters.')
),
/*'PS_QTY_DISCOUNT_ON_COMBINATION' => array(
'title' => $this->l('Quantity discounts based on'),

View File

@@ -3497,10 +3497,10 @@ class AdminProductsControllerCore extends AdminController
}
$objHotelRoomInfo->id_product = $id_product;
$objHotelRoomInfo->id_hotel = $id_hotel;
$objHotelRoomInfo->room_num = $roomInfo['room_num'];
$objHotelRoomInfo->room_num = trim($roomInfo['room_num']);
$objHotelRoomInfo->id_status = $roomInfo['id_status'];
$objHotelRoomInfo->floor = $roomInfo['floor'];
$objHotelRoomInfo->comment = $roomInfo['comment'];
$objHotelRoomInfo->floor = trim($roomInfo['floor']);
$objHotelRoomInfo->comment = trim($roomInfo['comment']);
if ($objHotelRoomInfo->save()
&& $objHotelRoomInfo->id_status != HotelRoomInformation::STATUS_TEMPORARY_INACTIVE
) {
@@ -3536,7 +3536,7 @@ class AdminProductsControllerCore extends AdminController
}
}
if ($roomInfo['room_num'] && !Validate::isGenericName($roomInfo['room_num'])) {
if (empty(trim($roomInfo['room_num'])) || !Validate::isGenericName($roomInfo['room_num'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid room number for room %s.'), $roomIndex);
}

View File

@@ -52,6 +52,7 @@ $('document').ready( function() {
function filterPanel(val, element_class)
{
val = $.trim(val);
$('#'+element_class+' .list-empty').hide();
$('#'+element_class+' .element-panel').css('display', 'flex').removeClass('hidden');

View File

@@ -77,11 +77,13 @@
const inputElementHeight = dateRangePickerInput.outerHeight();
const spaceTop = dateRangePickerInput.offset().top - $(window).scrollTop();
const spaceBottom = $(window).height() - inputElementHeight - spaceTop;
const maxHeightNeeded = $(calendarDom).get(0).scrollHeight;
// 20 added for padding
const maxHeightNeeded = $(calendarDom).get(0).scrollHeight + 20;
let positionClass = 'bottom';
// determine position class
if (spaceBottom < maxHeightNeeded && spaceTop > spaceBottom) {
if (spaceBottom < maxHeightNeeded && spaceTop > maxHeightNeeded && spaceTop > spaceBottom) {
positionClass = 'top';
}

View File

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

View File

@@ -1872,6 +1872,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 +2099,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 +2280,7 @@ class HotelBookingDetail extends ObjectModel
$result &= $objOldHotelBooking->save();
$reallocatedBookingId = $objOldHotelBooking->id;
$objectHotelBookingTo = $objOldHotelBooking;
}
if ($result && $reallocatedBookingId) {
@@ -2286,6 +2289,8 @@ class HotelBookingDetail extends ObjectModel
array(
'id_htl_booking_from' => $idHotelBooking,
'id_htl_booking_to' => $reallocatedBookingId,
'objectHotelBookingFrom' => $objectHotelBookingFrom,
'objectHotelBookingTo' => $objectHotelBookingTo,
)
);

View File

@@ -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;

View File

@@ -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), '&nbsp;');
}
$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,
),
);
}

View File

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

View File

@@ -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),

View File

@@ -1,4 +1,26 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
class AdminOrderRefundRulesController extends ModuleAdminController
{
public function __construct()
@@ -302,6 +324,23 @@ class AdminOrderRefundRulesController extends ModuleAdminController
}
}
protected function processUpdateOptions()
{
parent::processUpdateOptions();
if (empty($this->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();

View File

@@ -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}
<div class="alert alert-info">
{l s='To enable hotel-wise refunds, activate order refunds in' mod='hotelreservationsystem'} <a href="{$link->getAdminLink('AdminOrderRefundRules')|escape:'html':'UTF-8'}" target="_blank">{l s='Manage Order Refund Rules' mod='hotelreservationsystem'}</a>
</div>
{/if}
<div class="form-group">
<label for="active_refund" class="control-label col-sm-5">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title='{l s='Enable, if you want to enable refund for this hotel.' mod='hotelreservationsystem'}'>{l s='Enable refund' mod='hotelreservationsystem'}</span>
</label>
<div class="col-sm-7">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" value="1" id="active_refund_on" name="active_refund"
{if isset($smarty.post.active_refund)}{if $smarty.post.active_refund}checked="checked"{/if}{elseif isset($hotel_info) && $hotel_info.active_refund}checked="checked"{/if}>
<input type="radio" value="1" id="active_refund_on" name="active_refund" {if isset($WK_ORDER_REFUND_ALLOWED) && !$WK_ORDER_REFUND_ALLOWED} disabled="disabled" {elseif isset($smarty.post.active_refund)}{if $smarty.post.active_refund}checked="checked"{/if}{elseif isset($hotel_info) && $hotel_info.active_refund}checked="checked"{/if}>
<label for="active_refund_on">{l s='Yes' mod='hotelreservationsystem'}</label>
<input type="radio" value="0" id="active_refund_off" name="active_refund"
{if isset($smarty.post.active_refund)}{if !$smarty.post.active_refund}checked="checked"{/if}{elseif !isset($hotel_info)}checked="checked"{elseif isset($hotel_info) && !$hotel_info.active_refund}checked="checked"{/if}>
<input type="radio" value="0" id="active_refund_off" name="active_refund" {if isset($WK_ORDER_REFUND_ALLOWED) && !$WK_ORDER_REFUND_ALLOWED} disabled="disabled" checked="checked" {elseif isset($smarty.post.active_refund)}{if !$smarty.post.active_refund}checked="checked"{/if}{elseif !isset($hotel_info)}checked="checked"{elseif isset($hotel_info) && !$hotel_info.active_refund}checked="checked"{/if}>
<label for="active_refund_off">{l s='No' mod='hotelreservationsystem'}</label>
<a class="slide-button btn"></a>
</span>

View File

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

View File

@@ -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

View File

@@ -23,7 +23,7 @@
{if isset($hotels_info) && count($hotels_info)}
<div class="header-rmsearch-wrapper" id="xs_room_search_form">
<div class="header-rmsearch-primary">
<div class="fancy_search_header_xs">
<div class="fancy_search_header_xs" style="display:none;">
<p>{l s='Search Rooms' mod='wkroomsearchblock'}</p>
<hr>
</div>

View File

@@ -20,10 +20,10 @@
<form method="POST" id="search_hotel_block_form">
{hook h='displaySearchFormFieldsBefore'}
{block name="search_form_fields_wrapper"}
<div class="grid" id="search_form_fields_wrapper">
<div class="grid" id="search_form_fields_wrapper" style="grid-template-columns: repeat({$total_columns}, 1fr);">
{block name='search_form_location'}
{if isset($location_enabled) && $location_enabled}
<div class="form-group grid-item area-4">
<div class="form-group grid-item area-4" style="grid-column: span 4;">
<div class="dropdown">
<input type="text" class="form-control header-rmsearch-input input-location" id="hotel_location" name="hotel_location" autocomplete="off" placeholder="{l s='Hotel Location' mod='wkroomsearchblock'}" {if isset($search_data)}value="{$search_data['location']|escape:'htmlall':'UTF-8'}"{/if}>
<input hidden="hidden" name="location_category_id" id="location_category_id" {if isset($search_data)}value="{$search_data['location_category_id']|escape:'htmlall':'UTF-8'}"{/if}>
@@ -40,7 +40,7 @@
<input type="hidden" id="id_hotel" name="id_hotel" value="{$hotels_info[0]['id']|escape:'htmlall':'UTF-8'}">
<input type="hidden" id="htl_name" class="form-control header-rmsearch-input" value="{$hotels_info[0]['hotel_name']}" readonly>
{else}
<div class="form-group grid-item area-5">
<div class="form-group grid-item area-5" style="grid-column: span 5;">
<input type="hidden" id="hotel_cat_id" name="hotel_cat_id" {if isset($search_data)}value="{$search_data['htl_dtl']['id_category']|escape:'htmlall':'UTF-8'}"{/if}>
<input type="hidden" id="id_hotel" name="id_hotel" {if isset($search_data)}value="{$search_data['htl_dtl']['id']|escape:'htmlall':'UTF-8'}"{/if}>
<input type="hidden" id="max_order_date" name="max_order_date" value="{if isset($max_order_date)}{$max_order_date|escape:'htmlall':'UTF-8'}{/if}">
@@ -60,7 +60,7 @@
{block name='search_form_dates'}
{if isset($multiple_dates_input) && $multiple_dates_input}
<div class="grid-item area-5 multi-date" id="daterange_value">
<div class="grid-item area-5 multi-date" id="daterange_value" style="grid-column: span 5;">
<div class="form-group">
<input type="hidden" id="check_in_time" name="check_in_time" {if isset($search_data)}value="{$search_data['date_from']|escape:'htmlall':'UTF-8'}"{/if}>
<div class="form-control header-rmsearch-input input-date" autocomplete="off" id="daterange_value_from" placeholder="{l s='Check-in' mod='wkroomsearchblock'}"><span>{l s='Check-in' mod='wkroomsearchblock'}</span></div>
@@ -71,7 +71,7 @@
</div>
</div>
{else}
<div class="form-group grid-item area-5">
<div class="form-group grid-item area-5" style="grid-column: span 5;">
<input type="hidden" id="check_in_time" name="check_in_time" {if isset($search_data)}value="{$search_data['date_from']|escape:'htmlall':'UTF-8'}"{/if}>
<input type="hidden" id="check_out_time" name="check_out_time" {if isset($search_data)}value="{$search_data['date_to']|escape:'htmlall':'UTF-8'}"{/if}>
<div class="form-control header-rmsearch-input input-date" id="daterange_value" autocomplete="off" placeholder="{l s='Check-in - Check-out' mod='wkroomsearchblock'}" tabindex="-1"><span>{l s='Check-in' mod='wkroomsearchblock'} &nbsp;<i class="icon icon-minus"></i>&nbsp; {l s='Check-out' mod='wkroomsearchblock'}</span></div>
@@ -81,7 +81,7 @@
{block name='search_form_occupancy'}
{if isset($is_occupancy_wise_search) && $is_occupancy_wise_search}
<div class="form-group grid-item area-4">
<div class="form-group grid-item area-4" style="grid-column: span 4;">
<div class="dropdown">
<button class="form-control input-occupancy header-rmsearch-input {if isset($error) && $error == 1}error_border{/if}" type="button" data-toggle="dropdown" id="guest_occupancy">
<span class="pull-left">{if (isset($search_data['occupancy_adults']) && $search_data['occupancy_adults'])}{$search_data['occupancy_adults']} {if $search_data['occupancy_adults'] > 1}{l s='Adults' mod='wkroomsearchblock'}{else}{l s='Adult' mod='wkroomsearchblock'}{/if}, {if isset($search_data['occupancy_children']) && $search_data['occupancy_children']}{$search_data['occupancy_children']} {if $search_data['occupancy_children'] > 1}
@@ -235,7 +235,7 @@
{/if}
{/block}
{block name='search_form_submit'}
<div class="form-group grid-item search_room_submit_block area-4">
<div class="form-group grid-item search_room_submit_block area-4" style="grid-column: span 4;">
<button type="submit" class="btn btn btn-primary" name="search_room_submit" id="search_room_submit">
<span>{l s='Search Rooms' mod='wkroomsearchblock'}</span>
</button>
@@ -244,10 +244,3 @@
</div>
{/block}
</form>
<script>
{literal}
// Call the function to set the grid columns on load
updateGridColumns();
{/literal}
</script>

View File

@@ -27,9 +27,10 @@
<thead>
<tr>
<th class="product header small" width="35%">{l s='Room Type / Reference' pdf='true'}</th>
<th class="product header small" width="35%">{l s='Duration' pdf='true'}</th>
<th class="product header small" width="10%">{l s='Num rooms' pdf='true'}</th>
<th class="product header small" width="20%">{l s='Room Type / Reference' pdf='true'}</th>
<th class="product header small" width="20%">{l s='Hotel' pdf='true'}</th>
<th class="product header small" width="30%">{l s='Duration' pdf='true'}</th>
<th class="product header small" width="10%">{l s='Num rooms' pdf='true'}</th>
{* <th class="product header-right small" width="15%">{l s='Unit price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th> *}
<th class="product header-right small" width="20%">{l s='Total Price' pdf='true'}<br />{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}</th>
</tr>
@@ -49,6 +50,9 @@
<td class="product left">
{$order_detail.product_name}
</td>
<td class="product center">
{$order_detail.hotel_name}
</td>
<td class="product center">
{$order_detail.date_from|date_format:"%d-%m-%Y"} {l s='To' pdf='true'} {$order_detail.date_to|date_format:"%d-%m-%Y"}
</td>

View File

@@ -1267,18 +1267,21 @@ function crossselling_serialScroll() {
});
}
function resetRoomtypeServices() {
function resetRoomtypeServices(refresh = true) {
$('.room_demands_container').find('input.id_room_type_demand:checked').prop('checked', false).uniform();
$('#additional_products').empty();
$('#additional_products div')
$('.remove_roomtype_product').text(select_txt).removeClass('btn-danger remove_roomtype_product').addClass('btn-success add_roomtype_product');
BookingForm.refresh();
if (refresh) {
BookingForm.refresh();
}
}
function disableRoomTypeDemands(show) {
if (show) {
$('.room_demands_container_overlay').show();
$('.room_demands_container').find('input:checkbox.id_room_type_demand').prop('checked', false);
$('.room_demand_block').find('.id_room_type_demand').prop('checked', false).parent().removeClass('checked');
$('.room_demands_container').find('input:checkbox.id_room_type_demand').attr('disabled', 'disabled');
} else {
$('.room_demands_container_overlay').hide();
@@ -1289,6 +1292,7 @@ function disableRoomTypeDemands(show) {
function disableRoomTypeServices(disable) {
if (disable) {
resetRoomtypeServices(false);
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {