Merge branch 'develop' into gli-886

This commit is contained in:
Shreesh Arora
2023-03-25 18:59:25 +05:30
99 changed files with 3116 additions and 793 deletions

2
.gitignore vendored
View File

@@ -167,6 +167,8 @@ img/**
!/override/classes/index.php
!/override/classes/cache/
!/override/classes/cache/index.php
!/override/classes/checkoutProcess/
!/override/classes/checkoutProcess/index.php
!/override/classes/controller/
!/override/classes/controller/index.php
!/override/classes/db/

View File

@@ -26,6 +26,10 @@
{extends file="helpers/form/form.tpl"}
{block name="label"}
{if $input.name == 'vat_number'}
<div id="vat_area" style="display: visible">
{/if}
{if $input.type == 'text_customer' && !isset($customer)}
<label class="control-label col-lg-3 required" for="email">{l s='Customer email'}</label>
{else}
@@ -90,4 +94,7 @@
{else}
{$smarty.block.parent}
{/if}
{if $input.name == 'vat_number'}
</div>
{/if}
{/block}

View File

@@ -87,52 +87,179 @@
<thead>
<tr>
<th class="fixed-width-xs"><span class="title_box">{l s='Image'}</span></th>
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
<th class="text-center"><span class="title_box">{l s='Unit Price'}</span></th>
<th><span class="title_box">{l s='Room Type'}</span></th>
<th><span class="title_box">{l s='Hotel'}</span></th>
<th><span class="title_box">{l s='Duration'}</span></th>
<th><span class="title_box">{l s='occupancy'}</span></th>
<th><span class="title_box">{l s='Room price'}</span></th>
<th><span class="title_box">{l s='Extra services'}</span></th>
<th class="text-right"><span class="title_box">{l s='Total'}</span></th>
</tr>
</thead>
<tbody>
{foreach from=$products item='product'}
{foreach from=$cart_htl_data item='room'}
<tr>
<td>{$product.image}</td>
<td class="text-center">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$product.id_product}&amp;updateproduct">
<span class="productName">{$product.name}</span>{if isset($product.attributes)}<br />{$product.attributes}{/if}<br />
{if $product.reference}{l s='Ref:'} {$product.reference}{/if}
{if $product.reference && $product.supplier_reference} / {$product.supplier_reference}{/if}
<td><img src="{$room['image_link']}" class="img-responsive" /></td>
<td>
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$room['id_product']}&amp;updateproduct">
<span class="productName">{$room['room_type']}</span>
</a>
</td>
<td class="text-center">{displayWtPriceWithCurrency price=$product.product_price currency=$currency}</td>
<td class="text-right">{displayWtPriceWithCurrency price=$product.product_total currency=$currency}</td>
<td><a href="{$link->getAdminLink('AdminAddHotel')|escape:'html':'UTF-8'}&amp;id={$room['id_hotel']}&amp;updatehtl_branch_info">{$room['room_type_info'].hotel_name}</a></td>
<td>{dateFormat date=$room['date_from']} - {dateFormat date=$room['date_to']}</td>
<td>
<span>
{if $room['adults']}{$room['adults']}{/if} {if $room['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$room['children']}}, {$room['children']} {if $room['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</span>
</td>
<td>{displayWtPriceWithCurrency price=$room['feature_price_tax_excl'] currency=$currency}</td>
<td>
{if (isset($room['extra_demands']) && $room['extra_demands']) || (isset($room['additional_service']) && $room['additional_service'])}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands_{$room['id']}">
{displayWtPriceWithCurrency price=($room['demand_price'] + $room['additional_service_price'] + $room['additional_services_auto_add_price'])|escape:'html':'UTF-8' currency=$currency}
</a>
{else}
{displayWtPriceWithCurrency price=0 currency=$currency}
{/if}
</td>
<td class="text-right">
{if (isset($room['extra_demands']) && $room['extra_demands']) || (isset($room['additional_service']) && $room['additional_service'])}
{displayWtPriceWithCurrency price=($room['amt_with_qty'] + $room['additional_services_auto_add_price'] + $room['demand_price'] + $room['additional_service_price'])|escape:'html':'UTF-8' currency=$currency}
{else}
{displayWtPriceWithCurrency price=$room['amt_with_qty']|escape:'html':'UTF-8' currency=$currency}
{/if}
</td>
</tr>
<div class="modal" tabindex="-1" role="dialog" id="rooms_type_extra_demands_{$room['id']}">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" id="rooms_extra_demands">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<ul class="nav nav-tabs" role="tablist">
{if isset($room['selected_demands']) && $room['selected_demands']}
<li role="presentation" class="active"><a href="#room_type_demands_desc_{$room['id']}" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($room['selected_services']) && $room['selected_services']}
<li role="presentation" {if !isset($room['selected_demands']) || !$room['selected_demands']}class="active"{/if}><a href="#room_type_service_product_desc_{$room['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content panel">
{if isset($room['selected_demands']) && $room['selected_demands']}
<div id="room_type_demands_desc_{$room['id']}" class="tab-pane active">
<div id="room_type_demands_desc">
{if isset($room['selected_demands']) && $room['selected_demands']}
{assign var=roomCount value=1}
{foreach $room['selected_demands'] as $demand}
<div class="row room_demands_container">
<div class="col-sm-12 room_demand_detail">
{if isset($room['selected_demands']) && $room['selected_demands']}
{foreach $room['extra_demands'] as $idGlobalDemand => $roomDemand}
{if $demand.id_global_demand == $idGlobalDemand}
<div class="row room_demand_block">
<div class="col-xs-6">
<div class="row">
<div class="col-xs-10 demand_adv_option_block">
<p>
{$roomDemand['name']|escape:'html':'UTF-8'}<br>
{if isset($roomDemand['adv_option']) && $roomDemand['adv_option']}
{$roomDemand['adv_option'][$demand['id_option']]['name']}
{/if}
</p>
</div>
</div>
</div>
<div class="col-xs-6">
<p><span class="pull-right extra_demand_option_price">{if isset($roomDemand['adv_option']) && $roomDemand['adv_option']}{convertPrice price = $roomDemand['adv_option'][$idGlobalDemand]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $roomDemand['price']|escape:'html':'UTF-8'}{/if}</span></p>
</div>
</div>
{/if}
{/foreach}
{/if}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
{/if}
</div>
</div>
{/if}
{if isset($room['selected_services']) && $room['selected_services']}
<div id="room_type_service_product_desc_{$room['id']}" class="tab-pane{if !isset($room['selected_demands']) || !$room['selected_demands']} active{/if}">
<div id="room_type_services_desc">
{assign var=roomCount value=1}
<div class="row room_demands_container">
<div class="col-sm-12 room_demand_detail">
{if isset($room['selected_services']) && $room['selected_services']}
{foreach $room['selected_services'] as $service}
<div class="row room_demand_block">
<div class="col-xs-5">
<div class="row">
<div class="col-xs-10">
<p>{$service['name']|escape:'html':'UTF-8'}</p>
{if $service.allow_multiple_quantity}
<div class="qty_container">
{l s='Quantity:'} {$service.quantity}
</div>
{/if}
</div>
</div>
</div>
<div class="col-xs-3">
{if $service['auto_add_to_cart'] && $service['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $service['auto_add_to_cart'] && $service['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</div>
<div class="col-xs-4">
<span class="pull-right">{convertPrice price=$service.total_price}</span>
</div>
</div>
{/foreach}
{/if}
</div>
</div>
</div>
</div>
{/if}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{l s='Close'}</button>
</div>
</div>
</div>
</div>
{/foreach}
</tbody>
<tfoot>
<tr>
<td colspan="3">{l s='Total cost of room types:'}</td>
<td colspan="7">{l s='Total cost of room types:'}</td>
<td class="text-right">{displayWtPriceWithCurrency price=$total_products currency=$currency}</td>
</tr>
{if $total_discounts != 0}
<tr>
<td colspan="3">{l s='Total value of vouchers:'}</td>
<td colspan="7">{l s='Total value of vouchers:'}</td>
<td class="text-right">{displayWtPriceWithCurrency price=$total_discounts currency=$currency}</td>
</tr>
{/if}
{if $total_wrapping > 0}
<tr>
<td colspan="3">{l s='Total cost of gift wrapping:'}</td>
<td colspan="7">{l s='Total cost of gift wrapping:'}</td>
<td class="text-right">{displayWtPriceWithCurrency price=$total_wrapping currency=$currency}</td>
</tr>
{/if}
{if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0}
<tr>
<td colspan="3">{l s='Total cost of shipping:'}</td>
<td colspan="7">{l s='Total cost of shipping:'}</td>
<td class="text-right">{displayWtPriceWithCurrency price=$total_shipping currency=$currency}</td>
</tr>
{/if}
<tr>
<td colspan="3" class=" success"><strong>{l s='Total:'}</strong></td>
<td colspan="7" class=" success"><strong>{l s='Total:'}</strong></td>
<td class="text-right success"><strong>{displayWtPriceWithCurrency price=$total_price currency=$currency}</strong></td>
</tr>
</tfoot>

View File

@@ -469,15 +469,6 @@ $(document).ready(function () {
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="sp_from_quantity">{l s='Starting at'}</label>
<div class="col-lg-4">
<div class="input-group">
<span class="input-group-addon">{l s='unit'}</span>
<input type="text" name="sp_from_quantity" id="sp_from_quantity" value="1" />
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="sp_price">{l s='product price'}
{if $country_display_tax_label}

View File

@@ -70,7 +70,7 @@
<select class="id_option">
{foreach $demand['adv_option'] as $idOption => $option}
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
<option optionPrice="{$option['price']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
<option optionPrice="{$option['price_tax_excl']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
{if isset($roomDemand['extra_demands'][$demand_key])}
{assign var=selected_adv_option value="$idOption"}
{/if}
@@ -83,7 +83,14 @@
</div>
</div>
<div class="col-xs-6">
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
<p class="pull-right">
<span class="extra_demand_option_price">
{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price_tax_excl'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price_tax_excl']|escape:'html':'UTF-8'}{else if isset($demand['adv_option']) && $demand['adv_option']}{convertPrice price = $demand['adv_option'][$demand['adv_option']|@key]['price_tax_excl']}{else}{convertPrice price = $demand['price_tax_excl']|escape:'html':'UTF-8'}{/if}
</span>
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
{l s='/ night'}
{/if}
</p>
</div>
</div>
{/foreach}
@@ -103,57 +110,54 @@
</div>
<div id="room_type_services_desc">
{assign var=roomCount value=1}
{foreach $selectedRoomServiceProduct as $cartRoom}
<div class="row room_demands_container">
<div class="col-sm-12 demand_header">
<span>
<i class="icon-bed"></i>
{if isset($cartRoom['room_num']) && $cartRoom['room_num']}
{l s='Room'} {$cartRoom['room_num']|escape:'html':'UTF-8'}
{else}
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}
{/if}
</span>
</div>
<div class="col-sm-12 room_demand_detail">
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
{foreach $roomTypeServiceProducts as $product}
<div class="row room_demand_block">
<div class="col-xs-5">
<div class="row">
<div class="col-xs-2">
<input data-id_cart_booking="{$cartRoom['htl_cart_booking_id']}" value="{$product['id_product']|escape:'html':'UTF-8'}" type="checkbox" class="change_room_type_service_product" {if isset($cartRoom['selected_products']) && $cartRoom['selected_products'] && ($product['id_product']|in_array:$cartRoom['selected_products'])}checked{/if}/>
</div>
<div class="col-xs-10">
<p>{$product['name']|escape:'html':'UTF-8'}</p>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="number" class="form-control room_type_service_product_qty qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" min="1" value="{if isset($cartRoom['selected_products']) && $cartRoom['selected_products'] && ($product['id_product']|in_array:$cartRoom['selected_products'])}{$cartRoom['selected_products_info'][$product['id_product']]['quantity']}{else}1{/if}">
</div>
{/if}
</div>
<div class="row room_demands_container">
<div class="col-sm-12 demand_header">
<span>
<i class="icon-bed"></i>
{if isset($selectedRoomServiceProduct['room_num']) && $selectedRoomServiceProduct['room_num']}
{l s='Room'} {$selectedRoomServiceProduct['room_num']|escape:'html':'UTF-8'}
{else}
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}
{/if}
</span>
</div>
<div class="col-sm-12 room_demand_detail">
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
{foreach $roomTypeServiceProducts as $product}
<div class="row room_demand_block">
<div class="col-xs-5">
<div class="row">
<div class="col-xs-2">
<input data-id_cart_booking="{$selectedRoomServiceProduct['id']}" value="{$product['id_product']|escape:'html':'UTF-8'}" type="checkbox" class="change_room_type_service_product" {if isset($selectedRoomServiceProduct['selected_service']) && $selectedRoomServiceProduct['selected_service'] && ($product['id_product']|array_key_exists:$selectedRoomServiceProduct['selected_service'])}checked{/if}/>
</div>
<div class="col-xs-10">
<p>{$product['name']|escape:'html':'UTF-8'}</p>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="number" class="form-control room_type_service_product_qty qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" min="1" value="{if isset($selectedRoomServiceProduct['selected_service']) && $selectedRoomServiceProduct['selected_service'] && ($product['id_product']|array_key_exists:$selectedRoomServiceProduct['selected_service'])}{$selectedRoomServiceProduct['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
</div>
{/if}
</div>
</div>
<div class="col-xs-3">
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</div>
<div class="col-xs-4">
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
<span class="pull-right">{convertPrice price=$product.price_tax_exc}</span>
{/if}
</div>
</div>
{/foreach}
{/if}
</div>
<div class="col-xs-3">
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</div>
<div class="col-xs-4">
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
<span class="pull-right">{convertPrice price=$product.price_tax_exc}</span>
{/if}
</div>
</div>
{/foreach}
{/if}
</div>
{assign var=roomCount value=1}
{/foreach}
</div>
</div>
</div>
{/if}

View File

@@ -132,9 +132,9 @@
{displayPrice price=$data.amt_with_qty}</td> *}
<td class="cart_line_total_price">
{if (isset($data.extra_demands) && $data.extra_demands) || (isset($data.additional_service) && $data.additional_service)}
{displayPrice price=($data.feature_price_tax_excl + $data.additional_services_auto_add_price + $data.demand_price + $data.additional_service_price)|escape:'html':'UTF-8'}
{displayPrice price=($data.amt_with_qty + $data.additional_services_auto_add_price + $data.demand_price + $data.additional_service_price)|escape:'html':'UTF-8'}
{else}
{displayPrice price=$data.feature_price_tax_excl|escape:'html':'UTF-8'}
{displayPrice price=$data.amt_with_qty|escape:'html':'UTF-8'}
{/if}
</td>
<td>

View File

@@ -182,12 +182,14 @@
<td class="text-center">
<span class="extra_service_show">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{if ($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) > 0}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{/if}
</span>
<span class="extra_service_edit" style="display: none;">
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
</a>
</span>

View File

@@ -22,12 +22,8 @@
<span aria-hidden="true">&times;</span>
</button>
<ul class="nav nav-tabs" role="tablist">
{if (isset($extraDemands) && $extraDemands) || (isset($roomTypeDemands) && $roomTypeDemands)}
<li role="presentation" class="active"><a href="#room_type_demands_desc" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if (isset($additionalServices) && $additionalServices) || (isset($roomTypeServiceProducts) && $roomTypeServiceProducts)}
<li role="presentation" {if !(isset($extraDemands) && $extraDemands) && !(isset($roomTypeDemands) && $roomTypeDemands)}class="active"{/if}><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
{/if}
<li role="presentation" class="active"><a href="#room_type_demands_desc" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
<li role="presentation"><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
</ul>
</div>
<div class="modal-body" id="rooms_extra_demands">
@@ -36,11 +32,6 @@
{include file='controllers/orders/_room_services_block.tpl'}
</div>
</div>
<div class="modal-footer">
{* <button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">{l s='Close'}</button> *}
</div>
{* Css for handling extra demands changes *}
<style type="text/css">
@@ -49,10 +40,6 @@
padding-bottom: 0px;}
#rooms_type_extra_demands .modal-title {
margin: 0px;}
#rooms_type_extra_demands .demand_edit_badge {
font-size: 14px;}
#rooms_extra_demands .room_ordered_demands td, #rooms_extra_demands .room_demand_detail {
font-size: 14px;}
#rooms_extra_demands .demand_header {
padding: 10px;
color: #333;

View File

@@ -17,91 +17,138 @@
* @license https://store.webkul.com/license.html
*}
{if (isset($extraDemands) && $extraDemands) || (isset($roomTypeDemands) && $roomTypeDemands)}
<div id="room_type_demands_desc" class="tab-pane active">
<input type="hidden" value="{$id_booking_detail}" id="id_htl_booking">
{if isset($orderEdit) && $orderEdit}
<p class="col-sm-12 facility_nav_btn">
<button id="btn_new_room_demand" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new facility'}</button>
<button id="back_to_demands_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
</p>
<div id="room_type_demands_desc" class="tab-pane active">
<input type="hidden" value="{$id_booking_detail}" id="id_htl_booking">
{if isset($orderEdit) && $orderEdit}
<p class="col-sm-12 facility_nav_btn">
<button id="btn_new_room_demand" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new facility'}</button>
<button id="back_to_demands_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
</p>
{* Already selected room demands *}
<div class="col-sm-12 room_ordered_demands table-responsive">
<table class="table">
<tbody>
{if isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
{foreach $roomDemand['extra_demands'] as $demand}
<tr>
<td>{$demand['name']}</td>
<td>{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</td>
<td><a class="btn btn-danger pull-right del-order-room-demand" href="#" id_booking_demand="{$demand['id_booking_demand']}"><i class="icon-trash"></i></a></td>
</tr>
{/foreach}
{* Already selected room demands *}
<div class="col-sm-12 room_ordered_demands table-responsive">
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th>{l s='Unit price'}</th>
<th>{l s='Total price'}</th>
<th class="text-right">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{if isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
{foreach $roomDemand['extra_demands'] as $demand}
<tr>
<td>{$demand['name']}</td>
<td>
{displayPrice price=$demand['unit_price_tax_excl'] currency=$orderCurrency}
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
{l s='/ night'}
{/if}
</td>
<td>{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
<td><a class="btn btn-danger pull-right del-order-room-demand" href="#" id_booking_demand="{$demand['id_booking_demand']}"><i class="icon-trash"></i></a></td>
</tr>
{/foreach}
{else}
{/foreach}
{else}
<tr>
<td colspan="3">
<i class="icon-warning"></i> {l s='No facilities added yet.'}
</td>
</tr>
{/if}
</tbody>
</table>
</div>
{* Room demands available for the current editing room*}
<div class="col-sm-12 room_demands_container">
<div class="room_demand_detail">
{if isset($roomTypeDemands) && $roomTypeDemands}
<table class="table">
<thead>
<tr>
<td colspan="3">
<i class="icon-warning"></i> {l s='No facilities added yet.'}
</td>
<th></th>
<th>{l s='Name'}</th>
<th>{l s='Option'}</th>
<th class="text-right">{l s='Price'}</th>
</tr>
{/if}
</thead>
<tbody>
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
<tr class="room_demand_block">
<td>
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
</td>
<td>
{$demand['name']|escape:'html':'UTF-8'}
</td>
<td class="demand_adv_option_block">
{if isset($demand['adv_option']) && $demand['adv_option']}
<select class="id_option">
{foreach $demand['adv_option'] as $idOption => $option}
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
<option optionPrice="{$option['price_tax_excl']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
{if isset($roomDemand['extra_demands'][$demand_key])}
{assign var=selected_adv_option value="$idOption"}
{/if}
{/foreach}
</select>
{else}
{l s='--'}
<input type="hidden" class="id_option" value="0" />
{/if}
</td>
<td class="text-right">
<span class="extra_demand_option_price">
{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price_tax_excl'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price_tax_excl']|escape:'html':'UTF-8'}{else if isset($demand['adv_option']) && $demand['adv_option']}{convertPrice price = $demand['adv_option'][$demand['adv_option']|@key]['price_tax_excl']}{else}{convertPrice price = $demand['price_tax_excl']|escape:'html':'UTF-8'}{/if}
</span>
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
{l s='/ night'}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<i class="icon-warning"></i> {l s='No facilities available for this room.'}
{/if}
</div>
<button type="button" id="save_room_demands" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
</div>
{elseif isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
<div class="row room_demand_detail">
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th>{l s='Unit price'}</th>
<th class="text-right">{l s='Total price'}</th>
</tr>
</thead>
<tbody>
{foreach $roomDemand['extra_demands'] as $demand}
<tr class="room_demand_block">
<td>{$demand['name']}</td>
<td>
{displayPrice price=$demand['unit_price_tax_excl'] currency=$orderCurrency}
{if $demand['price_calc_method'] == HotelRoomTypeGlobalDemand::WK_PRICE_CALC_METHOD_EACH_DAY}
{l s='night'}
{/if}
</td>
<td class="text-right">{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{* Room demands available for the current editing room*}
<div class="col-sm-12 room_demands_container">
<div class="room_demand_detail">
{if isset($roomTypeDemands) && $roomTypeDemands}
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
<div class="row room_demand_block">
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
</div>
<div class="col-xs-10 demand_adv_option_block">
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
{if isset($demand['adv_option']) && $demand['adv_option']}
<select class="id_option">
{foreach $demand['adv_option'] as $idOption => $option}
{assign var=demand_key value="`$idGlobalDemand`-`$idOption`"}
<option optionPrice="{$option['price']|escape:'html':'UTF-8'}" value="{$idOption|escape:'html':'UTF-8'}" {if isset($roomDemand['extra_demands'][$demand_key])}selected{/if} key="{$demand_key}">{$option['name']}</option>
{if isset($roomDemand['extra_demands'][$demand_key])}
{assign var=selected_adv_option value="$idOption"}
{/if}
{/foreach}
</select>
{else}
<input type="hidden" class="id_option" value="0" />
{/if}
</div>
</div>
</div>
<div class="col-xs-6">
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
</div>
</div>
{/foreach}
{/if}
</div>
<button type="button" id="save_room_demands" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
</div>
{elseif isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
<div class="row room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="col-sm-12 room_demand_block">
<p>
<span>{$demand['name']}</span>
<span class="pull-right">{displayPrice price=$demand['total_price_tax_incl'] currency=$orderCurrency}</span>
</p>
</div>
{/foreach}
</div>
{/foreach}
{/if}
</div>
{/if}
{/foreach}
{else}
{l s='No facilities selected!'}
{/if}
</div>

View File

@@ -17,114 +17,151 @@
* @license https://store.webkul.com/license.html
*}
{if (isset($additionalServices) && $additionalServices) || (isset($roomTypeServiceProducts) && $roomTypeServiceProducts)}
<div id="room_type_service_product_desc" class="tab-pane{if !(isset($extraDemands) && $extraDemands) && !(isset($roomTypeDemands) && $roomTypeDemands)} active{/if}">
{if isset($orderEdit) && $orderEdit}
<div id="room_type_service_product_desc" class="tab-pane {if isset($show_active) && $show_active}active{/if}">
{if isset($orderEdit) && $orderEdit}
<p class="col-sm-12 facility_nav_btn">
<button id="btn_new_room_service" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new service'}</button>
<button id="back_to_service_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
</p>
<p class="col-sm-12 facility_nav_btn">
<button id="btn_new_room_service" class="btn btn-success"><i class="icon-plus"></i> {l s='Add new service'}</button>
<button id="back_to_service_btn" class="btn btn-default"><i class="icon-arrow-left"></i> {l s='Back'}</button>
</p>
{* Already selected room services *}
<div class="col-sm-12 room_ordered_services table-responsive">
<table class="table">
<tbody>
{if isset($additionalServices) && $additionalServices}
{foreach $additionalServices['additional_services'] as $service}
<tr class="room_demand_block">
<td>
<div>{$service['name']|escape:'html':'UTF-8'}</div>
{if $service['allow_multiple_quantity']}
<div class="qty_container">
<input type="number" class="form-control qty" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
</div>
{/if}
</td>
<td>
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</td>
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
<td><a class="btn btn-danger pull-right del_room_additional_service" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" href="#"><i class="icon-trash"></i></a></td>
</tr>
{/foreach}
{else}
<tr>
<td colspan="3">
<i class="icon-warning"></i> {l s='No services added yet.'}
{* Already selected room services *}
<div class="col-sm-12 room_ordered_services table-responsive">
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th></th>
<th class="fixed-width-md">{l s='Quantity'}</th>
<th>{l s='Price'}</th>
<th class="text-right">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{if isset($additionalServices) && $additionalServices}
{foreach $additionalServices['additional_services'] as $service}
<tr class="room_demand_block">
<td>
<div>{$service['name']|escape:'html':'UTF-8'}</div>
</td>
</tr>
{/if}
</tbody>
</table>
</div>
<form id="add_room_services_form" class="col-sm-12 room_services_container">
<div class="room_demand_detail">
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
{foreach $roomTypeServiceProducts as $product}
<div class="row room_demand_block">
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<input data-id_booking_detail="{$id_booking_detail}" value="{$product['id_product']|escape:'html':'UTF-8'}" name="selected_service[]" type="checkbox" class="id_room_type_service"/>
</div>
<div class="col-xs-10">
<p>{$product['name']|escape:'html':'UTF-8'}</p>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="number" class="form-control qty" id="qty_{$product['id_product']|escape:'html':'UTF-8'}" name="service_qty[{$product['id_product']|escape:'html':'UTF-8'}]" data-id-product="{$product.id_product|escape:'html':'UTF-8'}" value="1">
</div>
{/if}
</div>
</div>
</div>
<div class="col-xs-6">
<p>
<span class="pull-right">{convertPrice price=$product.price_tax_incl}</span>
</p>
</div>
</div>
{/foreach}
{else}
<i class="icon-warning"></i> {l s='No services available to select, All services already added.'}
{/if}
</div>
<input type="hidden" name="id_booking_detail" value="{$id_booking_detail}">
<button type="submit" id="save_service_service" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
</form>
{elseif isset($additionalServices) && $additionalServices}
<div class="row room_demand_detail">
{foreach $additionalServices['additional_services'] as $service}
<div class="col-sm-12 room_demand_block">
<div class="row">
<div class="col-xs-8">
<span class="pull-right">
<td class="text-center">
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span><br>
{/if}
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
</td>
<td>
{if $service['allow_multiple_quantity']}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
</div>
{else}
--
{/if}
</span>
<div>{$service['name']|escape:'html':'UTF-8'}</div>
{if $service['allow_multiple_quantity']}
<div class="quantity">{l s='Qty:'}&nbsp;{$service['quantity']|escape:'html':'UTF-8'}</div>
{/if}
</div>
<div class="col-xs-4">
<span class="pull-right">{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}</span>
</div>
</div>
</div>
{/foreach}
</td>
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
<td><a class="btn btn-danger pull-right del_room_additional_service" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" href="#"><i class="icon-trash"></i></a></td>
</tr>
{/foreach}
{else}
<tr>
<td colspan="3">
<i class="icon-warning"></i> {l s='No services added yet.'}
</td>
</tr>
{/if}
</tbody>
</table>
</div>
<form id="add_room_services_form" class="col-sm-12 room_services_container">
<div class="room_demand_detail">
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
<table class="table">
<thead>
<tr>
<th></th>
<th>{l s='Name'}</th>
<th></th>
<th class="fixed-width-md">{l s='Quantity'}</th>
<th class="text-right">{l s='Price'}</th>
</tr>
</thead>
<tbody>
{foreach $roomTypeServiceProducts as $product}
<tr class="room_demand_block">
<td>
<input data-id_booking_detail="{$id_booking_detail}" value="{$product['id_product']|escape:'html':'UTF-8'}" name="selected_service[]" type="checkbox" class="id_room_type_service"/>
</td>
<td>
{$product['name']|escape:'html':'UTF-8'}
</td>
<td class="text-center">
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span><br>
{/if}
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
</td>
<td>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" id="qty_{$product['id_product']|escape:'html':'UTF-8'}" name="service_qty[{$product['id_product']|escape:'html':'UTF-8'}]" data-id-product="{$product.id_product|escape:'html':'UTF-8'}" value="1">
</div>
{else}
{l s='--'}
{/if}
</td>
<td class="text-right">
{convertPrice price=$product.price_tax_exc}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<i class="icon-warning"></i> {l s='No services available to add to this room.'}
{/if}
</div>
{/if}
</div>
{/if}
<input type="hidden" name="id_booking_detail" value="{$id_booking_detail}">
<button type="submit" id="save_service_service" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
</form>
{elseif isset($additionalServices) && $additionalServices}
<table class="table room_demand_detail">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
<th></th>
<th class="text-right">{l s='Total Price'}</th>
</tr>
</thead>
</tbody>
{foreach $additionalServices['additional_services'] as $service}
<tr class="room_demand_block">
<td>
{$service['id_product']|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&amp;id_product={$service['id_product']|escape:'html':'UTF-8'}&amp;updateproduct"><i class="icon-external-link-sign"></i></a>
</td>
<td>{$service['name']|escape:'html':'UTF-8'}</td>
<td class="text-center">
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</td>
<td class="text-right">
{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='No services selected!'}
{/if}
</div>

View File

@@ -925,24 +925,6 @@
}
}
// commented by webkul to enable button in case of ordering virtual product
function checkVirtualProduct(products, delivery_option_list) {
if (delivery_option_list.length == 0 && products.length > 0) {
var find = 1;
$.each(products, function () {
if (find == 1) {
this.is_virtual == 1 ? find = 1 : find = 0;
}
});
if (find == 1) {
$("button[name=\"submitAddOrder\"]").removeAttr("disabled");
}
else {
$("button[name=\"submitAddOrder\"]").attr("disabled", "disabled");
}
}
}
function searchProducts()
{
$('#products_part').show();
@@ -1157,7 +1139,6 @@
}
updateDeliveryOptionList(jsonSummary.delivery_option_list);
checkVirtualProduct(jsonSummary.summary.products,jsonSummary.delivery_option_list);
if (jsonSummary.cart.gift == 1) {
$('#order_gift').attr('checked', true);
@@ -1544,37 +1525,39 @@
extra_demand_price = formatCurrency(extra_demand_price, currency_format, currency_sign, currency_blank);
$(this).closest('.room_demand_block').find('.extra_demand_option_price').text(extra_demand_price);
var roomDemands = [];
// get the selected extra demands by customer
$(this).closest('.room_demand_detail').find('input:checkbox.id_room_type_demand:checked').each(function () {
roomDemands.push({
'id_global_demand':$(this).val(),
'id_option': $(this).closest('.room_demand_block').find('.id_option').val()
if ($(this).closest('.room_demand_block').find('input:checkbox.id_room_type_demand').is(':checked')) {
// get the selected extra demands by customer
$(this).closest('.room_demand_detail').find('input:checkbox.id_room_type_demand:checked').each(function () {
roomDemands.push({
'id_global_demand':$(this).val(),
'id_option': $(this).closest('.room_demand_block').find('.id_option').val()
});
});
});
var idBookingCart = $(this).closest('.room_demand_block').find('.id_room_type_demand').attr('id_cart_booking');
$.ajax({
type: 'POST',
dataType: 'JSON',
headers: {
"cache-control": "no-cache"
},
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
dataType: 'JSON',
cache: false,
data: {
id_cart_booking: idBookingCart,
room_demands: JSON.stringify(roomDemands),
action: 'changeRoomDemands',
ajax: true
},
success: function(response) {
if (response.status) {
showSuccessMessage(txtExtraDemandSucc);
} else {
showErrorMessage(txtExtraDemandErr);
var idBookingCart = $(this).closest('.room_demand_block').find('.id_room_type_demand').attr('id_cart_booking');
$.ajax({
type: 'POST',
dataType: 'JSON',
headers: {
"cache-control": "no-cache"
},
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
dataType: 'JSON',
cache: false,
data: {
id_cart_booking: idBookingCart,
room_demands: JSON.stringify(roomDemands),
action: 'changeRoomDemands',
ajax: true
},
success: function(response) {
if (response.status) {
showSuccessMessage(txtExtraDemandSucc);
} else {
showErrorMessage(txtExtraDemandErr);
}
}
}
});
});
}
});
$(document).on('click', '.change_room_type_service_product', function() {

View File

@@ -1067,7 +1067,9 @@
<thead>
<tr>
<th class="text-left">{l s='Refund ID'}</th>
<th class="text-center">{l s='Total Rooms'}</th>
<th class="text-left">{l s='Status'}</th>
<th class="text-center">{l s='Requested Date'}</th>
</tr>
</thead>
<tbody>
@@ -1076,6 +1078,9 @@
<td class="text-left">
<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$return_info.id_order_return}" target="_blank">#{$return_info.id_order_return}</a>
</td>
<td class="text-center">
{$return_info.total_rooms|escape:'html':'UTF-8'}
</td>
<td class="text-left">
{capture name=refund_status}
{if isset($return_info.payment_mode) && $return_info.payment_mode != ''}{l s='Payment Mode: '}{$return_info.payment_mode}<br/>{/if}
@@ -1110,12 +1115,39 @@
{$return_info.state_name}
{/if}
</td>
<td class="text-center">
{$return_info.date_add}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
<div class="panel">
<div class="panel-heading">
<i class="icon-list"></i> {l s='Cancellation Policies'}
</div>
{if is_array($applicable_refund_policies) && count($applicable_refund_policies)}
<ul>
{foreach from=$applicable_refund_policies item=$applicable_refund_policy}
<li>
<p>
<a href="{$link->getAdminLink('AdminOrderRefundRules')|escape:'html':'UTF-8'}&id_refund_rule={$applicable_refund_policy.id_refund_rule}&updatehtl_order_refund_rules" target="_blank">
{$applicable_refund_policy.name|escape:'html':'UTF-8'}
<i class="icon-external-link"></i>
</a>
</p>
</li>
{/foreach}
</ul>
{else}
<p>
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No cancellation policies applicable.'}
</p>
{/if}
</div>
{hook h="displayAdminOrderRight" id_order=$order->id}
</div>
</div>
@@ -1719,15 +1751,22 @@
$('#room_extra_demand_content #back_to_service_btn').hide();
});
$(document).on('focusout', '#rooms_type_extra_demands .qty', function(e) {
$(document).on('focusout', '#rooms_type_extra_demands .room_ordered_services .qty', function(e) {
var qty_wntd = $(this).val();
if (qty_wntd == '' || !$.isNumeric(qty_wntd)) {
if (qty_wntd == '' || !$.isNumeric(qty_wntd) || qty_wntd < 1) {
$(this).val(1);
}
updateServiceProducts($(this));
updateAdditionalServices($(this));
});
function updateServiceProducts(element)
$(document).on('focusout', '#rooms_type_extra_demands #add_room_services_form .qty', function(e) {
var qty_wntd = $(this).val();
if (qty_wntd == '' || !$.isNumeric(qty_wntd) || qty_wntd < 1) {
$(this).val(1);
}
});
function updateAdditionalServices(element)
{
var id_room_type_service_product_order_detail = $(element).data('id_room_type_service_product_order_detail');
var qty = $(element).val();
@@ -1748,6 +1787,9 @@
},
success: function(jsonData) {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
}
showSuccessMessage(txtExtraDemandSucc);
} else {
showErrorMessage(jsonData.errors);
@@ -1894,12 +1936,14 @@
},
success: function(jsonData) {
if (!jsonData.hasError) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
showSuccessMessage(txtExtraDemandSucc);
} else {
showErrorMessage(jsonData.errors);
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
}
showSuccessMessage(txtExtraDemandSucc);
} else {
showErrorMessage(jsonData.errors);
}
}
}
});
} else {

View File

@@ -0,0 +1,37 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}
{l s='This room already has bookings for highlighted date range(s):'}
<table width="70%">
<tr>
<th class="text-center">{l s='Order ID'}</th>
<th class="text-center">{l s='Date From'}</th>
<th class="text-center">{l s='Date To'}</th>
</tr>
{foreach from=$booked_rows_list item=booked_row}
<tr>
<td class="text-center">
<a href="{$link->getAdminLink('AdminOrders')}&id_order={$booked_row->id_order}&vieworder" target="_blank"><strong>#{$booked_row->id_order|intval}</strong></a>
</td>
<td class="text-center">{dateFormat date=$booked_row->date_from}</td>
<td class="text-center">{dateFormat date=$booked_row->date_to}</td>
</tr>
{/foreach}
</table>

View File

@@ -95,7 +95,7 @@
<input type="text" class="form-control room_comment" value="{$room_info['comment']}" name="{$var_name_room_info|cat:'[comment]'}">
</td>
<td class="col-sm-2 center">
<a class="btn btn-default deactiveDatesModal {if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }disabled{/if}" data-toggle="modal" data-target="#deactiveDatesModal">{if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }{l s='Add Dates'}{else}{l s='View Dates'}{/if}
<a class="btn btn-default deactiveDatesModal {if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }disabled{/if}" data-toggle="modal" data-target="#deactiveDatesModal" data-id-room="{$room_info['id']}">{if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }{l s='Add Dates'}{else}{l s='View Dates'}{/if}
</a>
<input type="hidden" class="form-control disable_dates_json" name="{$var_name_room_info|cat:'[disable_dates_json]'}" {if $room_info['id_status'] == $rm_status['STATUS_TEMPORARY_INACTIVE']['id']}value="{$room_info['disable_dates_json']|escape:'html':'UTF-8'}"{/if}>
</td>
@@ -184,6 +184,7 @@
<h4 class="modal-title"><i class="icon-calendar"></i>&nbsp; {l s='Disable Dates'}</h4>
</div>
<div class="modal-body">
<div class="text-left errors-wrap" style="display: none;"></div>
<div class="alert alert-info">
<p>{l s='Please note that the date chosen for field \'Date To\' is not considered as a blocking date.'}</p>
</div>
@@ -239,13 +240,13 @@
var prod_link = "{$link->getAdminLink('AdminProducts')}";
var rm_status = {$rm_status|@json_encode};
var currentRoomRow = 0;
var datesMissing = "{$datesMissing}";
var datesOverlapping = "{$datesOverlapping}";
$(document).ready(function() {
const DisableDatesModal = {
init: function() {
this.addNewRow();
DisableDatesModal.addNewRow();
DisableDatesModal.hideErrors();
DisableDatesModal.removeAllInvalidRowDataMarkers();
},
addNewRow: function() {
$('#deactiveDatesModal tbody').append(this.disableDatesRowHtml);
@@ -260,33 +261,58 @@
$(dateRangeRow).find('.room_disable_reason').val(dateRange.reason);
});
},
getValidationErrors: function() {
let $return = false;
validateDisableDates: function(cb) {
DisableDatesModal.hideErrors();
DisableDatesModal.removeAllInvalidRowDataMarkers();
DisableDatesModal.disableRowDeleteActionButtons();
let idRoom = parseInt($('#deactiveDatesModal .room-disable-dates').attr('data-id-room'));
idRoom = idRoom == isNaN(idRoom) ? 0 : idRoom;
const disableDates = Array();
$('#deactiveDatesModal .room-disable-dates tbody tr').each(function(i, tr) {
const dateFrom = $(tr).find('.disabled_date_from').val().trim();
const dateTo = $(tr).find('.disabled_date_to').val().trim();
if (!dateFrom.length || !dateTo.length) {
$return = datesMissing;
}
disableDates.push({ dateFrom, dateTo });
const date_from = $(tr).find('.disabled_date_from').val().trim();
const date_to = $(tr).find('.disabled_date_to').val().trim();
disableDates.push({ date_from, date_to });
});
$.each(disableDates, function(keyOuter, dateRangeOuter) {
$.each(disableDates, function(keyInner, dateRangeInner) {
if (keyInner != keyOuter) {
if ((dateRangeOuter.dateFrom <= dateRangeInner.dateTo)
&& (dateRangeInner.dateFrom <= dateRangeOuter.dateTo)
) {
$return = datesOverlapping;
$.ajax({
url: prod_link,
type: 'POST',
data: {
ajax: true,
action: 'validateDisableDates',
id_room: idRoom,
disable_dates: disableDates,
},
dataType: 'JSON',
success: function(response) {
if (response.status) {
if (typeof cb === 'function') {
cb();
}
} else {
DisableDatesModal.showErrors(response.errors);
DisableDatesModal.addInvalidRowDataMarkers(response.rows_to_highlight);
}
});
},
complete: function () {
DisableDatesModal.enableRowDeleteActionButtons();
}
});
},
showErrors: function(errors) {
$('#deactiveDatesModal .errors-wrap').html(errors);
$('#deactiveDatesModal .errors-wrap').show();
},
hideErrors: function() {
$('#deactiveDatesModal .errors-wrap').hide();
$('#deactiveDatesModal .errors-wrap').html('');
},
addInvalidRowDataMarkers: function(rowsToHighlight) {
rowsToHighlight.map(function (rowIndex) {
const tr = $('#deactiveDatesModal .room-disable-dates tbody tr').eq(rowIndex);
DisableDatesModal.markRowDataInvalid(tr);
});
return $return;
},
getDisableDatesInfo: function() {
const disableDates = Array();
@@ -300,6 +326,24 @@
return disableDates;
},
disableRowDeleteActionButtons: function() {
const disableDates = Array();
$('#deactiveDatesModal .room-disable-dates .remove-disable-dates-button').addClass('disabled');
},
enableRowDeleteActionButtons: function() {
const disableDates = Array();
$('#deactiveDatesModal .room-disable-dates .remove-disable-dates-button').removeClass('disabled');
},
markRowDataInvalid: function(tr) {
$(tr).css({ 'outline': '1px solid #D27C82', 'border-radius': '2px' });
},
removeAllInvalidRowDataMarkers: function(tr) {
$('#deactiveDatesModal .room-disable-dates tr').css('outline', '');
$(tr).css('outline', '');
},
removeRowDataMark: function(tr) {
$(tr).css('outline', '');
},
disableDatesRowHtml: `
<tr class="disabledDatesTr">
<td class="col-sm-2 center">
@@ -322,8 +366,10 @@
$('#deactiveDatesModal').on('show.bs.modal', function(e) {
const triggerRoomRow = $(e.relatedTarget);
const roomRowIndex = parseInt($(triggerRoomRow).closest('tr').attr('data-row-index'));
const idRoom = parseInt($(triggerRoomRow).attr('data-id-room'));
$('#deactiveDatesModal table.room-disable-dates tbody').html('');
$('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index', roomRowIndex);
$('#deactiveDatesModal table.room-disable-dates').attr('data-id-room', idRoom);
let disableDates = $(triggerRoomRow).closest('tr').find('.disable_dates_json').val();
if (!disableDates) {
DisableDatesModal.init();
@@ -331,22 +377,27 @@
}
disableDates = JSON.parse(disableDates);
DisableDatesModal.hideErrors();
DisableDatesModal.populateWithDatesInfo(disableDates);
});
// copy json formatted dates to room
$(document).on('click', '.deactiveDatesModalSubmit', function() {
const error = DisableDatesModal.getValidationErrors();
if (error) {
alert(error);
return;
}
// Disable dates data filling when model open
$('#deactiveDatesModal').on('hide.bs.modal', function(e) {
const disableDates = DisableDatesModal.getDisableDatesInfo();
const roomRowIndex = parseInt($('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index'));
const roomRow = $('#product-configuration .hotel-room tr.room_data_values[data-row-index='+roomRowIndex+']');
$(roomRow).find('.disable_dates_json').val(JSON.stringify(disableDates));
$('#deactiveDatesModal').modal('hide');
});
// copy json formatted dates to room
$(document).on('click', '.deactiveDatesModalSubmit', function() {
DisableDatesModal.validateDisableDates(function () {
const disableDates = DisableDatesModal.getDisableDatesInfo();
const roomRowIndex = parseInt($('#deactiveDatesModal table.room-disable-dates').attr('data-room-row-index'));
const roomRow = $('#product-configuration .hotel-room tr.room_data_values[data-row-index='+roomRowIndex+']');
$(roomRow).find('.disable_dates_json').val(JSON.stringify(disableDates));
$('#deactiveDatesModal').modal('hide');
});
});
// Add new room detail
@@ -456,7 +507,7 @@
onClose: function(selectedDate) {
var dateTo = $(this).closest('tr').find('.disabled_date_to').val();
if (!dateTo || (dateTo && selectedDate >= dateTo)) {
$('.disabled_date_to').datepicker('show');
$(this).closest('tr').find('.disabled_date_to').datepicker('show');
}
},
});

View File

@@ -8,21 +8,21 @@
<thead>
<tr class="nodrag nodrop">
<th class="col-sm-1">
<span>{l s='Id Product'}</span>
<span>{l s='Id Service'}</span>
</th>
<th class="col-sm-3">
<span>{l s='name'}</span>
<span>{l s='Name'}</span>
</th>
<th class="">
<span>{l s='Category'}</span>
<th>
<span>{l s='Auto add to cart'}</span>
</th>
<th>
<span>{l s='Position'}</span>
</th>
<th class="">
<th>
<span>{l s='Price'}</span>
</th>
<th class="">
<th>
<span>{l s='Tax'}</span>
</th>
<th class="text-right">
@@ -35,8 +35,8 @@
{foreach from=$service_products key=key item=service_product}
<tr id='room_type_service_product_{$service_product.id_room_type_service_product|escape:'html':'UTF-8'}' position='{$service_product.position|escape:'html':'UTF-8'}' id_product='{$service_product.id_product|escape:'html':'UTF-8'}' id_element="{$product->id}" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}">
<td class="col-sm-1">{$service_product.id_product|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&amp;id_product={$service_product.id_product|escape:'html':'UTF-8'}&amp;updateproduct"><i class="icon-external-link-sign"></i></a></td>
<td class="">{$service_product.name}</td>
<td class="">{$service_product.category}</td>
<td>{$service_product.name}</td>
<td><span {if $service_product.auto_add_to_cart}class="badge badge-success"{/if}>{if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if}</span></td>
<td class="pointer dragHandle center positionImage">
<div class="dragGroup">
<div class="positions">
@@ -44,7 +44,7 @@
</div>
</div>
</td>
<td class="">
<td>
<span class="field-view service-product-price-text">{if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$id_currency}{else}{displayPrice price=$service_product.default_price currency=$id_currency}{/if}</span>
<div class="field-edit" style="display:none">
<div class="input-group">

View File

@@ -568,10 +568,6 @@ class CartCore extends ObjectModel
$sql->where('cp.`id_product` = '.(int)$id_product);
}
$sql->where('p.`id_product` IS NOT NULL');
// hide invisible products
// if ($front) {
// $sql->where('p.`is_invisible` = 0');
// }
// Build ORDER BY
$sql->orderBy('cp.`date_add`, cp.`id_product`, cp.`id_product_attribute` ASC');
@@ -792,8 +788,9 @@ class CartCore extends ObjectModel
}
} else if (Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $row['service_product_type']) {
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
$totalPriceByProductTaxIncl = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, 1, true, null);
$totalPriceByProductTaxExcl = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, 1, false, null);
$totalPriceByProductTaxIncl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, true, null);
$totalPriceByProductTaxExcl = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart($this->id, (int)$row['id_product'], 0, 0, 0, 0, 0, false, null);
switch (Configuration::get('PS_ROUND_TYPE')) {
case Order::ROUND_TOTAL:
@@ -1795,7 +1792,7 @@ class CartCore extends ObjectModel
} else if (!$product['booking_product'] && Product::SERVICE_PRODUCT_WITH_ROOMTYPE == $product['service_product_type']) {
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
$totalPriceByProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$totalPriceByProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
$this->id,
(int)$product['id_product'],
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
@@ -1803,7 +1800,6 @@ class CartCore extends ObjectModel
0,
0,
0,
1,
$with_taxes,
null
);
@@ -1991,7 +1987,9 @@ class CartCore extends ObjectModel
}
}
}
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount;
if ($type != Cart::ADVANCE_PAYMENT) {
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount;
}
if ($type == Cart::ADVANCE_PAYMENT) {
// get order total without discount
$total_without_discount = $this->getOrderTotal() + $order_total_discount;

View File

@@ -1039,18 +1039,19 @@ abstract class PaymentModuleCore extends Module
$normal_products_data_html = $this->getEmailTemplateContent('hotel-service-product-data.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
$normal_products_data_txt = $this->getEmailTemplateContent('hotel-service-product-data-text.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
// total room price
$room_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, true);
$room_price_tax_incl = $order->getTotalProductsWithTaxes(false, true);
$room_tax = ($order->getTotalProductsWithTaxes(false, true) - $order->getTotalProductsWithoutTaxes(false, true));
$room_price_tax_excl += $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
$room_price_tax_incl += $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
$service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE));
// extra services
$additional_service_price_tax_excl = ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']);
$additional_service_price_tax_incl = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']);
$additional_service_tax = (($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']) - ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']));
// convenience fee price
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$room_price_tax_incl -= $total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1060,9 +1061,10 @@ abstract class PaymentModuleCore extends Module
0,
1,
1,
1
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$room_price_tax_excl -= $total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1072,8 +1074,18 @@ abstract class PaymentModuleCore extends Module
0,
1,
0,
1
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$additional_service_price_tax_excl = $additional_service_price_tax_excl - $total_convenience_fee_te;
$additional_service_price_tax_incl = $additional_service_price_tax_incl - $total_convenience_fee_ti;
$room_price_tax_excl = $room_price_tax_excl + $additional_service_price_tax_excl;
$room_price_tax_incl = $room_price_tax_incl + $additional_service_price_tax_incl;
// service products
// $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
// $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
// $service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE));
$data = array(
'{cart_booking_data_html}' => $cart_booking_data_html,
@@ -1114,6 +1126,7 @@ abstract class PaymentModuleCore extends Module
'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
'{delivery_other}' => $delivery->other,
'{invoice_company}' => $invoice->company,
'{invoice_vat_number}' => $invoice->vat_number,
'{invoice_firstname}' => $invoice->firstname,
'{invoice_lastname}' => $invoice->lastname,
'{invoice_address2}' => $invoice->address2,
@@ -1143,9 +1156,9 @@ abstract class PaymentModuleCore extends Module
'{room_price_tax_excl}' => Tools::displayPrice($room_price_tax_excl, $this->context->currency, false),
'{room_price_tax_incl}' => Tools::displayPrice($room_price_tax_incl, $this->context->currency, false),
'{room_tax}' => Tools::displayPrice($room_tax, $this->context->currency, false),
'{service_products_price_tax_excl}' => Tools::displayPrice($service_products_price_tax_excl, $this->context->currency, false),
'{service_products_price_tax_incl}' => Tools::displayPrice($service_products_price_tax_incl, $this->context->currency, false),
'{service_products_tax}' => Tools::displayPrice($service_products_tax, $this->context->currency, false),
// '{service_products_price_tax_excl}' => Tools::displayPrice($service_products_price_tax_excl, $this->context->currency, false),
// '{service_products_price_tax_incl}' => Tools::displayPrice($service_products_price_tax_incl, $this->context->currency, false),
// '{service_products_tax}' => Tools::displayPrice($service_products_tax, $this->context->currency, false),
'{additional_service_price_tax_excl}' => Tools::displayPrice($additional_service_price_tax_excl, $this->context->currency, false),
'{additional_service_price_tax_incl}' => Tools::displayPrice($additional_service_price_tax_incl, $this->context->currency, false),
'{additional_service_tax}' => Tools::displayPrice($additional_service_tax, $this->context->currency, false),

View File

@@ -243,7 +243,6 @@ class ProductCore extends ObjectModel
public $cache_has_attachments;
public $is_virtual;
public $booking_product;
public $is_invisible;
public $id_pack_product_attribute;
public $cache_default_attribute;
@@ -300,7 +299,6 @@ class ProductCore extends ObjectModel
'cache_has_attachments' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'is_virtual' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'booking_product' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'is_invisible' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'service_product_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
/* Shop fields */
@@ -996,7 +994,7 @@ class ProductCore extends ObjectModel
public function deleteServiceInfo()
{
if (!RoomTypeServiceProduct::deleteRoomProductLink($this->id)
||RoomTypeServiceProductPrice::deleteRoomProductPrices($this->id)
|| !RoomTypeServiceProductPrice::deleteRoomProductPrices($this->id)
) {
return false;
}
@@ -1343,7 +1341,6 @@ class ProductCore extends ObjectModel
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
.($front ? ' AND product_shop.`show_at_front` = 1':'')
.(!is_null($auto_add_to_cart) ? ' AND product_shop.`auto_add_to_cart` = '.$auto_add_to_cart:'')
.($front ? ' AND p.`is_invisible` = 0':'')
.($available_for_order != 2 ? ' AND p.`available_for_order` = '.(int)$available_for_order:'')
.($active ? ' AND product_shop.`active` = 1' : '');
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
@@ -1388,7 +1385,6 @@ class ProductCore extends ObjectModel
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
.($front ? ' AND product_shop.`show_at_front` = 1':'')
.(!is_null($auto_add_to_cart) ? ' AND product_shop.`auto_add_to_cart` = '.$auto_add_to_cart:'')
.($front ? ' AND p.`is_invisible` = 0':'')
.($available_for_order != 2 ? ' AND p.`available_for_order` = '.(int)$available_for_order:'')
.($active ? ' AND product_shop.`active` = 1' : '');
@@ -1433,7 +1429,6 @@ class ProductCore extends ObjectModel
AND p.`service_product_type` = '.(int)self::SERVICE_PRODUCT_WITH_ROOMTYPE. '
AND product_shop.`id_shop` = '.(int)$context->shop->id
.($front ? ' AND product_shop.`auto_add_to_cart` = 0 AND product_shop.`show_at_front` = 1':'')
.($front ? ' AND p.`is_invisible` = 0':'')
.($active ? ' AND product_shop.`active` = 1' : '');
@@ -3045,14 +3040,27 @@ class ProductCore extends ObjectModel
$id_state = 0;
$zipcode = 0;
if ($id_address) {
if (!$id_address) {
if (!Product::isBookingProduct($id_product)) {
if ($id_roomtype) {
// if room type is provided with product then we know that the service product price should be calculated accroding to roomt type
$id_address = Cart::getIdAddressForTaxCalculation($id_roomtype);
}
} else {
$id_address = Cart::getIdAddressForTaxCalculation($id_product);
}
}
if (!$id_address) {
if ($primaryHotel = ConfigurationCore::get('WK_PRIMARY_HOTEL')) {
if ($address = HotelBranchInformation::getAddress($primaryHotel)) {
$address_infos['id_country'] = $address['id_country'];
$address_infos['id_state'] = $address['id_state'];
$address_infos['postcode'] = $address['postcode'];
}
}
} elseif ($id_address) {
$address_infos = Address::getCountryAndState($id_address);
} else {
// if ($id_roomtype) {
// $address_infos = Address::getCountryAndState(Cart::getIdAddressForTaxCalculation($id_roomtype));
// } else {
$address_infos = Address::getCountryAndState(Cart::getIdAddressForTaxCalculation($id_product));
// }
}
if (isset($address_infos['id_country']) && $address_infos['id_country']) {

View File

@@ -145,8 +145,7 @@ class SpecificPriceCore extends ObjectModel
FROM `'._DB_PREFIX_.'specific_price`
WHERE 1 '.self::filterOutField('id_product', $id_product).
($id_product_attribute ? ' AND id_product_attribute = '.(int) $id_product_attribute : '').'
AND id_cart = '.(int) $id_cart.'
GROUP BY `id_specific_price_rule`'
AND id_cart = '.(int) $id_cart
);
}

View File

@@ -242,15 +242,20 @@ class OrderReturnCore extends ObjectModel
if (!$context) {
$context = Context::getContext();
}
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_slip` ors
ON (ors.`id_order_slip` = orr.`id_return_type` AND orr.`return_type` = '.(int) self::RETURN_TYPE_ORDER_SLIP.')
WHERE orr.`id_customer` = '.(int)$customer_id.
($only_customer ? ' AND orr.`by_admin` = 0' : '').
($order_id ? ' AND orr.`id_order` = '.(int)$order_id : '').
($no_denied ? ' AND orr.`state` != 4' : '').'
ORDER BY orr.`date_add` DESC';
$sql = 'SELECT orr.`id_order`, orr.`state`, orr.`id_order_return`, orr.`payment_mode`, orr.`id_transaction`,
orr.`id_return_type`, orr.`return_type`, ors.`id_cart_rule`, orr.`date_add`, orr.`date_upd`,
COUNT(ord.`id_order_return_detail`) AS total_rooms
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord
ON (ord.`id_order_return` = orr.`id_order_return`)
LEFT JOIN `'._DB_PREFIX_.'order_slip` ors
ON (ors.`id_order_slip` = orr.`id_return_type` AND orr.`return_type` = '.(int) self::RETURN_TYPE_ORDER_SLIP.')
WHERE orr.`id_customer` = '.(int)$customer_id.
($only_customer ? ' AND orr.`by_admin` = 0' : '').
($order_id ? ' AND orr.`id_order` = '.(int)$order_id : '').
($no_denied ? ' AND orr.`state` != 4' : '').'
GROUP BY orr.`id_order_return`
ORDER BY orr.`date_add` DESC';
$data = Db::getInstance()->executeS($sql);
foreach ($data as $k => $or) {
$state = new OrderReturnState($or['state']);

View File

@@ -36,7 +36,7 @@ class AdminAddressesControllerCore extends AdminController
{
$this->bootstrap = true;
$this->required_database = true;
$this->required_fields = array('company', 'address2', 'postcode', 'other', 'phone', 'phone_mobile', 'dni');
$this->required_fields = array('company', 'address2', 'postcode', 'other', 'phone', 'phone_mobile', 'vat_number', 'dni');
$this->table = 'address';
$this->className = 'Address';
$this->lang = false;
@@ -217,6 +217,13 @@ class AdminAddressesControllerCore extends AdminController
'col' => '4',
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
);
$temp_fields[] = array(
'type' => 'text',
'label' => $this->l('VAT number'),
'col' => '2',
'name' => 'vat_number',
'required' => in_array('vat_number', $required_fields)
);
} elseif ($addr_field_item == 'lastname') {
if (isset($customer) &&
!Tools::isSubmit('submit'.strtoupper($this->table)) &&

View File

@@ -135,6 +135,7 @@ class AdminCartsControllerCore extends AdminController
$smartyVars['type'] = 'non_orderd';
}
}
$smartyVars['link'] = $this->context->link;
$tpl = $this->createTemplate('_orders.tpl');
$tpl->assign($smartyVars);
@@ -270,7 +271,9 @@ class AdminCartsControllerCore extends AdminController
$product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int)$id_shop);
$image_product = new Image($image['id_image']);
if (isset($image['id_image'])) {
$image_product = new Image($image['id_image']);
}
$product['image'] = (isset($image['id_image']) ? ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$image_product->getExistingImgPath().'.jpg', 'product_mini_'.(int)$product['id_product'].(isset($product['id_product_attribute']) ? '_'.(int)$product['id_product_attribute'] : '').'.jpg', 45, 'jpg') : '--');
}
@@ -283,34 +286,18 @@ class AdminCartsControllerCore extends AdminController
$helper->value = Tools::displayPrice($total_price, $currency);
$kpi = $helper->generate();
// by webkul to show rooms available in the cart
$cart_id = $cart->id;
$cart_detail_data = array();
$cart_detail_data_obj = new HotelCartBookingData();
$cart_detail_data = $cart_detail_data_obj->getCartCurrentDataByCartId((int) $cart_id);
if ($cart_detail_data) {
foreach ($cart_detail_data as $key => $value) {
$product_image_id = Product::getCover($value['id_product']);
$obj_product = new Product((int) $value['id_product'], Configuration::get('PS_LANG_DEFAULT'));
$link_rewrite = $obj_product->link_rewrite[Configuration::get('PS_LANG_DEFAULT')];
if ($product_image_id) {
$cart_detail_data[$key]['image_link'] = $this->context->link->getImageLink($link_rewrite, $product_image_id['id_image'], 'small_default');
} else {
$cart_detail_data[$key]['image_link'] = $this->context->link->getImageLink($link_rewrite, $this->context->language->iso_code."-default", 'small_default');
}
$cart_detail_data[$key]['room_type'] = $obj_product->name;
$obj_room_info = new HotelRoomInformation((int) $value['id_room']);
$cart_detail_data[$key]['room_num'] = $obj_room_info->room_num;
$obj_date_time_from = new DateTime($value['date_from']);
$cart_detail_data[$key]['date_from'] = $obj_date_time_from->format('d-M Y');
$obj_date_time_to = new DateTime($value['date_to']);
$cart_detail_data[$key]['date_to'] = $obj_date_time_to->format('d-M Y');
$cartHtlData = array();
$objHotelCartBookingData = new HotelCartBookingData();
$objHotelRoomType = new HotelRoomType();
$cartHtlData = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart((int) $cart->id);
if ($cartHtlData) {
foreach ($cartHtlData as $key => $value) {
$cartHtlData[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']);
}
}
//end
$this->tpl_view_vars = array(
'cart_detail_data' => $cart_detail_data,//by webkul hotel rooms in order data
'cart_htl_data' => $cartHtlData,//by webkul hotel rooms in order data
'kpi' => $kpi,
'products' => $products,
'discounts' => $cart->getCartRules(),
@@ -1067,6 +1054,27 @@ class AdminCartsControllerCore extends AdminController
$this->context->smarty->assign('selectedRoomDemands', $selectedRoomDemands);
}
}
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null);
if ($selectedRoomServiceProduct = $objCartBookingData->getRoomRowByIdProductIdRoomInDateRange(
$idCart,
$idProduct,
$dateFrom,
$dateTo,
$idRoom
)) {
$selectedRoomServiceProduct['selected_service'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
$selectedRoomServiceProduct['id'],
0,
null,
null
);
}
$this->context->smarty->assign(array(
'roomTypeServiceProducts' => $roomTypeServiceProducts,
'selectedRoomServiceProduct' => $selectedRoomServiceProduct
));
$htlCartBoookingata = $objCartBookingData->getRoomRowByIdProductIdRoomInDateRange(
$idCart,
$idProduct,
@@ -1074,35 +1082,6 @@ class AdminCartsControllerCore extends AdminController
$dateTo,
$idRoom
);
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
if ($selectedRoomServiceProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$idCart,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
$htlCartBoookingata['id'],
0,
null,
null
)) {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null);
foreach ($selectedRoomServiceProduct as $key => $selectedProducts) {
$objRoom = new HotelRoomInformation($selectedProducts['id_room']);
$selectedRoomServiceProduct[$key]['room_num'] = $objRoom->room_num;
foreach ($selectedProducts['selected_products_info'] as $product) {
$selectedRoomServiceProduct[$key]['selected_products'][] = $product['id_product'];
}
}
$this->context->smarty->assign(array(
'roomTypeServiceProducts' => $roomTypeServiceProducts,
'selectedRoomServiceProduct' => $selectedRoomServiceProduct
));
}
}
}
$response['status'] = true;

View File

@@ -90,7 +90,7 @@ class AdminNormalProductsControllerCore extends AdminController
parent::__construct();
$this->imageType = 'jpg';
$this->_defaultOrderBy = 'position';
$this->_defaultOrderBy = 'id_product';
$this->max_file_size = (int)(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000);
$this->max_image_size = (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE');
$this->allow_export = true;
@@ -99,7 +99,7 @@ class AdminNormalProductsControllerCore extends AdminController
$this->available_tabs_lang = array(
'Informations' => $this->l('Information'),
'Prices' => $this->l('Prices'),
'Seo' => $this->l('SEO'),
// 'Seo' => $this->l('SEO'),
'Images' => $this->l('Images'),
'Associations' => $this->l('Associations'),
);
@@ -108,7 +108,7 @@ class AdminNormalProductsControllerCore extends AdminController
$this->available_tabs = array_merge($this->available_tabs, array(
'Informations' => 0,
'Prices' => 1,
'Seo' => 2,
// 'Seo' => 2,
'Associations' => 3,
'Images' => 4,
));
@@ -948,7 +948,7 @@ class AdminNormalProductsControllerCore extends AdminController
$id_groups = Tools::getValue('spm_id_group');
$id_customers = Tools::getValue('spm_id_customer');
$prices = Tools::getValue('spm_price');
$from_quantities = Tools::getValue('spm_from_quantity');
$from_quantities = 1;
$reductions = Tools::getValue('spm_reduction');
$reduction_types = Tools::getValue('spm_reduction_type');
$froms = Tools::getValue('spm_from');
@@ -1939,7 +1939,7 @@ class AdminNormalProductsControllerCore extends AdminController
if ($this->isTabSubmitted('Prices')) {
// $this->processAdvancedPayment();
$this->processPriceAddition();
// $this->processSpecificPricePriorities();
$this->processSpecificPricePriorities();
}
if ($this->isTabSubmitted('Images')) {
$this->processImageLegends();
@@ -2016,6 +2016,20 @@ class AdminNormalProductsControllerCore extends AdminController
$default_language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$languages = Language::getLanguages(false);
// we have removed seo tab as it is currently not required, but in product object requires link_rewrite
// so adding link_rewrite in $_POST
if (Configuration::get('PS_FORCE_FRIENDLY_PRODUCT') || !Validate::isLoadedObject($this->object)) {
foreach ($languages as $lang) {
$_POST['link_rewrite_'.$lang['id_lang']] = Tools::link_rewrite(Tools::getValue('name_'.$lang['id_lang']));
}
} else {
foreach ($languages as $lang) {
$_POST['link_rewrite_'.$lang['id_lang']] = $this->object->link_rewrite[$lang['id_lang']];
}
}
// end
// Check required fields
foreach ($rules['required'] as $field) {
if (!$this->isProductFieldUpdated($field)) {
@@ -2855,13 +2869,12 @@ class AdminNormalProductsControllerCore extends AdminController
$tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories');
$tree->setTemplate('tree_associated_categories.tpl')
->setHeaderTemplate('tree_associated_header.tpl')
->setRootCategory((int)Configuration::get('PS_PRODUCTS_CATEGORY'))
->setRootCategory((int)Configuration::get('PS_SERVICE_CATEGORY'))
->setUseCheckBox(true)
->setUseSearch(false)
->setFullTree(0)
->setSelectedCategories($categories)
->setUseBulkActions(false);
// ->setDisablAllCategories(true);
$data->assign(array('default_category' => $default_category,
'selected_cat_ids' => implode(',', array_keys($selected_cat)),

View File

@@ -1667,9 +1667,13 @@ class AdminOrdersControllerCore extends AdminController
// hotel booking statuses
$htlOrderStatus = HotelBookingDetail::getAllHotelOrderStatus();
// applicable refund policies
$applicableRefundPolicies = HotelOrderRefundRules::getApplicableRefundRules($order->id);
$this->tpl_view_vars = array(
// refund info
'refund_allowed' => (int) $order->isReturnable(),
'applicable_refund_policies' => $applicableRefundPolicies,
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
'refundReqBookings' => $refundReqBookings,
'hasCompletelyRefunded' => $order->hasCompletelyRefunded(),
@@ -4209,6 +4213,8 @@ class AdminOrdersControllerCore extends AdminController
}
$product_informations = Tools::getValue('edit_product');
$old_date_from = date('Y-m-d', strtotime(trim(Tools::getValue('date_from'))));
$old_date_to = date('Y-m-d', strtotime(trim(Tools::getValue('date_to'))));
$new_date_from = trim(date('Y-m-d', strtotime($product_informations['date_from'])));
$new_date_to = trim(date('Y-m-d', strtotime($product_informations['date_to'])));
$obj_booking_detail = new HotelBookingDetail();
@@ -4624,6 +4630,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars = array();
$objOrder = new Order($idOrder);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(
@@ -4677,7 +4684,7 @@ class AdminOrdersControllerCore extends AdminController
// get room type additional demands
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct)) {
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
@@ -4687,7 +4694,6 @@ class AdminOrdersControllerCore extends AdminController
}
}
$this->context->smarty->assign($smartyVars);
}
$extraDemandsTpl = $this->context->smarty->fetch(
@@ -4721,7 +4727,7 @@ class AdminOrdersControllerCore extends AdminController
// get room type additional demands
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct)) {
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
@@ -4730,13 +4736,13 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['roomTypeServiceProducts'] = $roomTypeServiceProducts;
}
}
$smartyVars['show_active'] = true;
$this->context->smarty->assign($smartyVars);
$servicesTpl = $this->context->smarty->fetch(
_PS_ADMIN_DIR_.'/themes/default/template/controllers/orders/_room_services_block.tpl'
);
return $servicesTpl;
}
public function processRenderFacilitiesBlock($idOrder, $idProduct, $dateFrom, $dateTo, $idRoom, $orderEdit)
@@ -4839,6 +4845,15 @@ class AdminOrdersControllerCore extends AdminController
$response['hasError'] = true;
$response['errors'] = $this->l('cannot order multiple quanitity for this service');
}
$objHotelBookingDetail = new HotelBookingDetail($objRoomTypeServiceProductOrderDetail->id_htl_booking_detail);
$response['service_panel']= $servicesBlock = $this->processRenderServicesPanel(
$objOrderDetail->id_order,
$objHotelBookingDetail->id_product,
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room,
true
);
} else {
$response['hasError'] = true;
$response['errors'] = $this->l('Additional service not found');

View File

@@ -2081,7 +2081,6 @@ class AdminProductsControllerCore extends AdminController
}
}
// shreesh check if product is virtual, then set categories according to hotel
// if (Tools::getValue('is_virtual')) {
$id_hotel = Tools::getValue('id_hotel');
if (!$id_hotel || !Validate::isUnsignedInt($id_hotel)) {
@@ -2779,8 +2778,6 @@ class AdminProductsControllerCore extends AdminController
'product' => $obj,
'htl_info' => $hotelInfo,
'rm_status' => $roomStatus,
'datesMissing' => $this->l('Some dates are missing. Please select all the date ranges.'),
'datesOverlapping' => $this->l('Some dates are conflicting with each other. Please check and reselect the date ranges.'),
)
);
} else {
@@ -2846,6 +2843,7 @@ class AdminProductsControllerCore extends AdminController
);
$serviceProduct['id_product'] = $product->id;
$serviceProduct['name'] = $product->name;
$serviceProduct['auto_add_to_cart'] = $product->auto_add_to_cart;
$serviceProduct['category'] = $product->category;
$serviceProduct['default_price'] = $product->price;
$serviceProduct['id_tax_rules_group'] = $product->id_tax_rules_group;
@@ -2874,7 +2872,6 @@ class AdminProductsControllerCore extends AdminController
$serviceProduct['default_tax_rules_group_name'] = $objTaxRuleGroup->name;
}
}
$data->assign(array(
'product' => $obj,
'currency' => $this->context->currency,
@@ -3118,7 +3115,7 @@ class AdminProductsControllerCore extends AdminController
}
}
public function validateDisableDateRanges($disableDates, $index)
public function validateDisableDateRanges($disableDates, $index, $idRoom)
{
if (count($disableDates)) {
foreach ($disableDates as $disable_key => $disableDate) {
@@ -3135,6 +3132,7 @@ class AdminProductsControllerCore extends AdminController
$index
);
} else {
$objHotelBookingDetail = new HotelBookingDetail();
foreach ($disableDates as $key => $disDate) {
if ($key != $disable_key) {
if ((($disableDate['date_from'] < $disDate['date_from']) && ($disableDate['date_to'] <= $disDate['date_from'])) || (($disableDate['date_from'] > $disDate['date_from']) && ($disableDate['date_from'] >= $disDate['date_to']))) {
@@ -3146,6 +3144,13 @@ class AdminProductsControllerCore extends AdminController
);
}
}
// check if room has booking for current date range
if ($objHotelBookingDetail->chechRoomBooked($idRoom, $disDate['date_from'], $disDate['date_to'])) {
$this->errors[] = sprintf(
Tools::displayError('The %s room already has bookings for selected disable dates. Please reselect disable dates.'),
$index
);
}
}
}
}
@@ -3243,7 +3248,7 @@ class AdminProductsControllerCore extends AdminController
if ($roomInfo['id_status'] == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE) {
$disableDates = json_decode($roomInfo['disable_dates_json'], true);
if ($roomInfo['disable_dates_json'] !== 0) {
$this->validateDisableDateRanges($disableDates, $index);
$this->validateDisableDateRanges($disableDates, $index, $roomInfo['id']);
}
}
}
@@ -4632,6 +4637,79 @@ class AdminProductsControllerCore extends AdminController
die(json_encode($response));
}
public function ajaxProcessValidateDisableDates()
{
$response = array('status' => false);
$idRoom = (int) Tools::getValue('id_room');
$disableDates = Tools::getValue('disable_dates');
$rowsToHighlight = array();
$bookedRows = array();
if (is_array($disableDates) && count($disableDates)) {
foreach ($disableDates as $key => $dateRange) {
if (!Validate::isDate($dateRange['date_from']) || !Validate::isDate($dateRange['date_to'])) {
$this->errors[] = $this->l('Some dates are missing. Please select all the date ranges.');
$rowsToHighlight[] = $key;
}
}
if (!count($this->errors)) {
foreach ($disableDates as $keyOuter => $dateRangeOuter) {
foreach ($disableDates as $keyInner => $dateRangeInner) {
if ($keyInner != $keyOuter) {
if ((($dateRangeOuter['date_from'] >= $dateRangeInner['date_from']) && ($dateRangeOuter['date_from'] < $dateRangeInner['date_to']))
|| (($dateRangeInner['date_from'] >= $dateRangeOuter['date_from']) && ($dateRangeInner['date_from'] < $dateRangeOuter['date_to']))
) {
$this->errors[] = $this->l('Some dates are conflicting with each other. Please check and reselect the date ranges.');
$rowsToHighlight[] = $keyOuter;
$rowsToHighlight[] = $keyInner;
}
}
}
}
}
if (!count($this->errors)) {
if ($idRoom) {
$objHotelBookingDetail = new HotelBookingDetail();
foreach ($disableDates as $key => $dateRange) {
if ($bookingRow = $objHotelBookingDetail->chechRoomBooked($idRoom, $dateRange['date_from'], $dateRange['date_to'])) {
$bookedRows[] = new HotelBookingDetail($bookingRow['id']);
$rowsToHighlight[] = $key;
}
}
}
}
}
if (count($bookedRows)) {
$this->context->smarty->assign(array(
'link' => $this->context->link,
'booked_rows_list' => $bookedRows,
));
$this->errors[] = $this->context->smarty->fetch('controllers/products/booked_room_date_ranges_list.tpl');
}
$this->errors = array_unique($this->errors);
$rowsToHighlight = array_values(array_unique($rowsToHighlight));
if (!count($this->errors)) {
$response['status'] = true;
} else {
$this->context->smarty->assign(array(
'errors' => $this->errors,
));
$response['errors'] = $this->context->smarty->fetch('alerts.tpl');
$response['rows_to_highlight'] = $rowsToHighlight;
$response['status'] = false;
}
$this->ajaxDie(json_encode($response));
}
public function processImageLegends()
{
if (Tools::getValue('key_tab') == 'Images' && Tools::getValue('submitAddproductAndStay') == 'update_legends' && Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))) {
@@ -4663,4 +4741,4 @@ class AdminProductsControllerCore extends AdminController
return $tpl->fetch();
}
}
}

View File

@@ -1797,4 +1797,240 @@ class AdminStatsControllerCore extends AdminStatsTabController
return $countGrossOpProfitPars ? $sumGrossOpProfitPars / $countGrossOpProfitPars : 0;
}
public static function getRoomNightsData($dateFrom, $dateTo = null, $idHotel = null, $useCache = true, $average = false)
{
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;
$idsHotel = array();
if (is_int($idHotel)) {
$idsHotel[] = $idHotel;
} else {
$idsHotel = $idHotel;
}
// collect data
$hotelsData = array();
foreach ($idsHotel as $idHotel) {
$hotelsData[$idHotel] = self::getOccupiedRoomsForDiscreteDates(
$dateFrom,
$dateTo,
$idHotel,
$useCache
);
}
// calculate sums
$result = array();
foreach ($hotelsData as $hotelData) {
foreach ($hotelData as $timestamp => $value) {
if (!array_key_exists($timestamp, $result)) {
$result[$timestamp] = $value;
} else {
$result[$timestamp] += $value;
}
}
}
// calculate averages
if ($average) {
$totalHotels = count($idsHotel);
if ($totalHotels > 1) {
foreach ($result as $timestamp => &$value) {
$value = $value / $totalHotels;
}
}
}
return $result;
}
/**
* $dow: day of week, 1 = SUN
*/
public static function getOccupiedRoomsForDayOfTheWeek($dow, $dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
{
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;
$result = 0;
$cacheKey = 'AdminStats::getOccupiedRoomsForDayOfTheWeek'.'_'.(int) $dow.(int) strtotime($dateFrom).
(int) strtotime($dateTo).(!is_array($idHotel) ? (int) $idHotel : implode('_', $idHotel));
if (!Cache::isStored($cacheKey) || !$useCache) {
// (los/7) + {if(los%7 has $dow) + 1 else + 0)}
// dow(start_of(remaining_days)) = dow_date_from && dow(end_of(remaining_days)) = dow_date_to
$sql = 'SELECT SUM((full_weeks + IF(('.(int) $dow.' >= dow_date_from AND '.(int) $dow.' < dow_date_to), 1, 0)))
AS total_occupied
FROM (
SELECT hbd.`id`, hbd.`date_from`, hbd.`date_to`, DAYOFWEEK(hbd.`date_from`) AS dow_date_from,
DAYOFWEEK(hbd.`date_to`) AS dow_date_to,
DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los,
ROUND(DATEDIFF(hbd.`date_to`, hbd.`date_from`) / 7) AS full_weeks,
DATEDIFF(hbd.`date_to`, hbd.`date_from`) % 7 AS remaining_days
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($dateTo).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateFrom).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
) AS t';
$value = (int) Db::getInstance()->getValue($sql);
Cache::store($cacheKey, $value);
$result = Cache::retrieve($cacheKey);
}
return $result;
}
public static function getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo = null, $idHotel = null, $useCache = true, $average = false)
{
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;
$idsHotel = array();
if (is_int($idHotel)) {
$idsHotel[] = $idHotel;
} else {
$idsHotel = $idHotel;
}
// collect data
$hotelsData = array();
foreach ($idsHotel as $idHotel) {
$hotelsData[$idHotel] = array();
// 1 = SUN
for ($i = 1; $i <= 7; $i++) {
$hotelsData[$idHotel][$i] = self::getOccupiedRoomsForDayOfTheWeek(
$i,
$dateFrom,
$dateTo,
$idHotel,
$useCache
);
}
}
// calculate sums
$result = array();
foreach ($hotelsData as $hotelData) {
foreach ($hotelData as $dayOfWeek => $value) {
if (!array_key_exists($dayOfWeek, $result)) {
$result[$dayOfWeek] = $value;
} else {
$result[$dayOfWeek] += $value;
}
}
}
// calculate averages
if ($average) {
$totalHotels = count($idsHotel);
if ($totalHotels > 1) {
foreach ($result as $timestamp => &$value) {
$value = $value / $totalHotels;
}
}
}
return $result;
}
public static function getLengthOfStayRatio($losMinimum, $dateFrom, $dateTo, $idHotel = null, $useCache = true, $losMaximum = false)
{
$result = 0;
$cacheKey = 'AdminStats::getLengthOfStayRatio'.'_'.(int) $losMinimum.(int) $losMaximum.
(int) strtotime($dateFrom).(int) strtotime($dateTo).(!is_array($idHotel) ? (int) $idHotel : implode('_', $idHotel));
if (!Cache::isStored($cacheKey) || !$useCache) {
if ($dateFrom == $dateTo) {
$dateTo = date('Y-m-d', strtotime('+1 day', strtotime($dateTo)));
}
$sql = 'SELECT COUNT(hbd.`id`) AS total
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hbd.`id_product`)
WHERE p.`active` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($dateTo).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateFrom).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
$total = Db::getInstance()->getValue($sql);
$sql = 'SELECT COUNT(los)
FROM (
SELECT DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'product` p
ON (p.`id_product` = hbd.`id_product`)
WHERE p.`active` = 1
AND hbd.`is_refunded` = 0
AND hbd.`date_from` < "'.pSQL($dateTo).' 00:00:00" AND hbd.`date_to` > "'.pSQL($dateFrom).' 00:00:00"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
) AS t
WHERE los >= '.(int) $losMinimum.' AND los <= '.(int) ($losMaximum ? $losMaximum : $losMinimum);
$fraction = Db::getInstance()->getValue($sql);
$ratio = array('fraction' => $fraction, 'total' => $total);
Cache::store($cacheKey, $ratio);
$result = Cache::retrieve($cacheKey);
}
return $result;
}
public static function getLengthOfStayPercentages($days, $dateFrom, $dateTo, $idHotel = null, $useCache = true, $average = false)
{
$idsHotel = array();
if (is_int($idHotel)) {
$idsHotel[] = $idHotel;
} else {
$idsHotel = $idHotel;
}
// collect data
$hotelsData = array();
foreach ($idsHotel as $idHotel) {
$hotelsData[$idHotel] = array();
foreach ($days as $key => $day) {
$hotelsData[$idHotel][$key] = self::getLengthOfStayRatio(
$day[0],
$dateFrom,
$dateTo,
$idHotel,
$useCache,
$day[1]
);
}
}
// calculate sums
$result = array();
foreach ($hotelsData as $hotelData) {
foreach ($days as $key => $day) {
if (!array_key_exists($key, $result)) {
$result[$key]['fraction'] = $hotelData[$key]['fraction'];
$result[$key]['total'] = $hotelData[$key]['total'];
} else {
$result[$key]['fraction'] += $hotelData[$key]['fraction'];
$result[$key]['total'] += $hotelData[$key]['total'];
}
}
}
// calculate averages
if ($average) {
$totalHotels = count($idsHotel);
if ($totalHotels > 1) {
foreach ($result as $key => $ratio) {
$result[$key] = $ratio['total'] ? ($ratio['fraction'] / $ratio['total']) : 0;
}
}
} else {
foreach ($result as $key => $ratio) {
$result[$key] = $ratio['total'] ? ($ratio['fraction'] / $ratio['total']) : 0;
}
}
return $result;
}
}

View File

@@ -2109,6 +2109,7 @@ class AdminThemesControllerCore extends AdminController
'dashgoals',
'dashproducts',
'dashtrends',
'dashinsights',
'dateofdelivery',
'editorial',
'favoriteproducts',

View File

@@ -45,6 +45,7 @@ class AddressControllerCore extends FrontController
{
parent::setMedia();
$this->addJS(array(
_THEME_JS_DIR_.'tools/vatManagement.js',
_THEME_JS_DIR_.'tools/statesManagement.js',
_PS_JS_DIR_.'validate.js'
));

View File

@@ -47,6 +47,7 @@ class AuthControllerCore extends FrontController
$this->confirmations = array();
$this->informations = array();
$this->errors = array();
$this->ajaxExtraData = array();
if (!Tools::getIsset('step') && $this->context->customer->isLogged() && !$this->ajax) {
Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : 'my-account'));

View File

@@ -455,7 +455,6 @@ class OrderOpcControllerCore extends ParentOrderController
$this->context->smarty->assign('checkout_process_steps', $this->checkoutProcess->getSteps());
// @todo shreesh get this checked with sumit sir
// set room type demands
// $objGlobalDemand = new HotelRoomTypeGlobalDemand();
// $allDemands = $objGlobalDemand->getAllDemands();
@@ -669,6 +668,7 @@ class OrderOpcControllerCore extends ParentOrderController
'invoice_company' => Tools::htmlentitiesUTF8($address_invoice->company),
'invoice_lastname' => Tools::htmlentitiesUTF8($address_invoice->lastname),
'invoice_firstname' => Tools::htmlentitiesUTF8($address_invoice->firstname),
'invoice_vat_number' => Tools::htmlentitiesUTF8($address_invoice->vat_number),
'invoice_dni' => Tools::htmlentitiesUTF8($address_invoice->dni),
'invoice_address' => $this->context->cart->id_address_invoice !== $this->context->cart->id_address_delivery,
'invoice_address1' => Tools::htmlentitiesUTF8($address_invoice->address1),
@@ -988,31 +988,21 @@ class OrderOpcControllerCore extends ParentOrderController
}
}
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
if ($selectedRoomServiceProduct = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
null,
null
)) {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, true, 1);
foreach ($selectedRoomServiceProduct as $key => $selectedProducts) {
foreach ($selectedProducts['selected_products_info'] as $product) {
$selectedRoomServiceProduct[$key]['selected_products'][] = $product['id_product'];
}
}
$this->context->smarty->assign(array(
'roomTypeServiceProducts' => $roomTypeServiceProducts,
'selectedRoomServiceProduct' => $selectedRoomServiceProduct
));
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, true, 1);
$cartRooms = $objCartBookingData->getHotelCartRoomsInfoByRoomType($this->context->cart->id, $idProduct,$dateFrom, $dateTo);
foreach($cartRooms as &$room) {
$room['selected_service'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
$room['id'],
0,
null,
null
);
}
$this->context->smarty->assign(array(
'roomTypeServiceProducts' => $roomTypeServiceProducts,
'cartRooms' => $cartRooms
));
}
}
$response['extra_demands'] = $this->context->smarty->fetch(

View File

@@ -305,10 +305,6 @@ class ProductControllerCore extends FrontController
$htl_features = array();
$obj_hotel_room_type = new HotelRoomType();
$room_info_by_product_id = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($this->product->id);
$productCapacity = array();
$productCapacity['adults'] = $room_info_by_product_id['adults'];
$productCapacity['children'] = $room_info_by_product_id['children'];
$this->product->capacity = $productCapacity;
if ($hotel_id = $room_info_by_product_id['id_hotel']) {
$obj_hotel_branch = new HotelBranchInformation();
$hotel_info_by_id = $obj_hotel_branch->hotelBranchesInfo(false, 2, 1, $hotel_id);

View File

@@ -136,7 +136,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
'new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by QloApps will be PHP 5.6. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.6 now!'), phpversion()),
'register_globals' => $this->l('PHP register_globals option is enabled'),
'gz' => $this->l('GZIP compression is not activated'),
'mcrypt' => $this->l('Mcrypt extension is not enabled'),
'mbstring' => $this->l('Mbstring extension is not enabled'),
'magicquotes' => $this->l('PHP magic quotes option is enabled'),
'dom' => $this->l('Dom extension is not loaded'),

View File

@@ -1555,7 +1555,6 @@ CREATE TABLE `PREFIX_product` (
`cache_has_attachments` tinyint(1) NOT NULL DEFAULT '0',
`is_virtual` tinyint(1) NOT NULL DEFAULT '0',
`booking_product` tinyint(1) NOT NULL DEFAULT '1',
`is_invisible` tinyint(1) NOT NULL DEFAULT '0',
`cache_default_attribute` int(10) unsigned DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,

View File

@@ -11,8 +11,8 @@
<category_group id="category_group_2_1" id_category="Locations" id_group="Visitor"/>
<category_group id="category_group_2_2" id_category="Locations" id_group="Guest"/>
<category_group id="category_group_2_3" id_category="Locations" id_group="Customer"/>
<category_group id="category_group_3_1" id_category="Products" id_group="Visitor"/>
<category_group id="category_group_3_2" id_category="Products" id_group="Guest"/>
<category_group id="category_group_3_3" id_category="Products" id_group="Customer"/>
<category_group id="category_group_3_1" id_category="Services" id_group="Visitor"/>
<category_group id="category_group_3_2" id_category="Services" id_group="Guest"/>
<category_group id="category_group_3_3" id_category="Services" id_group="Customer"/>
</entities>
</entity_category_group>

View File

@@ -677,6 +677,7 @@ class InstallModelInstall extends InstallAbstractModel
'dashperformance',
'dashproducts',
'dashgoals',
'dashinsights',
'graphnvd3',
'statsdata',
'statsvisits',

View File

@@ -2579,11 +2579,9 @@
*/
function translate(translationKey) {
var translationKeyLowerCase = translationKey.toLowerCase();
console.log(languages);
var result = (translationKey in languages) ? languages[translationKey] : (translationKeyLowerCase in languages) ? languages[translationKeyLowerCase] : null;
var defaultLanguage = $.dateRangePickerLanguages['default'];
if (result == null) result = (translationKey in defaultLanguage) ? defaultLanguage[translationKey] : (translationKeyLowerCase in defaultLanguage) ? defaultLanguage[translationKeyLowerCase] : '';
console.log(result);
return result;
}

View File

@@ -149,28 +149,6 @@
{extra_demands_details_html}
</td>
</tr>
<tr>
<td colspan="9" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
<tr>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Image</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Name</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Unit Price</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Qty</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Total</th>
</tr>
<tbody>
<tr>
<td colspan="5" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
&nbsp;&nbsp;{normal_products_data_html}
</td>
</tr>
</tbody>
</table>
</font>
</td>
</tr>
<tr>
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
&nbsp;&nbsp;{discounts}
@@ -196,35 +174,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_products}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr class="conf_body">
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
<table class="table" style="width:100%;border-collapse:collapse">
<tr>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Total Extra Services Cost</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
</tr>
</table>
</td>
<td bgcolor="#f8f8f8" align="right" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
<table class="table" style="width:100%;border-collapse:collapse">
<tr>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_extra_demands_te}
{room_price_tax_excl}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
@@ -267,7 +217,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Total Rooms Tax</strong>
<strong>Total Convenience Fees</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
@@ -280,7 +230,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_tax_paid}
{total_convenience_fee_te}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
@@ -295,7 +245,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Extra Services Tax</strong>
<strong>Total Tax</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
@@ -308,7 +258,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{extra_demands_tax}
{total_tax_paid}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>

View File

@@ -1287,6 +1287,7 @@ function getBookingOccupancyDetails(bookingform)
{
let occupancy;
if (occupancy_required_for_booking) {
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
if (selected_occupancy.length) {
occupancy = [];
@@ -1302,7 +1303,6 @@ function getBookingOccupancyDetails(bookingform)
if (child_ages.length != $(element).find('.num_children').val()) {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
}
occupancy.push({
@@ -1313,7 +1313,6 @@ function getBookingOccupancyDetails(bookingform)
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
});
} else {

View File

@@ -47,4 +47,17 @@ $(document).ready(function()
if (menu_cont.hasClass("menu_cont_left"))
menu_cont.removeClass("menu_cont_left").addClass("menu_cont_right");
});
});
$(document).on('click', function(e) {
const navigationMenu = $('#menu_cont');
if (navigationMenu.length) {
if (!($(e.target).closest('#menu_cont').length
|| $(e.target).closest('.header-top .header-top-menu .nav_toggle').length
)) {
if (navigationMenu.hasClass('menu_cont_left')) {
navigationMenu.removeClass('menu_cont_left').addClass('menu_cont_right');
}
}
}
});
});

View File

@@ -0,0 +1,4 @@
Changelog
v1.0.0
- first release

View File

@@ -0,0 +1,223 @@
SOFTWARE LICENCE AGREEMENT
===============================
This AGREEMENT is made effective on the date of the purchase of the software between Webkul Software Pvt. Ltd.,Company incorporated under the Companies Act, 1956 (hereinafter referred to as “Licensor"), and the purchaser of the software/ product (hereinafter referred to as "Licensee").
Preamble
==================
Licensor is a web and mobile product based organization engaged in the business of developing and marketing software for enterprise level e-commerce businesses. It is an ISO and NSR (NASSCOM) certified organization having a team of more than 150 creative engineers which come from different backgrounds. It has developed more than 700 web extensions and apps in the past few years for open source platforms which are used and trusted globally. Licensee now wishes to obtain license, and Licensor wishes to grant a license, to allow use of the software so purchased in developing the e-commerce business website/ mobile app of the Licensee, subject to the terms and conditions set forth herein.
THEREFORE, with the intent to be legally bound, the parties hereby agree as follows:
Agreement
================
1.Definitions :
------------------
As used in this Agreement, the following capitalized terms shall have the definitions set forth below:
"Derivative Works" are works developed by Licensee, its officers, agents, contractors or employees, which are based upon, in whole or in part, the Source Code and/or the Documentation and may also be based upon and/or incorporate one or more other preexisting works of the Licensor. Derivative Works may be any improvement, revision, modification, translation (including compilation or recapitulation by computer), abridgment, condensation, expansion, or any other form in which such a preexisting work may be recast, transformed, or adapted. For purposes hereof, a Derivative Work shall also include any compilation that incorporates such a preexisting work.
"Documentation" is written, printed or otherwise recorded or stored (digital or paper) material relating to the Software and/or Source Code, including technical specifications and instructions for its use including Software/ Source Code annotations and other descriptions of the principles of its operation and instructions for its use.
"Improvements" shall mean, with respect to the Software, all modifications and changes made, developed, acquired or conceived after the date hereof and during the entire term of this Agreement.
"Source Code" is the computer programming source code form of the Software in the form maintained by the Licensor, and includes all non-third-party executables, libraries, components, and Documentation created or used in the creation, development, maintenance, and support of the Software as well as all updates, error corrections and revisions thereto provided by Licensor, in whole or in part.
2. Software License.
-------------------------
(a)Grant of License. For the consideration set forth below, Licensor hereby grants to Licensee, and Licensee hereby accepts the worldwide, non-exclusive, perpetual, royalty-free rights and licenses set forth below:
(i)The right and license to use and incorporate the software, in whole or in part, to develop its website/ mobile app (including the integration of all or part of the Licensor’s software into Licensee's own software) on one domain ( Except Joomla modules , listed on store are entitled to be used on unlimited domain as per the standard guidelines ) only, solely for the own personal or business use of the Licensee. However, the License does not authorize the Licensee to compile, copy or distribute the said Software or its Derivative Works.
(ii)The right and license does not authorize the Licensee to make any backup or archival copies of the Software and / or the Source Code and Documentation.
(iii)The right and license does not authorize the Licensee to migrate the domain license to another domain.
(b)Scope; Rights and Responsibilities.
(i)Licensor shall enable the Licensee to download one complete copy of the Software.
(ii)The Software is intended for the sole use of the Licensee in development of its own website/ mobile app.
(iii)Licensee does not have the right to hand over, sell, distribute, sub-license, rent, lease or lend any portion of the Software or Documentation, whether modified or unmodified, to anyone. Licensee should not place the Software on a server so that it becomes accessible via a public network such as the Internet for distribution purposes. In case the Licensee is using any source code management system like github, it can use the code there only when it has paid subscription from such management system.
(iv)Licensee is not authorized to appoint, or work with, third parties to perform any development services using the Source Code, the source code to Derivative Works and/or the Documentation on behalf of, or working with, the Licensee. Release of Source Code, Derivative Work source code and/or Documentation to any third party shall be considered as violation of the Agreement, inter-alia entailing forthwith termination and legal action.
(c)Ownership.
(i)Software and Source Code. All right, title, copyright, and interest in the Software, Source Code, Software Modifications and Error corrections will be and remain the property of Licensor.
(ii)Derivative Works. As creation of Derivative Works by the Licensee is prohibited, thus, all right, title, copyright, and interest in any and/or all Derivative Works and Improvements created by, or on behalf of, Licensee will also be deemed to the property of Licensor. Licensor shall be entitled to protect copyright / intellectual property in all such Derivative Works and Improvements also in any country as it may deem fit including without limitation seeking copyright and/or patent protection.
3.Consideration.
--------------------
(a)Licensee shall pay to Licensor the amount as mentioned on the website from where the order is placed, as one-time, upfront fees in consideration for the licenses and rights granted hereunder (hereinafter referred to as the "License Fee"). The License Fee to be paid by Licensee shall be paid upfront at the time of placing the order, and no credit will be allowed under any circumstances.
(b)Once paid, the License Fees shall be non-refundable. The Licensee has fully satisfied itself about the Software and has seen the demonstration, and only thereafter has placed the order. Thus, the License Fees or any part thereof is non-refundable. No claim for refund of the Licence Fees shall be entertained under any circumstances.
4.Representations and Warranties.
-------------------------------------
(a)Mutual. Each of the parties represents and warrants to the other as follows.
(i)such party is a legal entity duly organized, validly existing and in good standing;
(ii)such party has the power and authority to conduct its business as presently conducted and to enter into, execute, deliver and perform this Agreement.
(iii)This Agreement has been duly and validly accepted by such party and constitutes the legal, valid and binding obligations of such party respectively, enforceable against such party in accordance with their respective terms;
(iv)the acceptance, execution, delivery and performance of this Agreement does not and will not violate such party's charter or by-laws; nor require any consent, authorization, approval, exemption or other action by any third party or governmental entity.
(b)Licensor warrants that, at the time of purchase of the Software:
the Software will function materially as set forth in the website or published functionality provided by Licensor to customers and potential customers describing the Software; and
Software add-ons, if purchased by the Licensee from the Licensor, will not materially diminish the features or functions of or the specifications of the Software as they existed as of the execution of this Agreement.
(c)Title. Licensor represents and warrants that it is the exclusive owner of all copyright/ intellectual property in the Software (including the Source Code) and has good and marketable title to the Software (including the Source Code) free and clear of all liens, claims and encumbrances of any nature whatsoever (collectively, "Liens"). Licensor's grant of license and rights to Licensee hereunder does not, and will not infringe any third party's property, intellectual property or personal rights.
5.Term.
-------------
(a)Subject to Licensee's payment obligations, this Agreement shall commence as on the date of making payment of the Software by the Licensee to the Licensor, and shall continue until terminated by either party.
(b)The Licensor retains the right to terminate the license at any time, if the Licensee is not abiding by any of the terms of the Agreement. The Licensee may terminate the Agreement at any time at its own discretion by uninstalling the Software and /or by destroying the said Software (or any copies thereof). However, the Licensee shall not be entitled to seek any refund of the amount paid by it to the Licensor, under any circumstances.
(c)Survival. In the event this Agreement is terminated for any reason, the provisions set forth in Sections 2(a), 2(b), and 2(c) shall survive.
6. Indemnification
----------------------
The Licensee release the Licensor from, and agree to indemnify, defend and hold harmless the Licensor (and its officers, directors, employees, agents and Affiliates) against, any claim, loss, damage, settlement, cost, taxes, expense or other liability (including, without limitation, attorneys' fees) (each, a "Claim") arising from or related to: (a) any actual or alleged breach of any obligations in this Agreement; (b) any refund, adjustment, or return of Software,(c) any claim for actual or alleged infringement of any Intellectual Property Rights made by any third party or damages related thereto; or (d) Taxes.
7. Limitation of Liability
------------------------------
The Licensor will not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses arising out of or in connection with the Software, whether in contract, warranty, tort etc. (including negligence, software liability, any type of civil responsibility or other theory or otherwise) to the Licensee or any other person for cost of software, cover, recovery or recoupment of any investment made by the Licensee or its affiliates in connection with this Agreement, or for any other loss of profit, revenue, business, or data or punitive or consequential damages arising out of or relating to this Agreement. Further, the aggregate liability of the Licensor, arising out of or in connection with this Agreement or the transactions contemplated hereby will not exceed at any time, or under any circumstances, the total amounts received by the Licensor from the Licensee in connection with the particular software giving rise to the claim.
8. Force Majeure
---------------------
The Licensor will not be liable for any delay or failure to perform any of its obligations under this Agreement by reasons, events or other matters beyond its reasonable control.
9. Relationship of Parties
------------------------------
The Licensor and Licensee are independent legal entities, and nothing in this Agreement will be construed to create a partnership, joint venture, association of persons, agency, franchise, sales representative, or employment relationship between the parties. The Licensee will have no authority to make or accept any offers or representations on behalf of the Licensor. The relationship between the parties is that of Licensor and Licensee only, and the rights, duties, liabilities of each party shall be governed by this Agreement.
10. Modification
------------------------
The Licensor may amend any of the terms and conditions contained in this Agreement at any time and solely at its discretion. Any changes will be effective upon the posting of such changes on the Portal/ website, and the Licensee is responsible for reviewing these changes and informing itself of all applicable changes or notices. The continued use of a software by the Licensee after posting of any changes by the Licensor, will constitute the acceptance of such changes or modifications by the Licensee.
11.Miscellaneous.
-----------------------
(a)General Provisions. This Agreement: (i) may be amended only by a writing signed by each of the parties; (ii) may be executed in several counterparts, each of which shall be deemed an original but all of which shall constitute one and the same instrument; (iii) contains the entire agreement of the parties with respect to the transactions contemplated hereby and supersedes all prior written and oral agreements, and all contemporaneous oral agreements, relating to such transactions; (iv) shall be governed by, and construed and enforced in accordance with, the laws of India; and (v) shall be binding upon, and inure to the benefit of, the parties and their respective successors and permitted assigns. Each of the parties hereby irrevocably submits to the jurisdiction of the Courts at Delhi, India, for the purposes of any action or proceeding arising out of or relating to this Agreement or the subject matter hereof and brought by any other party.
(b)Assignment. Licensee cannot assign, pledge or otherwise transfer, whether by operation of law or otherwise, this Agreement, or any of its obligations hereunder, without the prior written consent of Licensor, which consent shall not be unreasonably withheld.
(c)Notices. Unless otherwise specifically provided herein, all notices, consents, requests, demands and other communications required or permitted hereunder:
(i)shall be in writing;
(ii)shall be sent by messenger, certified or registered mail/email, or reliable express delivery service, to the appropriate address(es) set forth below; and
(iii)shall be deemed to have been given on the date of receipt by the addressee, as evidenced by a receipt executed by the addressee (or a responsible person in his or her office), the records of the Party delivering such communication or a notice to the effect that such addressee refused to claim or accept such communication, if sent by messenger, mail or express delivery service.
All such communications shall be sent to the following addresses or numbers, or to such other addresses or numbers as any party may inform the others by giving five days' prior notice:
If to Webkul Software Pvt. Ltd.:
Webkul Software Pvt. Ltd.
H-28, ARV Park, Sector 63, NOIDA – 201301,
Uttar Pradesh, India
If to Licensee:
At the address mentioned by the Licensee
(at the time of placing order of generating Invoice)
(d)Severability. It is the intent of the parties that the provisions of this Agreement be enforced to the fullest extent permissible under the laws and public policies of India in which enforcement hereof is sought. In furtherance of the foregoing, each provision hereof shall be severable from each other provision, and any provision hereof which is/ becomes unenforceable shall be subject to the following: (i) if such provision is contrary to or conflicts with any requirement of any statute, rule or regulation in effect, then such requirement shall be incorporated into, or substituted for, such unenforceable provision to the minimum extent necessary to make such provision enforceable; (ii) the court, agency or arbitrator considering the matter is hereby authorized to (or, if such court, agency or arbitrator is unwilling or fails to do so, then the parties shall) amend such provision to the minimum extent necessary to make such provision enforceable, and the parties hereby consent to the entry of an order so amending such provision; and (iii) if any such provision cannot be or is not reformed and made enforceable pursuant to clause (i) or (ii) above, then such provision shall be ineffective to the minimum extent necessary to make the remainder of this Agreement enforceable. Any application of the foregoing provisions to any provision hereof shall not effect the validity or enforceability of any other provision hereof.
(e)By purchasing the Software, the Licensee acknowledge that it has read this Agreement, and that it agrees to the content of the Agreement, its terms and agree to use the Software in compliance with this Agreement.
(f)The Licensor holds the sole copyright of the Software. The Software or any portion thereof is a copyrightable matter and is liable to be protected by the applicable laws. Copyright infringement in any manner can lead to prosecution according to the current law. The Licensor reserves the right to revoke the license of any user who is not holding any license or is holding an invalid license.
(g)This Agreement gives the right to use only one copy of the Software on one domain solely for the own personal or business use of the Licensee, subject to all the terms and conditions of this Agreement. A separate License has to be purchased for each new Software installation. Any distribution of the Software without the written consent of the Licensor (including non-commercial distribution) is regarded as violation of this Agreement, and will entail immediate termination of the Agreement and may invite liability, both civil and criminal, as per applicable laws.
(h)The Licensor reserves the rights to publish a selected list of users/ Licensees of its Software, and no permission of any Licensee is needed in this regard. The Licensee agrees that the Licensor may, in its sole discretion, disclose or make available any information provided or submitted by the Licensee or related to it under this Agreement to any judicial, quasi-judicial, governmental, regulatory or any other authority as may be required by the Licensor to co-operate and / or comply with any of their orders, instructions or directions or to fulfill any requirements under applicable Laws.
(i)If the Licensee continues to use the Software even after the sending of the notice by the Licensor for termination, the Licensee agree to accept an injunction to restrain itself from its further use, and to pay all costs (including but not limited to reasonable attorney fees) to enforce injunction or to revoke the License, and any damages suffered by the Licensor because of the misuse of the Software by the Licensee.
12. Arbitration
-----------------------
If any dispute arises between the Licensor and the Licensee at any time, in connection with the validity, interpretation, implementation or alleged breach of any provision of this Agreement, the same shall be referred to a sole Arbitrator who shall be an independent and neutral third party appointed exclusively by the Licensor. The Licensee shall not object to the appointment of the Arbitrator so appointed by the Licensor. The place of arbitration shall be Delhi, India. The Arbitration & Conciliation Act, 1996 as amended by The Arbitration & Conciliation (Amendment) Act, 2015, shall govern the arbitration proceedings. The arbitration proceedings shall be held in the English language.

View File

@@ -0,0 +1,511 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class DashInsights extends Module
{
public function __construct()
{
$this->name = 'dashinsights';
$this->tab = 'dashboard';
$this->version = '1.0.0';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6');
$this->author = 'Webkul';
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Dashboard Booking Insights');
$this->description = $this->l('Adds a block with a graphical representation of booking insights.');
$this->confirmUnsinstall = $this->l('Are you sure you want to uninstall?');
$this->allow_push = true;
}
public function install()
{
return (parent::install()
&& $this->registerHook('dashboardZoneOne')
&& $this->registerHook('dashboardZoneTwo')
&& $this->registerHook('dashboardData')
&& $this->registerHook('actionAdminControllerSetMedia')
&& $this->updateHookPositions()
);
}
public function hookActionAdminControllerSetMedia()
{
if (Tools::getValue('controller') == 'AdminDashboard') {
$this->context->controller->addCSS($this->_path.'views/css/'.$this->name.'.css');
$this->context->controller->addJS($this->_path.'views/js/'.$this->name.'.js');
}
}
public function updateHookPositions()
{
$idHook = Hook::getIdByName('dashboardZoneOne');
$result = $this->updatePosition($idHook, 0, 2);
$idHook = Hook::getIdByName('dashboardZoneTwo');
$result &= $this->updatePosition($idHook, 0, 6);
return $result;
}
public function hookDashboardZoneOne()
{
return $this->display(__FILE__, 'dashboard-zone-one.tpl');
}
public function hookDashboardZoneTwo()
{
return $this->display(__FILE__, 'dashboard-zone-two.tpl');
}
public function hookDashboardData($params)
{
$dateFrom = $params['date_from'];
$dateTo = $params['date_to'];
$idHotel = $params['id_hotel'];
// set common variables
$this->accessibleIdsHotel = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
// set dates info
$this->discreteDates = array();
$dateTemp = $dateFrom;
while ($dateTemp <= $dateTo) {
$dateNext = date('Y-m-d', strtotime('+1 day', strtotime($dateTemp)));
$this->discreteDates[] = array(
'timestamp_from' => strtotime($dateTemp),
);
$dateTemp = $dateNext;
};
// set colors to be used for charts
$this->chartColors = array('#545fd5', '#fc7c63');
// get data now
$roomNightsData = $this->getRoomNightsData($dateFrom, $dateTo, $idHotel);
$daysOfTheWeekData = $this->getDaysOfTheWeekData($dateFrom, $dateTo, $idHotel);
$lengthOfStayData = $this->getLengthOfStayData($dateFrom, $dateTo, $idHotel);
// set labels
$panelsLabel = '';
if ($idHotel) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$addressInfo = HotelBranchInformation::getAddress($idHotel, $this->context->language->id);
$panelsLabel = sprintf('(%s, %s)', $objHotelBranchInformation->hotel_name, $addressInfo['city']);
} else {
$panelsLabel = $this->l('(All Hotels)');
}
$return = array(
'data_value' => array(
'dashinsights_heading_zone_one' => $panelsLabel,
'dashinsights_heading_zone_two' => $panelsLabel,
),
'data_chart' => array(
'dashinsights_line_chart1' => array(
'chart_type' => 'line_chart_dashinsights',
'data' => $roomNightsData,
'date_format' => $this->context->language->date_format_lite,
),
'dashinsights_multibar_chart1' => array(
'chart_type' => 'multibar_chart_dotw_dashinsights',
'data' => $daysOfTheWeekData,
'date_format' => $this->context->language->date_format_lite,
),
'dashinsights_multibar_chart2' => array(
'chart_type' => 'multibar_chart_los_dashinsights',
'data' => $lengthOfStayData,
'date_format' => $this->context->language->date_format_lite,
'axis_labels' => array('x' => $this->l('Days')),
'y_format' => '%',
),
),
);
return $return;
}
public function getRoomNightsData($dateFrom, $dateTo, $idHotel)
{
$seriesWiseRoomNights = array();
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
);
foreach ($this->discreteDates as $discreteDate) {
$allHotelSeriesInfo['data'][$discreteDate['timestamp_from']] = rand(1, 100);
}
$seriesWiseRoomNights[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelRoomNights = array();
$otherHotelsRoomNights = array();
// current hotel series info
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelRoomNightsData = array();
foreach ($this->discreteDates as $discreteDate) {
$currentHotelRoomNightsData[$discreteDate['timestamp_from']] = rand(1, 100);
}
$currentHotelSeriesInfo = array(
'data' => $currentHotelRoomNightsData,
'label' => $objHotelBranchInformation->hotel_name,
);
// average series info
$averageRoomNightsData = array();
foreach ($this->discreteDates as $discreteDate) {
$averageRoomNightsData[$discreteDate['timestamp_from']] = sprintf('%0.2f', rand(1, 10000) / 100);
}
$averageSeriesInfo = array(
'data' => $averageRoomNightsData,
'label' => $this->l('Others Average'),
);
$seriesWiseRoomNights = array(
$currentHotelSeriesInfo,
$averageSeriesInfo,
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getRoomNightsData($dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
);
$seriesWiseRoomNights[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelRoomNights = array();
$otherHotelsRoomNights = array();
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelRoomNightsData = AdminStatsController::getRoomNightsData($dateFrom, $dateTo, $idHotel);
$currentHotelSeriesInfo = array(
'data' => $currentHotelRoomNightsData,
'label' => $objHotelBranchInformation->hotel_name,
);
$seriesWiseRoomNights[] = $currentHotelSeriesInfo;
// calculate average of other hotels
$idsHotel = $this->accessibleIdsHotel;
if (($key = array_search($idHotel, $idsHotel)) !== false) {
unset($idsHotel[$key]);
}
if (count($idsHotel) > 2) { // display average series only if other hotels are available
$averageRoomNightsData = AdminStatsController::getRoomNightsData($dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageRoomNightsData,
'label' => $this->l('Others Average'),
);
$seriesWiseRoomNights[] = $averageSeriesInfo;
}
}
}
// format room nights data
$roomNightsFormattedData = array();
$colorIndex = 0;
foreach ($seriesWiseRoomNights as $key => &$hotelRoomNights) {
$hotelData = array();
foreach ($hotelRoomNights['data'] as $timestamp => $hotelRoomNight) {
$hotelData[] = array($timestamp, $hotelRoomNight);
}
$roomNightsFormattedData[] = array(
'key' => $hotelRoomNights['label'],
'values' => $hotelData,
'color' => $this->chartColors[$colorIndex++],
);
}
return $roomNightsFormattedData;
}
public function getDaysOfTheWeekData($dateFrom, $dateTo, $idHotel)
{
$seriesWiseDaysOfTheWeek = array();
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
);
// 1 = SUN
for ($i = 1; $i <= 7; $i++) {
$allHotelSeriesInfo['data'][$i] = round(rand(0, 100));
}
$seriesWiseDaysOfTheWeek[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelDaysOfTheWeek = array();
$otherHotelsDaysOfTheWeek = array();
// current hotel series info
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelDaysOfTheWeekData = array();
for ($i = 1; $i <= 7; $i++) {
$currentHotelDaysOfTheWeekData[$i] = round(rand(0, 100));
}
$currentHotelSeriesInfo = array(
'data' => $currentHotelDaysOfTheWeekData,
'label' => $objHotelBranchInformation->hotel_name,
);
// average series info
$averageDaysOfTheWeekData = array();
for ($i = 1; $i <= 7; $i++) {
$averageDaysOfTheWeekData[$i] = sprintf('%0.2f', rand(1, 10000) / 100);
}
$averageSeriesInfo = array(
'data' => $averageDaysOfTheWeekData,
'label' => $this->l('Others Average'),
);
$seriesWiseDaysOfTheWeek = array(
$currentHotelSeriesInfo,
$averageSeriesInfo,
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
);
$seriesWiseDaysOfTheWeek[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelDaysOfTheWeek = array();
$otherHotelsDaysOfTheWeek = array();
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelDaysOfTheWeekData = AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idHotel);
$currentHotelSeriesInfo = array(
'data' => $currentHotelDaysOfTheWeekData,
'label' => $objHotelBranchInformation->hotel_name,
);
$seriesWiseDaysOfTheWeek[] = $currentHotelSeriesInfo;
// calculate average of other hotels
$idsHotel = $this->accessibleIdsHotel;
if (($key = array_search($idHotel, $idsHotel)) !== false) {
unset($idsHotel[$key]);
}
if (count($idsHotel) > 1) { // display average series only if other hotels are available
$averageDaysOfTheWeekData = AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageDaysOfTheWeekData,
'label' => $this->l('Others Average'),
);
$seriesWiseDaysOfTheWeek[] = $averageSeriesInfo;
}
}
}
// format days of the week data
$daysOfTheWeekFormattedData = array();
$colorIndex = 0;
$weekDays = array(
$this->l('SUN'),
$this->l('MON'),
$this->l('TUE'),
$this->l('WED'),
$this->l('THU'),
$this->l('FRI'),
$this->l('SAT'),
);
foreach ($seriesWiseDaysOfTheWeek as $key => &$hotelDaysOfTheWeek) {
$hotelData = array();
foreach ($hotelDaysOfTheWeek['data'] as $dayOfWeek => $hotelDayOfTheWeek) {
$hotelData[] = array(
'x' => $weekDays[$dayOfWeek - 1],
'y' => $hotelDayOfTheWeek,
);
}
$daysOfTheWeekFormattedData[] = array(
'key' => $hotelDaysOfTheWeek['label'],
'values' => $hotelData,
'color' => $this->chartColors[$colorIndex++],
);
}
return $daysOfTheWeekFormattedData;
}
public function getLengthOfStayData($dateFrom, $dateTo, $idHotel)
{
$seriesWiseLengthOfStay = array();
// day ranges to get length of stay data
$day = array(
1 => array(1, 1),
2 => array(2, 2),
3 => array(3, 3),
4 => array(4, 4),
5 => array(5, 5),
6 => array(6, 6),
7 => array(7, 100),
);
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
// set room nights demo data
if ($idHotel == 0) { // if 'All Hotels' is selected
$allHotelSeriesInfo = array(
'data' => array(),
'label' => $this->l('All Hotels'),
);
for ($i = 1; $i <= 7; $i++) {
$allHotelSeriesInfo['data'][$i] = sprintf('%0.2f', rand(1, 100) / 100);
}
$seriesWiseLengthOfStay[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelLengthOfStay = array();
$otherHotelsLengthOfStay = array();
// current hotel series info
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelLengthOfStayData = array();
for ($i = 1; $i <= 7; $i++) {
$currentHotelLengthOfStayData[$i] = sprintf('%0.2f', rand(1, 100) / 100);
}
$currentHotelSeriesInfo = array(
'data' => $currentHotelLengthOfStayData,
'label' => $objHotelBranchInformation->hotel_name,
);
// average series info
$averageLengthOfStayData = array();
for ($i = 1; $i <= 7; $i++) {
$averageLengthOfStayData[$i] = sprintf('%0.2f', rand(1, 100) / 100);
}
$averageSeriesInfo = array(
'data' => $averageLengthOfStayData,
'label' => $this->l('Others Average'),
);
$seriesWiseLengthOfStay = array(
$currentHotelSeriesInfo,
$averageSeriesInfo,
);
}
} else {
if ($idHotel == 0) { // if 'All Hotels' is selected
$idsHotel = $this->accessibleIdsHotel;
$allHotelSeriesInfo = array(
'data' => AdminStatsController::getLengthOfStayPercentages($day, $dateFrom, $dateTo, $idsHotel),
'label' => $this->l('All Hotels'),
);
$seriesWiseLengthOfStay[] = $allHotelSeriesInfo;
} else { // if one of the hotels is selected
$hotelLengthOfStay = array();
$otherHotelsLengthOfStay = array();
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$currentHotelLengthOfStayData = AdminStatsController::getLengthOfStayPercentages($day, $dateFrom, $dateTo, $idHotel);
$currentHotelSeriesInfo = array(
'data' => $currentHotelLengthOfStayData,
'label' => $objHotelBranchInformation->hotel_name,
);
$seriesWiseLengthOfStay[] = $currentHotelSeriesInfo;
// calculate average of other hotels
$idsHotel = $this->accessibleIdsHotel;
if (($key = array_search($idHotel, $idsHotel)) !== false) {
unset($idsHotel[$key]);
}
if (count($idsHotel) > 1) { // display average series only if other hotels are available
$averageLengthOfStayData = AdminStatsController::getLengthOfStayPercentages($day, $dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageLengthOfStayData,
'label' => $this->l('Others Average'),
);
$seriesWiseLengthOfStay[] = $averageSeriesInfo;
}
}
}
// format length of stay data
$lengthOfStayFormattedData = array();
$colorIndex = 0;
$losInfos = array(
array('days' => 1, 'label' => $this->l('1')),
array('days' => 2, 'label' => $this->l('2')),
array('days' => 3, 'label' => $this->l('3')),
array('days' => 4, 'label' => $this->l('4')),
array('days' => 5, 'label' => $this->l('5')),
array('days' => 6, 'label' => $this->l('6')),
array('days' => 7, 'label' => $this->l('7+')),
);
foreach ($seriesWiseLengthOfStay as $idHotel => &$hotelLengthOfStay) {
$hotelData = array();
foreach ($hotelLengthOfStay['data'] as $numDays => $lengthOfStay) {
$hotelData[] = array(
'x' => $losInfos[$numDays - 1]['label'],
'y' => $lengthOfStay,
);
}
$lengthOfStayFormattedData[] = array(
'key' => $hotelLengthOfStay['label'],
'values' => $hotelData,
'color' => $this->chartColors[$colorIndex++],
);
}
return $lengthOfStayFormattedData;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,54 @@
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
#dashinsights .insight-chart-wrap {
height: 350px;
}
#dashinsights .row .col-md-12.col-lg-6:not(:first-of-type) {
border-left: 1px solid #ccc;
}
#content #dashinsights .insight-chart-wrap .nvtooltip h3 {
margin: 0;
padding: 4px 14px;
line-height: 18px;
font-weight: normal;
background-color: rgba(247,247,247,0.75);
text-align: center;
border-bottom: 1px solid #ebebeb;
-webkit-border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
border-radius: 5px 5px 0 0;
text-transform: none;
}
#dashinsights .chart-label {
margin: 0;
padding: 0;
font-weight: bold;
font-size: 14px;
color: #555;
}
@media (max-width: 992px) {
#dashinsights .row .col-md-12.col-lg-6:not(:first-of-type) {
border-left: none;
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,99 @@
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
function line_chart_dashinsights(widget_name, chart_details) {
nv.addGraph(function () {
var chart = nv.models.lineChart()
.interpolate('basis')
.useInteractiveGuideline(true)
.x(function (d) { return (d !== undefined ? d[0] : 0); })
.y(function (d) { return (d !== undefined ? d[1] : 0); })
.forceY(0)
.margin({
left: 40,
right: 30,
});
chart.xAxis.tickFormat(function (d) {
date = new Date(d * 1000);
return date.format(chart_details['date_format']);
});
chart.yAxis.tickFormat(d3.format('.f'));
d3.select('#dashinsights_room_nights svg')
.datum(chart_details.data)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
}
function multibar_chart_dotw_dashinsights(widget_name, chart_details) {
nv.addGraph(function() {
var chart = nv.models.multiBarHorizontalChart()
.showControls(false)
.margin({
left: 40,
right: 30,
});
chart.xAxis.tickFormat(function (d) {
return d;
});
chart.yAxis.tickFormat(d3.format('.f'));
d3.select('#dashinsights_days_of_the_week svg')
.datum(chart_details.data)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
}
function multibar_chart_los_dashinsights(widget_name, chart_details) {
nv.addGraph(function() {
var chart = nv.models.multiBarHorizontalChart()
.showControls(false)
.margin({
left: 40,
right: 30,
});
chart.xAxis
.axisLabel(chart_details.axis_labels.x)
.tickFormat(function (d) {
return d;
});
chart.yAxis.tickFormat(d3.format(chart_details['y_format']));
d3.select('#dashinsights_length_of_stay svg')
.datum(chart_details.data)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,41 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}
<section id="dashinsights" class="widget allow_push">
<div class="panel">
<div class="panel-heading">
<i class="icon-area-chart"></i> {l s="Insights" mod="dashinsights"}
<span><small class="text-muted" id="dashinsights_heading_zone_one"></small></span>
<span class="panel-heading-action">
<a class="list-toolbar-btn" href="#" onclick="refreshDashboard('dashinsights'); return false;" title="{l s="Refresh" mod="dashinsights"}">
<i class="process-icon-refresh"></i>
</a>
</span>
</div>
<div class="row">
<div class="col-sm-12">
<p class="chart-label">{l s='Length of Stay (%)'}</p>
<div class="chart with-transitions insight-chart-wrap" id="dashinsights_length_of_stay">
<svg></svg>
</div>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,50 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*}
<div class="col-sm-12">
<section id="dashinsights" class="panel widget allow_push">
<header class="panel-heading">
<i class="icon-area-chart"></i> {l s='Insights' mod='dashinsights'}
<span><small class="text-muted" id="dashinsights_heading_zone_two"></small></span>
<span class="panel-heading-action">
<a class="list-toolbar-btn" href="#" onclick="refreshDashboard('dashinsights'); return false;" title="{l s='Refresh' mod='dashinsights'}">
<i class="process-icon-refresh"></i>
</a>
</span>
</header>
<section>
<div class="row">
<div class="col-md-12 col-lg-6">
<p class="chart-label">{l s='Room Nights'}</p>
<div class="chart with-transitions insight-chart-wrap" id="dashinsights_room_nights">
<svg></svg>
</div>
</div>
<div class="col-md-12 col-lg-6">
<p class="chart-label">{l s='Days of the Week'}</p>
<div class="chart with-transitions insight-chart-wrap" id="dashinsights_days_of_the_week">
<svg></svg>
</div>
</div>
</div>
</section>
</section>
</div>
<div class="clearfix"></div>

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -1258,7 +1258,7 @@ class HotelBookingDetail extends ObjectModel
// This function algo is same as available rooms algo and it not similar to booked rooms algo.
public function chechRoomBooked($id_room, $date_from, $date_to)
{
$sql = 'SELECT `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`
$sql = 'SELECT `id`, `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`
FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_room` = '.(int)$id_room.
' AND `is_back_order` = 0 AND `is_refunded` = 0 AND ((date_from <= \''.pSQL($date_from).'\' AND date_to > \''.
pSQL($date_from).'\' AND date_to <= \''.pSQL($date_to).'\') OR (date_from > \''.pSQL($date_from).
@@ -1545,6 +1545,7 @@ class HotelBookingDetail extends ObjectModel
$prod_price = Product::getPriceStatic($value['id_product'], self::useTax());
$productPriceWithoutReduction = $product->getPriceWithoutReduct(!self::useTax());
$productFeaturePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax());
$productFeaturePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 0);
if (empty($price) || ($price['from'] <= $prod_price && $price['to'] >= $prod_price)) {
$cover_image_arr = $product->getCover($value['id_product']);
@@ -1564,9 +1565,11 @@ class HotelBookingDetail extends ObjectModel
$bookingData['rm_data'][$key]['description'] = $product->description_short;
$bookingData['rm_data'][$key]['feature'] = $product_feature;
$bookingData['rm_data'][$key]['price'] = $prod_price;
$bookingData['rm_data'][$key]['price_without_reduction'] = $productPriceWithoutReduction;
$bookingData['rm_data'][$key]['feature_price'] = $productFeaturePrice;
$bookingData['rm_data'][$key]['feature_price_diff'] = $productPriceWithoutReduction - $productFeaturePrice;
$bookingData['rm_data'][$key]['feature_price_withoout_auto_add'] = $productFeaturePriceWithoutAutoAdd;
$bookingData['rm_data'][$key]['price_without_reduction'] = $productPriceWithoutReduction;
$bookingData['rm_data'][$key]['price_without_reduction_with_auto_add'] = $productPriceWithoutReduction + ($productFeaturePrice - $productFeaturePriceWithoutAutoAdd);
$bookingData['rm_data'][$key]['feature_price_diff'] = $bookingData['rm_data'][$key]['price_without_reduction_with_auto_add'] - $productFeaturePrice;
// if ($room_left <= (int)Configuration::get('WK_ROOM_LEFT_WARNING_NUMBER'))
$bookingData['rm_data'][$key]['room_left'] = $room_left;
@@ -1587,6 +1590,9 @@ class HotelBookingDetail extends ObjectModel
if ($occupancy) {
$urlData['occupancy'] = $occupancy;
}
if ($location = Tools::getValue('location')) {
$urlData['location'] = $location;
}
if (Configuration::get('PS_REWRITING_SETTINGS')) {
$bookingData['rm_data'][$key]['product_link'] = $this->context->link->getProductLink($product).'?'.http_build_query($urlData);

View File

@@ -518,7 +518,7 @@ class HotelBranchInformation extends ObjectModel
ON (hbl.`id` = hbi.`id` AND hbl.`id_lang` = '.(int)$idLang.')
WHERE hbi.`id_category` = '.(int)$cat_id.' AND `active` = 1';
return Db::getInstance()->executeS($sql);
return Db::getInstance()->getRow($sql);
}
/**
@@ -537,7 +537,7 @@ class HotelBranchInformation extends ObjectModel
FROM `'._DB_PREFIX_.'category_lang` AS cl
INNER JOIN `'._DB_PREFIX_.'category` AS c ON (cl.`id_category` = c.`id_category`)
WHERE cl.`name` LIKE \'%'.pSQL($searchData).'%\'
AND c.`level_depth` NOT IN (0, 1, 5) and cl.`id_lang`='.(int)$context->language->id.'
AND c.`level_depth` NOT IN (0, 1, 6) and cl.`id_lang`='.(int)$context->language->id.'
AND c.`nleft` > '.(int)$locationCategory->nleft.' AND c.`nright` < '.(int)$locationCategory->nright.'
GROUP BY cl.`name`'
);

View File

@@ -432,7 +432,7 @@ class HotelCartBookingData extends ObjectModel
}
// return number of rooms deleted
return $numRooms;
return true;
}
public function addCartBookingData(
@@ -977,16 +977,13 @@ class HotelCartBookingData extends ObjectModel
);
$cart_detail_data[$key]['additional_service'] = $objRoomTypeServiceProduct->getServiceProductsData($value['id_product']);
$cart_detail_data[$key]['selected_additional_service'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$id_cart,
$cart_detail_data[$key]['selected_services'] = $objRoomTypeServiceProductCartDetail->getRoomServiceProducts(
$value['id'],
0,
0,
$value['id_product'],
$value['date_from'],
$value['date_to'],
$value['id']
null,
null
);
$cart_detail_data[$key]['additional_service_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$cart_detail_data[$key]['additional_service_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
$id_cart,
0,
0,
@@ -994,10 +991,9 @@ class HotelCartBookingData extends ObjectModel
$value['date_from'],
$value['date_to'],
$value['id'],
true,
false
);
$cart_detail_data[$key]['additional_services_auto_add_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$cart_detail_data[$key]['additional_services_auto_add_price'] = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
$id_cart,
0,
0,
@@ -1005,7 +1001,6 @@ class HotelCartBookingData extends ObjectModel
$value['date_from'],
$value['date_to'],
$value['id'],
true,
false,
1
);
@@ -1018,7 +1013,8 @@ class HotelCartBookingData extends ObjectModel
0,
$id_cart,
$value['id_guest'],
$value['id_room']
$value['id_room'],
0
);
$cart_detail_data[$key]['amt_with_qty'] = $roomTypeDateRangePrice['total_price_tax_excl'];
@@ -1312,15 +1308,14 @@ class HotelCartBookingData extends ObjectModel
$data_v['date_to'],
1
);
$serviceProductPrice = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart(
$serviceProductPrice = $objRoomTypeServiceProductCartDetail->getServiceProductsTotalInCart(
$context->cart->id,
0,
$data_v['id_hotel'],
$data_v['id_product'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id'],
true
$data_v['id']
);
$totalAdditionalServicePrice = $demandPrice + $serviceProductPrice;

View File

@@ -195,8 +195,7 @@ class HotelHelper
{
//from setting tab
$home_banner_default_title = 'Four Lessons Hotel Greshon Palace';
$home_banner_default_content = 'Tofu helvetica leggings tattooed. Skateboard blue bottle green juice,
brooklyn cardigan kitsch fap narwhal organic flexitarian.';
$home_banner_default_content = 'Tofu helvetica leggings tattooed. Skateboard blue bottle green juice, brooklyn cardigan kitsch fap narwhal organic flexitarian.';
Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 1);
Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 1);
@@ -244,10 +243,8 @@ class HotelHelper
$WK_HTL_SHORT_DESC = array();
foreach ($languages as $lang) {
$WK_HTL_CHAIN_NAME[$lang['id_lang']] = 'Hotel Dominic Parks';
$WK_HTL_TAG_LINE[$lang['id_lang']] = 'Tofu helvetica leggings tattooed. Skateboard blue
bottle green juice, brooklyn cardigan kitsch fap narwhal organic flexitarian.';
$WK_HTL_SHORT_DESC[$lang['id_lang']] = 'Tofu helvetica leggings tattooed. Skateboard blue bottle green
juice, brooklyn cardigan kitsch fap narwhal organic flexitarian.';
$WK_HTL_TAG_LINE[$lang['id_lang']] = 'Tofu helvetica leggings tattooed. Skateboard blue bottle green juice, brooklyn cardigan kitsch fap narwhal organic flexitarian.';
$WK_HTL_SHORT_DESC[$lang['id_lang']] = 'Tofu helvetica leggings tattooed. Skateboard blue bottle green juice, brooklyn cardigan kitsch fap narwhal organic flexitarian.';
}
Configuration::updateValue('WK_HTL_CHAIN_NAME', $WK_HTL_CHAIN_NAME);
Configuration::updateValue('WK_HTL_TAG_LINE', $WK_HTL_TAG_LINE);
@@ -401,6 +398,8 @@ class HotelHelper
$obj_hotel_info->id_category = $cat_hotel;
$obj_hotel_info->save();
}
// save dummy hotel as primary hotel
Configuration::updateValue('WK_PRIMARY_HOTEL', $htl_id);
return $htl_id;
}

View File

@@ -236,4 +236,44 @@ class HotelOrderRefundRules extends ObjectModel
return $totalCancelationCharges;
}
public static function getApplicableRefundRules($idOrder)
{
$idLang = Context::getContext()->language->id;
$maxDate = Db::getInstance()->getValue(
'SELECT MAX(DATE(hbd.`date_from`))
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`id_order` = '.(int) $idOrder
);
if ($maxDate) {
$dateToday = date('Y-m-d');
if (strtotime($maxDate) >= strtotime($dateToday)) {
$days = HotelBookingDetail::getDays($dateToday, $maxDate); // always returns positive
$sql = 'SELECT hbrr.`id_hotel_refund_rule`, hbrr.`id_refund_rule`, hbrr.`id_hotel`, hbrr.`position`,
horrl.`name`, horrl.`description`, horr.`payment_type`, horr.`deduction_value_full_pay`,
horr.`deduction_value_adv_pay`, horr.`days`
FROM `'._DB_PREFIX_.'htl_branch_refund_rules` hbrr
LEFT JOIN `'._DB_PREFIX_.'htl_order_refund_rules` horr
ON (horr.`id_refund_rule` = hbrr.`id_refund_rule`)
LEFT JOIN `'._DB_PREFIX_.'htl_order_refund_rules_lang` horrl
ON (horrl.`id_refund_rule` = horr.`id_refund_rule` AND horrl.`id_lang` = '.(int) $idLang.')
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd
ON (hbd.`id_hotel` = hbrr.`id_hotel` AND hbd.`id_order` = '.(int) $idOrder.')
WHERE horr.`days` <= '.(int) $days.'
GROUP BY hbrr.`id_refund_rule`
ORDER BY hbrr.`position`';
if ($result = Db::getInstance()->executeS($sql)) {
return $result;
}
}
}
return array();
}
}

View File

@@ -76,7 +76,7 @@ class HotelRoomInformation extends ObjectModel
{
if ($idRoom = $this->id) {
// delete rooms from cart which are set inactive
if ($this->id_status == 2) {
if ($this->id_status == self::STATUS_INACTIVE) {
$objCartBookingData = new HotelCartBookingData();
if (!$objCartBookingData->deleteCartBookingData(0, 0, $idRoom)) {
return false;

View File

@@ -156,6 +156,17 @@ class HotelRoomTypeDemand extends ObjectModel
0,
$useTax
);
$roomTypeDemandInfo[$idGlobalDemand]['price_tax_excl'] = HotelRoomTypeDemand::getPriceStatic(
$idProduct,
$idGlobalDemand,
0,
false
);
$roomTypeDemandInfo[$idGlobalDemand]['price_tax_incl'] = HotelRoomTypeDemand::getPriceStatic(
$idProduct,
$idGlobalDemand,
0
);
if ($advOptions = $objAdvOption->getGlobalDemandAdvanceOptions($idGlobalDemand, $idLang)) {
foreach ($advOptions as &$option) {
$idOption = $option['id'];
@@ -165,6 +176,17 @@ class HotelRoomTypeDemand extends ObjectModel
$idOption,
$useTax
);
$roomTypeDemandInfo[$idGlobalDemand]['adv_option'][$idOption]['price_tax_excl'] = HotelRoomTypeDemand::getPriceStatic(
$idProduct,
$idGlobalDemand,
$idOption,
false
);
$roomTypeDemandInfo[$idGlobalDemand]['adv_option'][$idOption]['price_tax_incl'] = HotelRoomTypeDemand::getPriceStatic(
$idProduct,
$idGlobalDemand,
$idOption
);
$roomTypeDemandInfo[$idGlobalDemand]['adv_option'][$idOption]['name'] = $option['name'];
}
}

View File

@@ -183,6 +183,7 @@ class RoomTypeServiceProduct extends ObjectModel
$useTax
);
}
$serviceProduct['images'] = Image::getImages((int)Context::getContext()->language->id, $serviceProduct['id_product']);
}
return $serviceProducts;

View File

@@ -90,6 +90,189 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
return true;
}
public function getServiceProductsTotalInCart(
$idCart,
$idProduct = 0,
$idHotel = 0,
$roomTypeIdProduct = 0,
$dateFrom = 0,
$dateTo = 0,
$htlCartBookingId = 0,
$useTax = null,
$autoAddToCart = 0,
$id_address = null,
$priceAdditionType = null
) {
if ($useTax === null)
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_product` as `room_type_id_product`
FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
WHERE 1';
if (!is_null($autoAddToCart)) {
$sql .= ' AND p.`auto_add_to_cart` = '. (int)$autoAddToCart;
if ($autoAddToCart == 1 && !is_null($priceAdditionType)) {
$sql .= ' AND p.`price_addition_type` = '.$priceAdditionType;
}
}
if ($idCart) {
$sql .= ' AND cbd.`id_cart`='.(int) $idCart;
}
if ($idProduct) {
$sql .= ' AND rscd.`id_product`='.(int) $idProduct;
}
if ($idHotel) {
$sql .= ' AND cbd.`id_hotel`='.(int) $idHotel;
}
if ($roomTypeIdProduct) {
$sql .= ' AND cbd.`id_product`='.(int) $roomTypeIdProduct;
}
if ($dateFrom && $dateTo) {
$sql .= ' AND cbd.`date_from` = \''.pSQL($dateFrom).'\' AND cbd.`date_to` = \''.pSQL($dateTo).'\'';
}
if ($htlCartBookingId) {
$sql .= ' AND cbd.`id`='.(int) $htlCartBookingId;
}
$sql .= ' ORDER BY cbd.`id`';
$totalPrice = 0;
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
foreach ($serviceProducts as $product) {
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
$totalPrice += $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
$useTax,
false,
$id_address
);
}
}
return $totalPrice;
}
public function getRoomServiceProducts(
$htlCartBookingId,
$idLang = 0,
$useTax = null,
$autoAddToCart = 0,
$id_address = null,
$priceAdditionType = null
) {
if ($useTax === null)
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
if (!$idLang) {
$idLang = Context::getContext()->language->id;
}
$sql = 'SELECT rscd.`id_product`, rscd.`quantity`, cbd.`id_cart`, p.`auto_add_to_cart`, p.`allow_multiple_quantity`, cbd.`id` as `htl_cart_booking_id`,
p.`price_addition_type`, cbd.`id_product` as `room_type_id_product`, pl.`name`
FROM `'._DB_PREFIX_.'htl_cart_booking_data` cbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_cart_detail` rscd ON(rscd.`htl_cart_booking_id` = cbd.`id`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rscd.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')
WHERE 1';
if (!is_null($autoAddToCart)) {
$sql .= ' AND p.`auto_add_to_cart` = '. (int)$autoAddToCart;
if ($autoAddToCart == 1 && !is_null($priceAdditionType)) {
$sql .= ' AND p.`price_addition_type` = '.$priceAdditionType;
}
}
if ($htlCartBookingId) {
$sql .= ' AND cbd.`id`='.(int) $htlCartBookingId;
}
$sql .= ' ORDER BY cbd.`id`';
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
$selectedServiceProducts = array();
if ($serviceProducts = Db::getInstance()->executeS($sql)) {
foreach ($serviceProducts as $product) {
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
if (isset($selectedServiceProducts[$product['id_product']])) {
$selectedServiceProducts[$product['id_product']]['quantity'] += $product['quantity'];
$selectedServiceProducts[$product['id_product']]['total_price'] += $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
$useTax,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['total_price_tax_excl'] += $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
false,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['total_price_tax_incl'] += $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
true,
false,
$id_address
);
} else {
$selectedServiceProducts[$product['id_product']] = $product;
$selectedServiceProducts[$product['id_product']]['unit_price_tax_excl'] = $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
false,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['unit_price_tax_incl'] = $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
true,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['total_price'] = $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
$useTax,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['total_price_tax_excl'] = $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
false,
false,
$id_address
);
$selectedServiceProducts[$product['id_product']]['total_price_tax_incl'] = $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
$qty,
true,
false,
$id_address
);
}
}
}
return $selectedServiceProducts;
}
public function getServiceProductsInCart(
$idCart,
$idProduct = 0,
@@ -175,19 +358,32 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
} else {
$qty = $product['quantity'] ? (int)$product['quantity'] : 1;
if (isset($selectedServiceProducts[$product['htl_cart_booking_id']])) {
if ($product['id_product']) {
if ($idProduct) {
$selectedServiceProducts[$product['htl_cart_booking_id']]['quantity'] += $product['quantity'];
} else {
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'][$product['id_product']] = array(
'id_product' => $product['id_product'],
'name' => $product['name'],
'auto_add_to_cart' => $product['auto_add_to_cart'],
'price_addition_type' => $product['price_addition_type'],
'quantity' => $product['quantity'],
);
}
if ($idProduct) {
$selectedServiceProducts[$product['htl_cart_booking_id']]['quantity'] += $product['quantity'];
} else {
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'][$product['id_product']] = array(
'id_product' => $product['id_product'],
'name' => $product['name'],
'quantity' => $product['quantity'],
'auto_add_to_cart' => $product['auto_add_to_cart'],
'price_addition_type' => $product['price_addition_type'],
'unit_price_tax_excl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
false,
false,
$id_address
),
'unit_price_tax_incl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
true,
false,
$id_address
),
);
}
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] += $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
@@ -249,31 +445,29 @@ class RoomTypeServiceProductCartDetail extends ObjectModel
$id_address
);
} else {
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'] = ($product['id_product']) ? array(
$product['id_product'] => array(
'id_product' => $product['id_product'],
'name' => $product['name'],
'quantity' => $product['quantity'],
'auto_add_to_cart' => $product['auto_add_to_cart'],
'price_addition_type' => $product['price_addition_type'],
'unit_price_tax_excl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
false,
false,
$id_address
),
'unit_price_tax_incl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
true,
false,
$id_address
),
)
): array();
$selectedServiceProducts[$product['htl_cart_booking_id']]['selected_products_info'][$product['id_product']] = array(
'id_product' => $product['id_product'],
'name' => $product['name'],
'quantity' => $product['quantity'],
'auto_add_to_cart' => $product['auto_add_to_cart'],
'price_addition_type' => $product['price_addition_type'],
'unit_price_tax_excl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
false,
false,
$id_address
),
'unit_price_tax_incl' => $objRoomTypeServiceProductPrice->getProductPrice(
(int)$product['id_product'],
(int)$product['room_type_id_product'],
1,
true,
false,
$id_address
),
);
}
$selectedServiceProducts[$product['htl_cart_booking_id']]['total_price'] = $objRoomTypeServiceProductPrice->getProductPrice(

View File

@@ -84,7 +84,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`product_id` = rsod.`id_product` AND od.`id_order` = '.(int)$idOrder.')';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = rsod.`id_order_detail`)';
$sql .= ' WHERE rsod.`id_order` = '.(int)$idOrder;
if (!is_null($autoAddToCart)) {

View File

@@ -422,6 +422,18 @@ class AdminAddHotelController extends ModuleAdminController
if ($newIdHotel = $objHotelBranch->id) {
if ($primaryHotelId = Configuration::get('WK_PRIMARY_HOTEL')) {
if ($primaryHotelId == $objHotelBranch->id && !$objHotelBranch->active) {
$hotels = $objHotelBranch->hotelBranchesInfo(false, 1);
if (!empty($hotel = array_shift($hotels))) {
Configuration::updateValue('WK_PRIMARY_HOTEL', $objHotelBranch['id']);
} else {
$newPrimaryHotelId = Configuration::updateValue('WK_PRIMARY_HOTEL', 0);
}
}
} else if ($objHotelBranch->active) {
Configuration::updateValue('WK_PRIMARY_HOTEL', $objHotelBranch->id);
}
// getHotel address
if ($idHotelAddress = $objHotelBranch->getHotelIdAddress()) {
$objAddress = new Address($idHotelAddress);
@@ -559,6 +571,29 @@ class AdminAddHotelController extends ModuleAdminController
$this->display = 'add';
}
}
public function processStatus()
{
parent::processStatus();
if (empty($this->errors)) {
if (Validate::isLoadedObject($objHotelBranch = new HotelBranchInformation(Tools::getValue('id')))) {
if ($primaryHotelId = Configuration::get('WK_PRIMARY_HOTEL')) {
if ($primaryHotelId == $objHotelBranch->id && !$objHotelBranch->active) {
$hotels = $objHotelBranch->hotelBranchesInfo(false, 1);
if (!empty($hotel = array_shift($hotels))) {
Configuration::updateValue('WK_PRIMARY_HOTEL', $hotel['id']);
} else {
$newPrimaryHotelId = Configuration::updateValue('WK_PRIMARY_HOTEL', 0);
}
}
} else {
$hotels = $objHotelBranch->hotelBranchesInfo(false, 1);
if (!empty($hotel = array_shift($hotels))) {
Configuration::updateValue('WK_PRIMARY_HOTEL', $hotel['id']);
}
}
}
}
}
public function ajaxProcessStateByCountryId()
{
@@ -692,6 +727,8 @@ class AdminAddHotelController extends ModuleAdminController
'filesizeError' => $this->l('File exceeds maximum size.'),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
'sortRowsUrl' => $this->context->link->getAdminLink('AdminAddHotel'),
'primaryHotelId' => Configuration::get('WK_PRIMARY_HOTEL'),
'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.'),
)
);
// GOOGLE MAP

View File

@@ -41,16 +41,20 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_lang` fpl ON (a.id_feature_price = fpl.id_feature_price AND fpl.`id_lang` = '.(int) $this->context->language->id.')';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (hrt.`id_product` = a.`id_product`)';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbl ON (hbl.`id` = hrt.`id_hotel` AND hbl.`id_lang`='.(int) $this->context->language->id.')';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` hrtfpg ON (hrtfpg.`id_feature_price` = a.`id_feature_price`)';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'group_lang` gl ON (gl.`id_group` = hrtfpg.`id_group` AND gl.`id_lang` = '.(int) $this->context->language->id.')';
$this->_select .= ' fpl.`feature_price_name` as ftr_price_name, CONCAT(pl.`name`, " (#", a.`id_product`, ")") as product_name, hbl.`hotel_name`, IF(a.impact_type='.(int) HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE.', CONCAT(round(a.impact_value, 2), " ", "%"), a.impact_value) AS impact_value';
$this->_select .= ' ,IF(a.impact_type='.(int) HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE.', \''.$this->l('Percentage').'\', \''.$this->l('Fixed Amount').'\')
AS impact_type';
AS impact_type, count(hrtfpg.`id_feature_price`) AS group_access_count, group_concat(gl.`name` separator ", ") as group_names';
$this->_select .= ', CASE
WHEN a.`impact_way` = '.(int) HotelRoomTypeFeaturePricing::IMPACT_WAY_DECREASE.' THEN \''.$this->l('Decrease').'\'
WHEN a.`impact_way` = '.(int) HotelRoomTypeFeaturePricing::IMPACT_WAY_INCREASE.' THEN \''.$this->l('Increase').'\'
WHEN a.`impact_way` = '.(int) HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE.' THEN \''.$this->l('Fix').'\'
END AS `impact_way`';
$this->_group = 'GROUP BY a.`id_feature_price`';
$this->_where = ' AND a.`id_cart` = 0 AND a.`id_guest` = 0 AND a.`id_room` = 0';
$impactWays = array(1 => $this->l('Decrease'), 2 => $this->l('Increase'), 3 => $this->l('Fix'));
@@ -100,6 +104,13 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
'currency' => true,
'callback' => 'setOrderCurrency',
),
'group_access_count' => array(
'align' => 'center',
'title' => $this->l('Group Access'),
'type' => 'bool',
'callback' => 'setGroupAccessLabel',
'search' => false,
),
'date_from' => array(
'title' => $this->l('Date From'),
'align' => 'center',
@@ -149,12 +160,19 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
}
//A callback function for setting currency sign with amount
public static function setOrderCurrency($echo, $tr)
public static function setOrderCurrency($echo, $row)
{
$currency_default = Configuration::get('PS_CURRENCY_DEFAULT');
return Tools::displayPrice($echo, (int)$currency_default);
}
public function setGroupAccessLabel($echo, $row)
{
$this->context->smarty->assign('row' ,$row);
$tpl_path = 'hotelreservationsystem/views/templates/admin/hotel_feature_prices_settings/group_access_label.tpl';
return $this->context->smarty->fetch(_PS_MODULE_DIR_.$tpl_path);
}
public function initToolbar()
{
parent::initToolbar();
@@ -257,6 +275,10 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
$objFeaturePricing = new HotelRoomTypeFeaturePricing();
if ($priceImpactWay == HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE) {
$priceImpactType = HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE;
}
$languages = Language::getLanguages(false);
$objDefaultLang = new language($defaultLangId);
$isPlanTypeExists = 0;
@@ -366,6 +388,9 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
}
}
if (!(bool)Tools::getValue('groupBox')) {
$this->errors[] = $this->l('Please select at least one group for the group access');
}
if (!count($this->errors)) {
if ($idFeaturePrice) {

View File

@@ -35,6 +35,9 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
if (!$hotelsInfo = $objHotelInfo->hotelBranchesInfo(false, 1)) {
$hotelsInfo = array();
}
foreach ($hotelsInfo as &$hotel) {
$hotel['name'] = $hotel['hotel_name'];
}
$hotelNameDisable = (count($hotelsInfo) > 1 ? true : false);
$locationDisable = ((count($hotelsInfo) < 2) && !Configuration::get('WK_HOTEL_NAME_ENABLE')) ? true : false;
$this->fields_options = array(
@@ -142,6 +145,13 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
'hint' => $this->l('The year when your hotel site was launched.'),
'type' => 'text',
),
'WK_PRIMARY_HOTEL' => array(
'title' => $this->l('Primary hotel'),
'hint' => $this->l('Primary hotel is used to default address for your business. The hotel address will be considered as your registered business address.'),
'type' => 'select',
'identifier' => 'id',
'list' => $hotelsInfo,
),
'WK_HTL_CHAIN_NAME' => array(
'title' => $this->l('Hotel Name'),
'type' => 'textLang',

View File

@@ -88,7 +88,7 @@ class AdminOrderRefundRulesController extends ModuleAdminController
'callback' => 'setOrderCurrency',
),
'days' => array(
'title' => $this->l('Days'),
'title' => $this->l('Days Before Check-in'),
'align' => 'center',
)
);

View File

@@ -227,6 +227,30 @@ function initGoogleMaps() {
$(document).ready(function() {
//For Add Hotels
// hotel status change
$("#form-htl_branch_info a.list-action-enable.action-enabled").on('click', function(e) {
let id_hotel = $(this).closest('tr').find('.row-selector input').val();
if (id_hotel == primaryHotelId) {
if (!confirm(disableHotelMsg)) {
e.preventDefault();
e.stopImmediatePropagation();
return false;
}
}
});
$("form#htl_branch_info_form").on('submit', function(e) {
let id_hotel = $(this).find('#id-hotel').val();
let enable = $(this).find('[name="ENABLE_HOTEL"]:checked').val();
if (id_hotel == primaryHotelId && !parseInt(enable)) {
if (!confirm(disableHotelMsg)) {
e.preventDefault();
e.stopImmediatePropagation();
return false;
}
}
});
// delete hotel image
$('.deleteHtlImage').on('click', function(){
var imgId = $(this).attr('id_htl_img');

View File

@@ -279,6 +279,7 @@ $(document).ready(function() {
{
let occupancy;
if (occupancy_required_for_booking) {
$('.booking_occupancy_wrapper').parent().removeClass('open');
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
if (selected_occupancy.length) {
occupancy = [];
@@ -305,7 +306,6 @@ $(document).ready(function() {
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open');
occupancy = false;
return false;
}
});
} else {

View File

@@ -49,4 +49,34 @@ $(document).ready(function() {
}
$('#generateCreditSlip').change();
});
$(document).on('keyup', '#order_return_form .table input[name^="refund_amounts"]', function() {
let refundAmountInputs = $('#order_return_form .table input[name^="refund_amounts"]');
let disableRefundOptions = false;
$(refundAmountInputs).each(function(index, element) {
let val = parseFloat($(element).val().trim());
if (isNaN(val)) { // if at least one amount input is empty
disableRefundOptions = true;
return;
}
});
if (!disableRefundOptions) {
let hasAllZero = true;
$(refundAmountInputs).each(function(index, element) {
let val = parseFloat($(element).val().trim());
if (val != 0) {
hasAllZero = false;
return;
}
});
if (hasAllZero) { // if all amount inputs are 0
disableRefundOptions = true;
}
}
$('#generateCreditSlip, #refundTransactionAmount, #generateDiscount').attr('disabled', disableRefundOptions);
});
});

View File

@@ -398,7 +398,7 @@
<th>{l s='Name' mod='hotelreservationsystem'}</th>
<th>{l s='Full payment charges' mod='hotelreservationsystem'}</th>
<th>{l s='Advance payment charges' mod='hotelreservationsystem'}</th>
<th>{l s='Days before cancelation' mod='hotelreservationsystem'}</th>
<th>{l s='Days before check-in' mod='hotelreservationsystem'}</th>
</tr>
</thead>
<tbody id="slides">

View File

@@ -0,0 +1,28 @@
{*
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to 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 <support@webkul.com>
* @copyright 2010-2023 Webkul IN
* @license https://store.webkul.com/license.html
*}
<span title="" data-toggle="tooltip" class="label-tooltip" data-html="true"
data-original-title="{$row['group_names']}" >
{$row['group_access_count']}&nbsp;
{if $row['group_access_count'] > 1}
{l s='Groups' mod='hotelreservationsystem'}
{else}
{l s='Group' mod='hotelreservationsystem'}
{/if}
</span>

View File

@@ -207,7 +207,7 @@
{l s='Increase Price' mod='hotelreservationsystem'}
</option>
<option value="{HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE}" {if isset($objFeaturePrice->impact_way) && $objFeaturePrice->impact_way == HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE}selected = "selected"{/if}>
{l s='Fix Price' mod='hotelreservationsystem'}
{l s='Fixed Price' mod='hotelreservationsystem'}
</option>
</select>
</div>
@@ -223,10 +223,9 @@
{l s='Percentage' mod='hotelreservationsystem'}
</option>
<option value="{HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE}" {if isset($objFeaturePrice->impact_type) && $objFeaturePrice->impact_type == HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE}selected = "selected"{/if}>
{l s='Fixed Price' mod='hotelreservationsystem'}
{l s='Amount' mod='hotelreservationsystem'}
</option>
</select>
<input type="hidden" id="price_impact_type_input" name="price_impact_type" value="{if isset($objFeaturePrice->impact_type)}{$objFeaturePrice->impact_type}{/if}">
</div>
</div>
@@ -262,8 +261,8 @@
{* select group accesses *}
<div class="form-group">
<label class="control-label col-lg-3">
<span class="label-tooltip" data-toggle="tooltip" data-html="true" data-original-title="{l s='Select all the groups that you would like to apply to this advanced price rule.' mod='hotelreservationsystem'}">{l s='Group access' mod='hotelreservationsystem'}</span>
<label class="control-label required col-lg-3">
<span class="label-tooltip required" data-toggle="tooltip" data-html="true" data-original-title="{l s='Select all the groups that you would like to apply to this advanced price rule.' mod='hotelreservationsystem'}">{l s='Group access' mod='hotelreservationsystem'}</span>
</label>
<div class="col-lg-6">
<div class="table-responsive">
@@ -279,7 +278,13 @@
{foreach $groups as $group}
<tr>
<td class="text-center">
<input type="checkbox" name="groupBox[]" value="{$group['id_group']|escape:'html':'UTF-8'}" {if isset($feature_price_groups) && $feature_price_groups && $group['id_group']|in_array:$feature_price_groups}checked{/if}/>
<input type="checkbox" name="groupBox[]" value="{$group['id_group']|escape:'html':'UTF-8'}"
{if isset($feature_price_groups) && $feature_price_groups && $group['id_group']|in_array:$feature_price_groups}
checked
{elseif empty($objFeaturePrice->id)}
checked
{/if}
/>
</td>
<td class="text-center">{$group['name']|escape:'html':'UTF-8'}</td>
</tr>

View File

@@ -148,7 +148,7 @@
{displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']}
{else}
<span class="input-group-addon">{$orderCurrency['sign']|escape:'html':'UTF-8'}</span>
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]">
<input placeholder="" type="text" name="refund_amounts[{$booking['id_order_return_detail']|escape:'html':'UTF-8'}]" value="{$booking['total_paid_amount'] - $booking['cancelation_charge']}">
<span class="input-group-addon">{l s='tax incl.' mod='hotelreservationsystem'}</span>
{/if}
</div>

View File

@@ -113,7 +113,7 @@
<div class="form-group">
<label for="cancelation_days" class="required control-label col-lg-3">
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title='{l s="Enter number of days before check-in date for this rule to be applicable." mod="hotelreservationsyatem"}'>{l s='Days before cancellation' mod="hotelreservationsyatem"}</span>
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title='{l s="Enter number of days before check-in date for this rule to be applicable." mod="hotelreservationsyatem"}'>{l s='Days before check-in' mod="hotelreservationsyatem"}</span>
</label>
<div class="col-lg-2">
<input class="form-control" type="text" id="cancelation_days" name="cancelation_days" {if isset($edit)} {if isset($refund_rules_info['days'])}style = "display:block;" value="{$refund_rules_info['days']}" {/if}{/if}>

View File

@@ -21,9 +21,13 @@
<label class="control-label col-lg-3">{l s='Customer' mod='qlohotelreview'}</label>
<div class="col-lg-9">
<p class="form-control-static">
<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$obj_customer->id}" target="_blank">
{$obj_customer->firstname} {$obj_customer->lastname} (#{$obj_customer->id})
</a>
{if isset($obj_customer) && $obj_customer}
<a href="{$link->getAdminLink('AdminCustomers')}&viewcustomer&id_customer={$obj_customer->id}" target="_blank">
{$obj_customer->firstname} {$obj_customer->lastname} (#{$obj_customer->id})
</a>
{else}
--
{/if}
</p>
</div>
</div>

View File

@@ -98,6 +98,7 @@ class WkRoomSearchHelper
public function assignSearchPanelVariables()
{
$smartyVars = array();
$context = Context::getContext();
// send if page is landing or not
$smartyVars['is_index_page'] = 0;
if (Tools::getValue('controller') == 'index') {
@@ -127,6 +128,7 @@ class WkRoomSearchHelper
// if category page
$idHotelCategory = Tools::getValue('id_category');
}
$locationCategoryId = Tools::getValue('location');
if ($idHotelCategory) {
if (Validate::isLoadedObject($objCategory = new Category((int) $idHotelCategory))) {
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
@@ -152,11 +154,18 @@ class WkRoomSearchHelper
$searchedData['date_to'] = $dateTo;
$searchedData['htl_dtl'] = $objHotelInfo->hotelBranchesInfo(0, 1, 1, $idHotel);
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
if ($locationCategoryId) {
$objLocationCategory = new Category($locationCategoryId, $context->language->id);
$searchedData['location'] = $objLocationCategory->name;
} else {
$locationCategoryId = $objCategory->id_parent;
$searchedData['location'] = $searchedData['htl_dtl']['city'];
if (isset($searchedData['htl_dtl']['state_name'])) {
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['state_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
}
$searchedData['location'] .= ', '.$searchedData['htl_dtl']['country_name'];
$searchedData['location_category_id'] = $locationCategoryId;
$searchedData['order_date_restrict'] = false;
$max_order_date = HotelOrderRestrictDate::getMaxOrderDate($idHotel);
@@ -191,16 +200,22 @@ class WkRoomSearchHelper
// if location is enabled the send hotels of the selected location only
if ($locationEnabled) {
$hotelsInfo = $objHotelInfo->hotelBranchInfoByCategoryId($idHotelCategory);
$hotelsInfo = Category::getAllCategoriesName($locationCategoryId);
}
}
$totalActiveHotels = count($hotelsInfo);
// set hotels order restrict date on all hotels
foreach ($hotelsInfo as &$hotel) {
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel['id']);
$hotel['max_order_date'] = date('Y-m-d', strtotime($maxOrderDate));
$hotel['preparation_time'] = (int) HotelOrderRestrictDate::getPreparationTime($hotel['id']);
foreach ($hotelsInfo as $key => $hotel) {
if ($hotel_info = $objHotelInfo->hotelBranchInfoByCategoryId($hotel['id_category'])) {
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel_info['id']);
$hotelsInfo[$key]['id'] = $hotel_info['id'];
$hotelsInfo[$key]['hotel_name'] = $hotel_info['hotel_name'];
$hotelsInfo[$key]['max_order_date'] = date('Y-m-d', strtotime($maxOrderDate));
$hotelsInfo[$key]['preparation_time'] = (int) HotelOrderRestrictDate::getPreparationTime($hotel_info['id']);
} else {
unset($hotelsInfo[$key]);
}
}
$smartyVars['location_enabled'] = $locationEnabled;
$smartyVars['total_active_hotels'] = $totalActiveHotels;

View File

@@ -26,7 +26,7 @@ class WkRoomSearchBlockAutoCompleteSearchModuleFrontController extends ModuleFro
$this->display_column_left = false;
$this->display_column_right = false;
$search_data = Tools::getValue('to_search_data');
$city_cat_id = Tools::getValue('hotel_city_cat_id');
$location_category_id = Tools::getValue('location_category_id');
$obj_htl_info = new HotelBranchInformation();
if (isset($search_data) && $search_data) {
$return_data = $obj_htl_info->getHotelCategoryTree($search_data);
@@ -39,17 +39,17 @@ class WkRoomSearchBlockAutoCompleteSearchModuleFrontController extends ModuleFro
$result['status'] = 'success';
$result['data'] = $html;
}
} elseif (isset($city_cat_id) && $city_cat_id) {
$cat_ids = Category::getAllCategoriesName($city_cat_id);
} elseif (isset($location_category_id) && $location_category_id) {
$cat_ids = Category::getAllCategoriesName($location_category_id);
if ($cat_ids) {
$html = '';
foreach ($cat_ids as $value) {
if ($hotel_info = $obj_htl_info->hotelBranchInfoByCategoryId($value['id_category'])) {
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel_info[0]['id']);
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($hotel_info['id']);
$maxOrderDate = date('Y-m-d', strtotime($maxOrderDate));
$html .= '<li tabindex="-1" class="search_result_li" data-id-hotel="'.$hotel_info[0]['id'].'" data-hotel-cat-id="'.
$hotel_info[0]['id_category'].'" data-max_order_date="'.$maxOrderDate.'">'.
$hotel_info[0]['hotel_name'].'</li>';
$html .= '<li tabindex="-1" class="search_result_li" data-id-hotel="'.$hotel_info['id'].'" data-hotel-cat-id="'.
$hotel_info['id_category'].'" data-max_order_date="'.$maxOrderDate.'">'.
$hotel_info['hotel_name'].'</li>';
}
}
$result['status'] = 'success';

View File

@@ -186,14 +186,14 @@ $(document).ready(function() {
// set data on clicking the searched location on dropdown
$(document).on('click', '.location_search_results_ul li', function(e) {
$('#hotel_location').attr('value', $(this).html());
$('#hotel_location').attr('city_cat_id', $(this).val());
$('#location_category_id').val($(this).val());
$('.location_search_results_ul').empty().hide();
$.ajax({
url: autocomplete_search_url,
data: {
hotel_city_cat_id: $('#hotel_location').attr('city_cat_id'),
location_category_id: $('#location_category_id').val(),
},
method: 'POST',
dataType: 'json',
@@ -282,12 +282,12 @@ $(document).ready(function() {
var max_order_date = $("#max_order_date").val();
var error = false;
var locationCatId = $('#hotel_location').attr('city_cat_id');
var location_category_id = $('#location_category_id').val();
var hotelCatId = $('#hotel_cat_id').val();
$('.header-rmsearch-input').removeClass("error_border");
if (hotelCatId == '') {
if (typeof(locationCatId) == 'undefined' || locationCatId == '') {
if (typeof(location_category_id) == 'undefined' || location_category_id == '') {
$("#hotel_location").addClass("error_border");
error = true;
}

View File

@@ -1,7 +1,8 @@
<form method="POST" id="search_hotel_block_form" class="grid">
{if isset($location_enabled) && $location_enabled}
<div class="form-group area-{$column_widths['location']}">
<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'}" city_cat_id="{$search_data['parent_data']['id_category']}"{/if}>
<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}>
<div class="dropdown">
<ul class="location_search_results_ul dropdown-menu"></ul>
</div>

View File

@@ -174,6 +174,10 @@ class WkRoomSearchBlock extends Module
}
}
if ($locationCategoryId = Tools::getValue('location_category_id')) {
$urlData['location'] = $locationCategoryId;
}
$objSearchHelper = new WkRoomSearchHelper();
$this->context->controller->errors = array_merge(
$this->context->controller->errors,

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -92,7 +92,7 @@
<p class="rooms_extra_demands_text">{l s='Add below services to the rooms for better hotel experience'}</p>
</div>
{assign var=roomCount value=1}
{foreach $selectedRoomServiceProduct as $key => $cartRoom}
{foreach $cartRooms as $key => $cartRoom}
<div class="card accordion">
<div class="row accordion-section">
<div class="col-sm-12 demand_header">
@@ -110,7 +110,7 @@
<div class="col-xs-2">
{if $product.available_for_order}
<p class="checkbox">
<input data-id_cart_booking="{$cartRoom['htl_cart_booking_id']}" value="{$product['id_product']|escape:'html':'UTF-8'}" type="checkbox" class="change_room_type_service_product" {if isset($cartRoom['selected_products']) && $cartRoom['selected_products'] && ($product['id_product']|in_array:$cartRoom['selected_products'])}checked{/if} />
<input data-id_cart_booking="{$cartRoom['id']}" value="{$product['id_product']|escape:'html':'UTF-8'}" type="checkbox" class="change_room_type_service_product" {if isset($cartRoom['selected_service']) && $cartRoom['selected_service'] && ($product['id_product']|array_key_exists:$cartRoom['selected_service'])}checked{/if} />
</p>
{/if}
</div>
@@ -118,7 +118,7 @@
<p>{$product['name']|escape:'html':'UTF-8'}</p>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($cartRoom['selected_products']) && $cartRoom['selected_products'] && ($product['id_product']|in_array:$cartRoom['selected_products'])}{$cartRoom['selected_products_info'][$product['id_product']]['quantity']}{else}1{/if}">
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($cartRoom['selected_service']) && $cartRoom['selected_service'] && ($product['id_product']|array_key_exists:$cartRoom['selected_service'])}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">
<div class="qty_controls">
<a href="#" class="qty_up"><span><i class="icon-plus"></i></span></a>
<a href="#" class="qty_down"><span><i class="icon-minus"></i></span></a>

View File

@@ -49,7 +49,7 @@
{/if}
</div>
<div class="col-sm-12 hidden-md hidden-lg">
<p class="capa_txt"><span>{l s='Max Capacity:'}</span><span class="capa_data"> {$room_v['max_adults']|escape:'htmlall':'UTF-8'} {l s='Adults'}, {$room_v['max_children']|escape:'htmlall':'UTF-8'} {l s='child'}</span></p>
<p class="capa_txt"><span>{$room_v['max_guests']|escape:'htmlall':'UTF-8'} {l s='Max guests:'}</span><span class="capa_data"> {$room_v['max_adults']|escape:'htmlall':'UTF-8'} {l s='Adults'}, {$room_v['max_children']|escape:'htmlall':'UTF-8'} {if $room_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}</span></p>
</div>
<div class="col-sm-12 col-md-7 col-lg-6">
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
@@ -57,7 +57,7 @@
<p class="rm_price_cont">
{if $room_v['feature_price_diff'] >= 0}
<span class="rm_price_val {if $room_v['feature_price_diff']>0}room_type_old_price{/if}">
{displayPrice price = $room_v['price_without_reduction']|round:2|floatVal}
{displayPrice price = $room_v['price_without_reduction_with_auto_add']|round:2|floatVal}
</span>
{/if}
{if $room_v['feature_price_diff']}
@@ -69,8 +69,10 @@
</p>
{/if}
</div>
<div class="col-md-4 col-lg-3 visible-md visible-lg">
<div class="capa_txt"><span>{l s='Max Capacity:'}</span><br><span class="capa_data"> {$room_v['max_adults']|escape:'htmlall':'UTF-8'} {l s='Adults'}, {$room_v['max_children']|escape:'htmlall':'UTF-8'} {l s='child'}</span></div>
</div>
<div class="row">
<div class="visible-md visible-lg">
<div class="capa_txt"><span>{$room_v['max_guests']|escape:'htmlall':'UTF-8'} {l s='Max guests:'}</span><br><span class="capa_data"> {$room_v['max_adults']|escape:'htmlall':'UTF-8'} {l s='Adults'}, {$room_v['max_children']|escape:'htmlall':'UTF-8'} {if $room_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}</span></div>
</div>
<div class="col-sm-12 col-md-8 col-lg-9">
<div class="booking_room_fields">

View File

@@ -20,9 +20,15 @@
{if isset($product) && $product}
<li class="row service-product-element">
<div class="col-xs-4 col-sm-3 col-md-2">
<a href="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')|escape:'html':'UTF-8'}" data-fancybox-group="service-products-{$group}" class="fancybox" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}">
<a href="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')|escape:'html':'UTF-8'}" rel="htl-images{$product['id_product']}" class="fancybox" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}">
<img class="img-responsive service-product-img" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}" title="{if !empty($product.legend)}{$product.legend|escape:'html':'UTF-8'}{else}{$product.name|escape:'html':'UTF-8'}{/if}">
</a>
{foreach $product.images as $image}
{if $image['cover'] == 0}
<a href="{$link->getImageLink($product.link_rewrite, $image.id_image, 'large_default')|escape:'html':'UTF-8'}" rel="htl-images{$product['id_product']}" class="fancybox hidden">
</a>
{/if}
{/foreach}
</div>
<div class="col-xs-8 col-sm-9 col-md-10">
<div class="row">
@@ -36,32 +42,31 @@
{/if}
<div class="col-sm-12 service_product_action_block">
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
{if !$PS_CATALOG_MODE && !$order_date_restrict && ($product.show_price && !isset($restricted_country_mode))}
<span class="service-product-price">
{if !$priceDisplay}{convertPrice price=$product.price_tax_incl}{else}{convertPrice price=$product.price_tax_exc}{/if}
</span>
{/if}
<div>
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
{if ($product.show_price && !isset($restricted_country_mode))}
{if $product.available_for_order && !$PS_CATALOG_MODE && !$order_date_restrict && !((isset($restricted_country_mode) && $restricted_country_mode))}
<button class="btn btn-service-product{if isset($product.selected) && $product.selected} btn-danger remove_roomtype_product{else} btn-success add_roomtype_product{/if} pull-right" data-id-product="{$product.id_product}">{if isset($product.selected) && $product.selected}{l s='Remove'}{else}{l s='Select'}{/if}</button>
{if $product.allow_multiple_quantity && $product.available_for_order}
<div class="qty_container pull-right">
<input type="hidden" class="service_product_qty" id="service_product_qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
<div class="qty_count pull-left">
<span>{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}</span>
</div>
<div class="qty_direction pull-left">
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
</div>
</div>
{/if}
{/if}
{/if}
{if $product.allow_multiple_quantity && $product.available_for_order}
<div class="qty_container pull-right">
<input type="hidden" class="service_product_qty" id="service_product_qty_{$product.id_product}" name="service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}">
<div class="qty_count pull-left">
<span>{if isset($product.quantity_added) && $product.quantity_added}{$product.quantity_added|escape:'html':'UTF-8'}{else}1{/if}</span>
</div>
<div class="qty_direction pull-left">
<a href="#" class="btn btn-default quantity_up service_product_qty_up"><span><i class="icon-plus"></i></span></a>
<a href="#" class="btn btn-default quantity_down service_product_qty_down"><span><i class="icon-minus"></i></span></a>
</div>
</div>
{/if}
</div>
</div>
</div>
</li>

View File

@@ -54,6 +54,16 @@
<input class="form-control validate" data-validate="{$address_validation.$field_name.validate}" type="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{else}{if isset($address->company)}{$address->company|escape:'html':'UTF-8'}{/if}{/if}" />
</div>
{/if}
{if $field_name eq 'vat_number'}
<div id="vat_area">
<div id="vat_number">
<div class="form-group">
<label for="vat-number">{l s='VAT number'}{if isset($required_fields) && in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input type="text" class="form-control validate" data-validate="{$address_validation.$field_name.validate}" id="vat-number" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{else}{if isset($address->vat_number)}{$address->vat_number|escape:'html':'UTF-8'}{/if}{/if}" />
</div>
</div>
</div>
{/if}
{if $field_name eq 'dni'}
{assign var="dniExist" value=true}
<div class="required form-group dni">

View File

@@ -199,6 +199,13 @@
<label for="company">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input type="text" class="form-control" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
</div>
{elseif $field_name eq "vat_number"}
<div id="vat_number" style="display:none;">
<div class="form-group">
<label for="vat-number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input id="vat-number" type="text" class="form-control" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
</div>
</div>
{elseif $field_name eq "dni"}
{assign var='dniExist' value=true}
<div class="required dni form-group">
@@ -290,6 +297,13 @@
<label for="company_invoice">{l s='Company'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input type="text" class="text form-control" id="company_invoice" name="company_invoice" value="{if isset($smarty.post.company_invoice) && $smarty.post.company_invoice}{$smarty.post.company_invoice}{/if}" />
</div>
{elseif $field_name eq "vat_number"}
<div id="vat_number_block_invoice" style="display:none;">
<div class="form-group">
<label for="vat_number_invoice">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input type="text" class="form-control" id="vat_number_invoice" name="vat_number_invoice" value="{if isset($smarty.post.vat_number_invoice) && $smarty.post.vat_number_invoice}{$smarty.post.vat_number_invoice}{/if}" />
</div>
</div>
{elseif $field_name eq "dni"}
{assign var=dniExist value=true}
<div class="required form-group dni_invoice">
@@ -544,6 +558,13 @@
<input type="text" class="form-control" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" />
</p>
{/if}
{elseif $field_name eq "vat_number"}
<div id="vat_number" style="display:none;">
<p class="form-group">
<label for="vat_number">{l s='VAT number'}{if in_array($field_name, $required_fields)} <sup>*</sup>{/if}</label>
<input type="text" class="form-control" id="vat_number" name="vat_number" value="{if isset($smarty.post.vat_number)}{$smarty.post.vat_number}{/if}" />
</p>
</div>
{elseif $field_name eq "firstname"}
<p class="required form-group">
<label for="firstname">{l s='First name'} <sup>*</sup></label>

View File

@@ -108,11 +108,8 @@
p.capa_txt {
margin-bottom: 15px;
}
.capa_data
{
color: #555555;
font-weight: 600;
.visible-md .capa_txt {
padding-left: 15px;
}
.rm_review_cont
@@ -261,7 +258,8 @@ p.capa_txt {
.room_features_cont > div {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
align-items: center;
justify-content: space-between;
gap: 10px 0;
}
.booking_room_fields {

View File

@@ -75,10 +75,10 @@
background: #dadada;
}
.date-picker-wrapper .month-wrapper table .day.checked {
background-color: #f2f2f2;
background-color: #E6E6E6;
}
.date-picker-wrapper .month-wrapper table .day.toMonth.hovering {
background-color: #f2f2f2;
background-color: #E6E6E6;
}
.date-picker-wrapper .first-date-selected, .date-picker-wrapper .last-date-selected {
background-color: #1292ff !important;

View File

@@ -1054,7 +1054,6 @@ var ajaxCart = {
},
updateLayer: function(product) {
console.log(product);
// change text labels according to product type
$('#layer_cart .layer_cart_room_txt').hide();
$('#layer_cart .layer_cart_product_txt').hide();
@@ -1288,6 +1287,7 @@ function getBookingOccupancyDetails(bookingform)
{
let occupancy;
if (occupancy_required_for_booking) {
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
if (selected_occupancy.length) {
occupancy = [];
@@ -1303,7 +1303,6 @@ function getBookingOccupancyDetails(bookingform)
if (child_ages.length != $(element).find('.num_children').val()) {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
}
occupancy.push({
@@ -1314,7 +1313,6 @@ function getBookingOccupancyDetails(bookingform)
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
});
} else {

View File

@@ -123,8 +123,12 @@ $(document).ready(function(){
});
$(document).on('click', '.booking_guest_occupancy', function(e) {
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
$(this).parent().toggleClass('open');
if ($(this).parent().hasClass('open')) {
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
} else {
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
$(this).parent().toggleClass('open');
}
});
$(document).on('click', function(e) {
@@ -132,7 +136,10 @@ $(document).ready(function(){
var occupancy_wrapper = $('.booking_occupancy_wrapper:visible');
$(occupancy_wrapper).find(".occupancy_info_block").addClass('selected');
setRoomTypeGuestOccupancy(occupancy_wrapper);
if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length || $(e.target).closest(".remove-room-link").length)) {
if (!($(e.target).closest(".booking_occupancy_wrapper").length
|| $(e.target).closest(".booking_guest_occupancy").length
|| $(e.target).closest(".remove-room-link").length
)) {
let hasErrors = 0;
let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get();
@@ -169,9 +176,12 @@ $(document).ready(function(){
});
}
if (hasErrors == 0) {
$(occupancy_wrapper).parent().removeClass('open');
$(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border');
if (!($(e.target).closest(".ajax_add_to_cart_button").length
|| $(e.target).closest(".exclusive.book_now_submit").length
)) {
$(occupancy_wrapper).parent().removeClass('open');
$(occupancy_wrapper).siblings(".booking_guest_occupancy").removeClass('error_border');
}
$(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]);
} else {
$(occupancy_wrapper).siblings(".booking_guest_occupancy").addClass('error_border');

View File

@@ -422,7 +422,6 @@ $(document).ready(function()
});
$(document).on('change', '.demand_adv_option_block .id_option', function(e) {
debugger
var option_selected = $(this).find('option:selected');
var extra_demand_price = option_selected.attr("optionPrice")
extra_demand_price = parseFloat(extra_demand_price);

View File

@@ -0,0 +1,44 @@
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-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 license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(document).ready(function(){
vat_number();
$(document).on('input', '#company, #company_invoice', function(){
vat_number();
});
});
function vat_number()
{
if ($('#company').length && ($('#company').val() != ''))
$('#vat_number, #vat_number_block').show();
else
$('#vat_number, #vat_number_block').hide();
if ($('#company_invoice').length && ($('#company_invoice').val() != ''))
$('#vat_number_block_invoice').show();
else
$('#vat_number_block_invoice').hide();
}

View File

@@ -326,28 +326,26 @@
</td>
</tr>
{/if}
{if isset($cart_htl_data)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$currency}</span>
</td>
</tr>
{else}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$currency}</span>
</td>
</tr>
{/if}
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$currency}</span>
</td>
</tr>
{else if $orderTotalInfo['total_convenience_fee_ti']}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$currency}</span>
</td>
</tr>
{/if}
<tr class="item">
<td colspan="3"></td>

View File

@@ -44,21 +44,21 @@
<table class="table table-bordered">
<thead>
<tr>
<th>{l s='Refund Id'}</th>
<th>{l s='Order'}</th>
<th>{l s='Total rooms'}</th>
<th>{l s='Refund status'}</th>
<th>{l s='Date requested'}</th>
<th></th>
<th>{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach from=$ordersReturns item=return}
<tr>
<td>
<a href="{$link->getPageLink('order-return', true)|escape:'html':'UTF-8'}&amp;id_order_return={$return.id_order_return|escape:'html':'UTF-8'}">{l s='#'}{$return.id_order_return|escape:'html':'UTF-8'}</a>
#{$return.reference|escape:'html':'UTF-8'}
</td>
<td>
#{$return.reference|escape:'html':'UTF-8'}
{$return.total_rooms|escape:'html':'UTF-8'}
</td>
<td>
<span class="badge wk-badge" style="background-color:{$return.state_color|escape:'html':'UTF-8'}">{$return.state_name|escape:'html':'UTF-8'}</span>

View File

@@ -316,8 +316,5 @@
{if isset($countries)}
{addJsDef countries=$countries}
{/if}
{if isset($vatnumber_ajax_call) && $vatnumber_ajax_call}
{addJsDef vatnumber_ajax_call=$vatnumber_ajax_call}
{/if}
{addJsDef PS_CUSTOMER_ADDRESS_CREATION=$PS_CUSTOMER_ADDRESS_CREATION|intval}
{/strip}

View File

@@ -274,35 +274,33 @@
{displayPrice price=$total_discounts_negative}
</span>
</p>
{if $use_taxes && $show_taxes && $total_tax != 0 }
{* {if $priceDisplay != 0} *}
<p class="cart_total_price {if $total_discounts == 0}unvisible{/if}" >
<span>
{l s='Total'}
{if $display_tax_label}
{if $use_taxes && $priceDisplay == 0}
{l s='(tax incl)'}
{else}
{l s='(tax excl)'}
{/if}
{/if}
</span>
<span class="cart_total_values">
{if $use_taxes && $priceDisplay == 0}
{displayPrice price=$total_price - $convenience_fee_wt}
{* {if $priceDisplay != 0} *}
<p class="cart_total_price {if $total_discounts == 0}unvisible{/if}" >
<span>
{l s='Total'}
{if $display_tax_label}
{if $use_taxes && $priceDisplay == 0}
{l s='(tax incl)'}
{else}
{displayPrice price=$total_price_without_tax - $convenience_fee}
{l s='(tax excl)'}
{/if}
</span>
</p>
{* {/if} *}
{* {if $total_rooms_wt != 0}
<p class="cart_total_tax">
<span>{l s='Tax on rooms'}</span>
<span class="cart_total_values">{displayPrice price=($total_rooms_wt - $total_rooms)}</span>
</p>
{/if} *}
{/if}
{/if}
</span>
<span class="cart_total_values">
{if $use_taxes && $priceDisplay == 0}
{displayPrice price=$total_price - $convenience_fee_wt}
{else}
{displayPrice price=$total_price_without_tax - $convenience_fee}
{/if}
</span>
</p>
{* {/if} *}
{* {if $total_rooms_wt != 0}
<p class="cart_total_tax">
<span>{l s='Tax on rooms'}</span>
<span class="cart_total_values">{displayPrice price=($total_rooms_wt - $total_rooms)}</span>
</p>
{/if} *}
{if $convenience_fee_wt}
<p>
<span>{l s='Convenience Fees'}</span>

View File

@@ -199,13 +199,13 @@
{$product->description}
</div>
</div>
{if isset($product->capacity['adults']) && isset($product->capacity['children']) }
{if isset($room_type_info['adults']) && isset($room_type_info['children']) }
<div class="info_margin_div">
<div class="room_info_heading">
<span>{l s='Max Capacity'}</span>
</div>
<div class="room_info_content">
<p> {$product->capacity['adults']} {l s='Adults'}, {$product->capacity['children']} {l s='child'}</p>
<p>{$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'})</p>
</div>
</div>
{/if}