Merge branch 'develop' into gli-1584
This commit is contained in:
@@ -60,22 +60,39 @@ $exclude_packs = (bool)Tools::getValue('exclude_packs', true);
|
||||
|
||||
$bookingProduct = (int) Tools::getValue('booking_product');
|
||||
|
||||
$idHotel = (int) Tools::getValue('id_hotel');
|
||||
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = '.(int)$context->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||
$sqlSelect = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`';
|
||||
|
||||
$sqlFrom = ' FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p');
|
||||
|
||||
$sqlJoin =' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int) $context->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$context->language->id.')
|
||||
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.`cover`=1 AND image_shop.`id_shop`='.(int) $context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int) $context->language->id.')';
|
||||
|
||||
$sqlWhere = ' WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
|
||||
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
|
||||
(!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' ').
|
||||
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
|
||||
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
|
||||
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '').
|
||||
' GROUP BY p.id_product';
|
||||
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '');
|
||||
|
||||
$sqlGroupBy = ' GROUP BY p.id_product';
|
||||
|
||||
if ($idHotel && $bookingProduct) {
|
||||
// To get hotel info for the booking product only
|
||||
$sqlSelect .= ', hbil.`hotel_name`, hbil.`id` AS id_hotel ';
|
||||
$sqlJoin .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
ON hrt.`id_product` = p.`id_product`
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil
|
||||
ON pl.`id_lang` = hbil.`id_lang` AND hbil.`id` = hrt.`id_hotel`';
|
||||
$sqlWhere .= ' AND hbil.`id`='.(int) $idHotel ;
|
||||
}
|
||||
|
||||
$sql = $sqlSelect.' '.$sqlFrom.' '.$sqlJoin.' '.$sqlWhere.' '.$sqlGroupBy;
|
||||
|
||||
$items = Db::getInstance()->executeS($sql);
|
||||
|
||||
|
||||
@@ -14,18 +14,43 @@
|
||||
.booking_occupancy
|
||||
.booking_occupancy_wrapper
|
||||
max-height: 250px
|
||||
width: 100%
|
||||
overflow-x: auto
|
||||
label.room_num_wrapper
|
||||
text-decoration: underline
|
||||
margin-bottom: 10px
|
||||
|
||||
#booking-documents-modal
|
||||
.documents-list
|
||||
table
|
||||
tbody
|
||||
img
|
||||
max-height: 55px
|
||||
max-width: 55px
|
||||
.documents-list table tbody img
|
||||
max-width: 55px
|
||||
|
||||
.toolbar_order_status_badge
|
||||
font-size: 12px
|
||||
.error_text
|
||||
color: red
|
||||
.room_type_old_price
|
||||
text-decoration: line-through
|
||||
color: #979797
|
||||
font-size: 12px
|
||||
.wk-input-date
|
||||
cursor: text
|
||||
background-color: #F5F8F9
|
||||
#room_status_info_wrapper .margin-bottom-5
|
||||
margin-bottom: 5px
|
||||
#room_status_info_wrapper .room_status_date
|
||||
display: none
|
||||
|
||||
#order_detail_view .panel .panel-heading
|
||||
height: auto
|
||||
padding: 5px 5px 3px 5px
|
||||
a
|
||||
text-transform: none
|
||||
.modal-body .modal-footer
|
||||
padding: 15px 0px 0px 0px
|
||||
.modal-body .tab-content
|
||||
padding: 15px
|
||||
border: 1px solid #ddd
|
||||
|
||||
.loading_overlay
|
||||
display: none
|
||||
position: fixed
|
||||
|
||||
@@ -85,8 +85,8 @@ body
|
||||
.btn-group
|
||||
position: absolute
|
||||
white-space: nowrap
|
||||
top: -2px
|
||||
@include right(2px)
|
||||
top: 2px
|
||||
@include right(6px)
|
||||
a.btn
|
||||
float: none
|
||||
> a.btn
|
||||
@@ -191,6 +191,84 @@ body.display-modal
|
||||
margin: 15px 0 0!important
|
||||
height: 40px!important
|
||||
|
||||
//list header
|
||||
.list_action_wrapper
|
||||
margin-bottom: 15px
|
||||
.list_availibility_container
|
||||
position: relative
|
||||
.dropdown-menu
|
||||
right: 0
|
||||
padding: 8px 12px
|
||||
label
|
||||
font-weight: 400
|
||||
#selected_filter_container
|
||||
background-color: #fff
|
||||
padding: 8px 20px
|
||||
border: solid 1px #d3d8db
|
||||
border-radius: 5px 5px 0 0
|
||||
font-size: 14px
|
||||
min-height: 52px
|
||||
margin-top: 15px
|
||||
.selected_filters > span
|
||||
font-size: 12px
|
||||
padding: 6px 10px
|
||||
display: inline-block
|
||||
background: #F5F8F9
|
||||
border: 1px solid #A0D0EB
|
||||
border-radius: 3px
|
||||
&+ span
|
||||
margin-left: 12px
|
||||
.filter_value
|
||||
font-weight: 700
|
||||
i
|
||||
cursor: pointer
|
||||
|
||||
#list_filters_panel
|
||||
margin-top: 15px
|
||||
margin-bottom: 0
|
||||
#selected_filter_container + #list_filters_panel
|
||||
margin-top: 0
|
||||
#selected_filter_container + div.panel
|
||||
border-top: transparent
|
||||
border-radius: 0 0 5px 5px
|
||||
.list_filters
|
||||
padding: 0 30px
|
||||
display: grid
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr))
|
||||
gap: 8px 40px
|
||||
&>.row
|
||||
display: flex
|
||||
align-items: center
|
||||
.date_range, .input_range
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
gap: 15px
|
||||
.date_range .input-group:first-child
|
||||
margin-bottom: 0
|
||||
label
|
||||
text-align: right
|
||||
font-weight: 400
|
||||
.actions
|
||||
grid-column-start: 1
|
||||
grid-column-end: 4
|
||||
@media (max-width: $screen-desktop)
|
||||
.list_filters
|
||||
grid-template-columns: repeat(2, 1fr)
|
||||
.actions
|
||||
grid-column-start: 1
|
||||
grid-column-end: 3
|
||||
|
||||
@media (max-width: $screen-tablet)
|
||||
.list_filters
|
||||
grid-template-columns: repeat(1, 1fr)
|
||||
.actions
|
||||
grid-column-start: 1
|
||||
grid-column-end: 2
|
||||
label
|
||||
text-align: left
|
||||
|
||||
|
||||
|
||||
//help containers
|
||||
#main.helpOpen
|
||||
width: 70%
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Kill the scroll on the body
|
||||
.modal-open {
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
// Container that the modal scrolls within
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
|
||||
{block name=leadin}
|
||||
{if isset($category_tree)}
|
||||
<div class="bloc-leadin">
|
||||
<div id="container_category_tree">
|
||||
{$category_tree}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -1,101 +0,0 @@
|
||||
{**
|
||||
* 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="modal-body text-center">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="text-left errors-wrap"></div>
|
||||
<div class="documents-list">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{l s='Preview'}</th>
|
||||
<th class="text-left">{l s='Title'}</th>
|
||||
<th class="text-center">{l s='Upload Date'}</th>
|
||||
<th class="text-center">{l s='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="add-new-document-form" style="margin-top: 10px;">
|
||||
<div class="text-left add-new-wrap">
|
||||
<a class="btn btn-primary btn-add-new-document">
|
||||
{l s='Upload new document'}
|
||||
</a>
|
||||
<span></span>
|
||||
</div>
|
||||
<form id="form-add-new-document" class="well" method="post" action="#" style="display: none; margin-top: 5px;">
|
||||
|
||||
<input type="hidden" name="id_htl_booking" value="0">
|
||||
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-2">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Write the title for the document. Invalid characters <>;=#{}'}">
|
||||
{l s='Title'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group fixed-width-xxl">
|
||||
<input type="text" name="title" value="" placeholder="{l s='Eg. Passport, Driving license'}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label required col-sm-2">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Choose the document file to be uploaded.'}">
|
||||
{l s='File'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-file-wrap"></div>
|
||||
<div class="input-group fixed-width-xxl">
|
||||
<span class="input-group-addon"><i class="icon-file"></i></span>
|
||||
<input type="text" class="file-name" readonly="">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default btn-add-file">
|
||||
<i class="icon-folder-open"></i>
|
||||
{l s='Add file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-left" style="margin-top: 4px; font-style: italic;">
|
||||
{l s='Upload a PDF or an image file. Allowed image formats: .gif, .jpg, .jpeg and .png'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix btn-group-add-new">
|
||||
<button class="btn btn-primary pull-right upload" type="submit" name="submitAddPayment">
|
||||
{l s='Upload'}
|
||||
</button>
|
||||
<button class="btn btn-default pull-left cancel">
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
|
||||
@@ -1,233 +0,0 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
{if $product['customizedDatas']}
|
||||
{* Assign product price *}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var=product_price value=($product['unit_price_tax_excl'] + $product['ecotax'])}
|
||||
{else}
|
||||
{assign var=product_price value=$product['unit_price_tax_incl']}
|
||||
{/if}
|
||||
<tr class="customized customized-{$product['id_order_detail']|intval} product-line-row">
|
||||
<td>
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
{if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$product['product_id']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
|
||||
<span class="productName">{$product['product_name']} - {l s='Customized'}</span><br />
|
||||
{if ($product['product_reference'])}{l s='Reference number:'} {$product['product_reference']}<br />{/if}
|
||||
{if ($product['product_supplier_reference'])}{l s='Supplier reference:'} {$product['product_supplier_reference']}{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span class="product_price_show">{displayPrice price=$product_price currency=$currency->id|intval}</span>
|
||||
{if $can_edit}
|
||||
<div class="product_price_edit" style="display:none;">
|
||||
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
<div class="form-group">
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}" size="5" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="fixed-width-xl">
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}" size="5" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="productQuantity text-center">{$product['customizationQuantityTotal']}</td>
|
||||
{if $display_warehouse}<td> </td>{/if}
|
||||
{if ($order->hasBeenPaid())}<td class="productQuantity text-center">{$product['customizationQuantityRefunded']}</td>{/if}
|
||||
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<td class="productQuantity text-center">{$product['customizationQuantityReturned']}</td>{/if}
|
||||
{if $stock_management}<td class="text-center">{$product['current_stock']}</td>{/if}
|
||||
<td class="total_product">
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{displayPrice price=($product['unit_price_tax_excl'] * $product['customizationQuantityTotal']) currency=$currency->id|intval}
|
||||
{else}
|
||||
{displayPrice price=($product['unit_price_tax_incl'] * $product['customizationQuantityTotal']) currency=$currency->id|intval}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none" colspan="2">
|
||||
|
||||
</td>
|
||||
<td class="edit_product_fields" colspan="2" style="display:none"> </td>
|
||||
<td class="partial_refund_fields current-edit" style="text-align:left;display:none;"></td>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default edit_product_change_link">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="delete_product_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{* Update controls *}
|
||||
<button type="button" class="btn btn-default submitProductChange" style="display: none;">
|
||||
<i class="icon-ok"></i>
|
||||
{l s='Update'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default cancel_product_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{foreach $product['customizedDatas'] as $customizationPerAddress}
|
||||
{foreach $customizationPerAddress as $customizationId => $customization}
|
||||
<tr class="customized customized-{$product['id_order_detail']|intval}">
|
||||
<td colspan="2">
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
<div class="form-horizontal">
|
||||
{foreach $customization.datas as $type => $datas}
|
||||
{if ($type == Product::CUSTOMIZE_FILE)}
|
||||
{foreach from=$datas item=data}
|
||||
<div class="form-group">
|
||||
<span class="col-lg-4 control-label"><strong>{if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}</strong></span>
|
||||
<div class="col-lg-8">
|
||||
<a href="displayImage.php?img={$data['value']}&name={$order->id|intval}-file{$data@iteration}" class="_blank">
|
||||
<img class="img-thumbnail" src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt=""/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{elseif ($type == Product::CUSTOMIZE_TEXTFIELD)}
|
||||
{foreach from=$datas item=data}
|
||||
<div class="form-group">
|
||||
<span class="col-lg-4 control-label"><strong>{if $data['name']}{l s='%s' sprintf=$data['name']}{else}{l s='Text #%s' sprintf=$data@iteration}{/if}</strong></span>
|
||||
<div class="col-lg-8">
|
||||
<p class="form-control-static">{$data['value']}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td class="productQuantity text-center">
|
||||
<span class="product_quantity_show{if (int)$customization['quantity'] > 1} red bold{/if}">{$customization['quantity']}</span>
|
||||
{if $can_edit}
|
||||
<span class="product_quantity_edit" style="display:none;">
|
||||
<input type="text" name="product_quantity[{$customizationId|intval}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
{if $display_warehouse}<td> </td>{/if}
|
||||
{if ($order->hasBeenPaid())}
|
||||
<td class="text-center">
|
||||
{if !empty($product['amount_refund'])}
|
||||
{l s='%s (%s refund)' sprintf=[$customization['quantity_refunded'], $product['amount_refund']]}
|
||||
{/if}
|
||||
<input type="hidden" value="{$product['quantity_refundable']}" class="partialRefundProductQuantity" />
|
||||
<input type="hidden" value="{(Tools::ps_round($product_price, 2) * ($product['product_quantity'] - $product['customizationQuantityTotal']))}" class="partialRefundProductAmount" />
|
||||
</td>
|
||||
{/if}
|
||||
{if ($order->hasBeenDelivered())}<td class="text-center">{$customization['quantity_returned']}</td>{/if}
|
||||
<td class="text-center">-</td>
|
||||
<td class="total_product">
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{displayPrice price=($product['unit_price_tax_excl'] * $customization['quantity']) currency=$currency->id|intval}
|
||||
{else}
|
||||
{displayPrice price=($product['unit_price_tax_incl'] * $customization['quantity']) currency=$currency->id|intval}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cancelCheck standard_refund_fields current-edit" style="display:none">
|
||||
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']|intval}" />
|
||||
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']|intval}" />
|
||||
<input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
|
||||
{if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))}
|
||||
<input type="checkbox" name="id_customization[{$customizationId|intval}]" id="id_customization[{$customizationId|intval}]" value="{$product['id_order_detail']|intval}" onchange="setCancelQuantity(this, {$customizationId|intval}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none">
|
||||
{if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])}
|
||||
<input type="hidden" name="cancelCustomizationQuantity[{$customizationId|intval}]" value="0" />
|
||||
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
|
||||
<input type="text" id="cancelQuantity_{$customizationId|intval}" name="cancelCustomizationQuantity[{$customizationId|intval}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" colspan="2" style="display:none; width: 250px;">
|
||||
{if $product['quantity_refundable'] > 0}
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{assign var='amount_refundable' value=$product['amount_refundable']}
|
||||
{else}
|
||||
{assign var='amount_refundable' value=$product['amount_refundable_tax_incl']}
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<div class="{if $product['amount_refundable'] > 0}col-lg-4{else}col-lg-12{/if}">
|
||||
<label class="control-label">
|
||||
{l s='Quantity:'}
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<input onchange="checkPartialRefundProductQuantity(this)" type="text" name="partialRefundProductQuantity[{$product['id_order_detail']|intval}]" value="{if ($customization['quantity']-$customization['quantity_refunded']) >0}1{else}0{/if}" />
|
||||
<div class="input-group-addon">/ {$product['quantity_refundable']}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{if $product['quantity_refundable'] > 0}col-lg-8{else}col-lg-12{/if}">
|
||||
<label class="control-label">
|
||||
<span class="title_box ">{l s='Amount:'}</span>
|
||||
<small class="text-muted">({$smarty.capture.TaxMethod})</small>
|
||||
</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input onchange="checkPartialRefundProductAmount(this)" type="text" name="partialRefundProduct[{$product['id_order_detail']|intval}]" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
<p class="help-block"><i class="icon-warning-sign"></i> {l s='(Max %s %s)' sprintf=[Tools::displayPrice(Tools::ps_round($amount_refundable, 2), $currency->id), $smarty.capture.TaxMethod]}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="edit_product_fields" colspan="2" style="display:none"></td>
|
||||
<td class="product_action" style="text-align:right"></td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{/if}
|
||||
@@ -1,110 +0,0 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<div class="form-horizontal well">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Name'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input class="form-control" type="text" name="discount_name" value="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Type'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<select class="form-control" name="discount_type" id="discount_type">
|
||||
<option value="1">{l s='Percent'}</option>
|
||||
<option value="2">{l s='Amount'}</option>
|
||||
{*<option value="3">{l s='Free shipping'}</option>*}<!-- By webkul no need of free shipping voucher -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="discount_value_field" class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Value'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span id="discount_currency_sign" style="display: none;">{$currency->sign}</span>
|
||||
<span id="discount_percent_symbol">%</span>
|
||||
</div>
|
||||
<input class="form-control" type="text" name="discount_value"/>
|
||||
</div>
|
||||
<p class="text-muted" id="discount_value_help" style="display: none;">
|
||||
{l s='This value must include taxes.'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if $order->hasInvoice()}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Invoice'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<select name="discount_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" selected="selected">
|
||||
{$invoice->getInvoiceNumberFormatted($current_id_lang)} - {displayPrice price=$invoice->total_paid_tax_incl currency=$order->id_currency}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<p class="checkbox">
|
||||
<label class="control-label" for="discount_all_invoices">
|
||||
<input type="checkbox" name="discount_all_invoices" id="discount_all_invoices" value="1" />
|
||||
{l s='Apply on all invoices'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="help-block">
|
||||
{l s='If you chooses to create this discount for all invoices, only one discount will be created per order invoice.'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-lg-offset-3">
|
||||
<button class="btn btn-default" type="button" id="cancel_add_voucher">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
<button class="btn btn-default" type="submit" name="submitNewVoucher">
|
||||
<i class="icon-ok text-success"></i>
|
||||
{l s='Add'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,113 +38,90 @@
|
||||
<th>
|
||||
<span class="title_box ">{l s='Amount'}</span>
|
||||
</th>
|
||||
<th></th>
|
||||
<th><span class="title_box ">{l s='Note'}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$order->getDocuments() item=document}
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<tr id="invoice_{$document->id}">
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
<tr id="orderslip_{$document->id}">
|
||||
{/if}
|
||||
<td>{dateFormat date=$document->date_add}</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{l s='Invoice'}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{l s='Credit Slip'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}">
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}">
|
||||
{/if}
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}
|
||||
{if $document->getTotalPaid()}
|
||||
<span>
|
||||
{if $document->getRestPaid() > 0}
|
||||
({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})
|
||||
{elseif $document->getRestPaid() < 0}
|
||||
({displayPrice price=-$document->getRestPaid() currency=$currency->id} {l s='overpaid'})
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{displayPrice price=$document->total_products_tax_incl+$document->total_shipping_tax_incl currency=$currency->id}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right document_action">
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{if $document->getRestPaid()}
|
||||
<a href="#form_add_payment_panel" class="js-set-payment btn btn-default anchor" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}">
|
||||
<i class="icon-money"></i>
|
||||
{l s='Enter payment'}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
<a href="#" class="btn btn-default" onclick="$('#invoiceNote{$document->id}').show(); return false;" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}">
|
||||
{if $document->note eq ''}
|
||||
<i class="icon-plus-sign-alt"></i>
|
||||
{l s='Add note'}
|
||||
{else}
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit note'}
|
||||
{/if}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<tr id="invoiceNote{$document->id}" style="display:none">
|
||||
<td colspan="5">
|
||||
<form action="{$current_index}&viewOrder&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
|
||||
<p>
|
||||
<label for="editNote{$document->id}" class="t">{l s='Note'}</label>
|
||||
<input type="hidden" name="id_order_invoice" value="{$document->id}" />
|
||||
<textarea name="note" id="editNote{$document->id}" class="edit-note textarea-autosize">{$document->note|escape:'html':'UTF-8'}</textarea>
|
||||
</p>
|
||||
<p>
|
||||
<button type="submit" name="submitEditNote" class="btn btn-default">
|
||||
<i class="icon-save"></i>
|
||||
{l s='Save'}
|
||||
</button>
|
||||
<a class="btn btn-default" href="#" id="cancelNote" onclick="$('#invoiceNote{$document->id}').hide();return false;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</a>
|
||||
</p>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{foreachelse}
|
||||
<tr>
|
||||
{if $orderDocuments|count}
|
||||
{foreach from=$orderDocuments item=document}
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<tr id="invoice_{$document->id}">
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
<tr id="orderslip_{$document->id}">
|
||||
{/if}
|
||||
<td>{dateFormat date=$document->date_add}</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{l s='Invoice'}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{l s='Credit Slip'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateInvoicePDF&id_order_invoice={$document->id}">
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
<a class="_blank" title="{l s='See the document'}" href="{$link->getAdminLink('AdminPdf')|escape:'html':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$document->id}">
|
||||
{/if}
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
|
||||
{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
{displayPrice price=$document->total_paid_tax_incl currency=$currency->id}
|
||||
{if $document->getTotalPaid()}
|
||||
<span>
|
||||
{if $document->getRestPaid() > 0}
|
||||
({displayPrice price=$document->getRestPaid() currency=$currency->id} {l s='not paid'})
|
||||
{elseif $document->getRestPaid() < 0}
|
||||
({displayPrice price=-$document->getRestPaid() currency=$currency->id} {l s='overpaid'})
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{elseif get_class($document) eq 'OrderSlip'}
|
||||
{displayPrice price=$document->total_products_tax_incl+$document->total_shipping_tax_incl currency=$currency->id}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="document_action">
|
||||
{if get_class($document) eq 'OrderInvoice'}
|
||||
<a href="#" class="btn btn-default add_document_note" data-id_order_invoice="{$document->id}" data-edit_note="{$document->note|escape:'html':'UTF-8'}" title="{if $document->note eq ''}{l s='Add note'}{else}{l s='Edit note'}{/if}">
|
||||
{if $document->note eq ''}
|
||||
<i class="icon-file-alt"></i> {l s='Add note'}
|
||||
{else}
|
||||
<i class="icon-pencil"></i> {l s='Edit note'}
|
||||
{/if}
|
||||
</a>
|
||||
{if $document->getRestPaid()}
|
||||
<a href="#form_add_payment_panel" class="btn btn-default js-set-payment anchor pull-right" data-amount="{$document->getRestPaid()}" data-id-invoice="{$document->id}" title="{l s='Set payment form'}">
|
||||
<i class="icon-money"></i> {l s='Enter payment'}
|
||||
</a>
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="5" class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='There is no available document'}
|
||||
</div>
|
||||
{if isset($invoice_management_active) && $invoice_management_active}
|
||||
<a class="btn btn-default" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}">
|
||||
<i class="icon-repeat"></i>
|
||||
{l s='Generate invoice'}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{if !$orderDocuments|count && isset($invoice_management_active) && $invoice_management_active}
|
||||
<div class="well hidden-print">
|
||||
<a class="btn btn-primary" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}">
|
||||
<i class="icon-file-text"></i> {l s='Generate invoice'}
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -68,7 +68,7 @@
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy">
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy disabled" type="button">
|
||||
<button class="booking_guest_occupancy form-control btn btn-default btn-left btn-block input-occupancy disabled" type="button">
|
||||
<span>{l s='Select occupancy'}</span>
|
||||
</button>
|
||||
<input type="hidden" class="max_avail_type_qty" value="">
|
||||
|
||||
@@ -24,39 +24,17 @@
|
||||
*}
|
||||
|
||||
<tr class="product-line-row" data-id_htl_booking="{$data.id|escape:'html':'UTF-8'}" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-id_order_detail="{$data.id_order_detail}">
|
||||
{if $refund_allowed}
|
||||
<td class="standard_refund_fields" style="display:none">
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$data.id|escape:'html':'UTF-8'}" {if (isset($refundReqBookings) && ($data.id|in_array:$refundReqBookings)) || $data.is_refunded}disabled{/if}/>
|
||||
</td>
|
||||
{/if}
|
||||
<td class="text-center">
|
||||
<p>{$data.room_num}</p>
|
||||
<td>
|
||||
<p>{$data.room_num}</p>
|
||||
{if $data.is_back_order}
|
||||
<span class="overbooked_room">{l s='overbooked'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<img src="{$data.image_link}" title="Room image" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<p>{$data.room_type}</p>
|
||||
{* <p class="room_extra_demands {if !isset($data['extra_demands']) || !$data['extra_demands']}edit_product_fields{/if}" {if (!isset($data['extra_demands']) || !$data['extra_demands']) && (!isset($data['additional_services']) || !$data['additional_services'])}style="display: none;"{/if}>
|
||||
<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">
|
||||
{l s='Extra Services'}
|
||||
</a>
|
||||
</p> *}
|
||||
{* {if (isset($data['extra_demands']) && $data['extra_demands']) || (isset($data['additional_services']) && $data['additional_services'])}
|
||||
<p>
|
||||
{convertPriceWithCurrency price=($data['extra_demands_price_ti'] + $data['additional_services_price_ti']) currency=$currency->id}
|
||||
</p>
|
||||
{/if} *}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']}&updatehtl_branch_info" target="_blank">
|
||||
<span>{$data['hotel_name']}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
</td>
|
||||
<td><img src="{$data.image_link}" title="{l s='Room image'}"></td>
|
||||
<td>
|
||||
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$data.id_product}&updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
|
||||
</td>
|
||||
<td>
|
||||
<span class="booking_duration_show">{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</span>
|
||||
|
||||
{if $can_edit}
|
||||
@@ -65,7 +43,7 @@
|
||||
<div class="fixed-width-xl room_check_in_div">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{l s='Check In'}</div>
|
||||
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
|
||||
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" data-min_date="{$data.date_from|date_format:"%d-%m-%Y"}"/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,12 +59,12 @@
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
{if $data['children']}
|
||||
<div class="dropdown booking_occupancy_show">
|
||||
<button class="btn btn-default btn-left btn-block" data-toggle="dropdown" type="button">
|
||||
<a data-toggle="dropdown">
|
||||
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
</button>
|
||||
</a>
|
||||
<div class="dropdown-menu well well-sm">
|
||||
<label>{l s='Children Ages'}</label>
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
@@ -101,8 +79,7 @@
|
||||
{else}
|
||||
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
{/if}
|
||||
|
||||
<div class="booking_occupancy_edit" style="display:none;">
|
||||
<div class="booking_occupancy_edit" style="display:none;">
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
@@ -160,13 +137,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
<span class="room_unit_price_show">
|
||||
{* {if $data['feature_price_diff'] != 0}
|
||||
<span class="product_original_price room_type_old_price">
|
||||
{convertPriceWithCurrency price=$data['unit_price_without_reduction_tax_excl'] currency=$currency->id}
|
||||
</span>
|
||||
{/if} *}
|
||||
<p>
|
||||
<span class="room_type_current_price">
|
||||
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
|
||||
@@ -175,29 +147,29 @@
|
||||
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
|
||||
</span>
|
||||
<div class="room_unit_price_edit" style="display: none;">
|
||||
<input type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
|
||||
<input class="form-control" type="text" class="room_unit_price" name="room_unit_price" value="{$data['paid_unit_price_tax_excl']}">
|
||||
<p class="help-block">{l s='Set per day price'}</p>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
<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}
|
||||
{if $data['extra_demands']|count || $data['additional_services']|count}
|
||||
<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']}">
|
||||
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" 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']}">
|
||||
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" 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>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
<span class="product_price_show">{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}</span>
|
||||
{if $can_edit}
|
||||
<div class="product_price_edit" style="display:none;">
|
||||
@@ -222,7 +194,7 @@
|
||||
{/if}
|
||||
</td>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
|
||||
<td class="text-center">
|
||||
<td>
|
||||
{if $data.is_cancelled}
|
||||
<span class="badge badge-danger">{l s='Cancelled'}</span>
|
||||
{elseif isset($data.refund_info) && $data.refund_info}
|
||||
@@ -231,9 +203,11 @@
|
||||
<span>--</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
{if isset($data.refund_info) && $data.refund_info}
|
||||
{convertPriceWithCurrency price=$data.refund_info.refunded_amount currency=$currency->id}
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
@@ -242,7 +216,7 @@
|
||||
{if sizeof($invoices_collection)}
|
||||
<select name="product_invoice" class="edit_product_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" {*{if $invoice->id == $product['id_order_invoice']}selected="selected"{/if}*}>
|
||||
<option value="{$invoice->id}">
|
||||
#{Configuration::get('PS_INVOICE_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$invoice->number}
|
||||
</option>
|
||||
{/foreach}
|
||||
@@ -251,40 +225,37 @@
|
||||
|
||||
{/if}
|
||||
</td>
|
||||
<td class="product_action text-right">
|
||||
{* edit/delete controls *}
|
||||
<div class="btn-group pull-right">
|
||||
<button type="button" class="btn btn-default edit_room_change_link">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate/Swap Room'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<td class="product_action">
|
||||
<div class="btn-group">
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}
|
||||
<button href="#" class="btn btn-default delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</button>
|
||||
{else}
|
||||
<button href="#" class="btn btn-default edit_room_change_link" data-product_line_data="{$data|json_encode|escape}">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="room_reallocate_swap" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate/Swap Room'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{* Update controls *}
|
||||
<button type="button" class="btn btn-default submitRoomChange" style="display: none;">
|
||||
<i class="icon-ok"></i>
|
||||
{l s='Update'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default cancel_room_change_link" style="display: none;">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
</tr>
|
||||
@@ -1,58 +0,0 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<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">
|
||||
<div class="tab-content clearfix">
|
||||
{include file='controllers/orders/_room_facilities_block.tpl'}
|
||||
{include file='controllers/orders/_room_services_block.tpl'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Css for handling extra demands changes *}
|
||||
<style type="text/css">
|
||||
/*Extra demands CSS*/
|
||||
#room_extra_demand_content .modal-header {
|
||||
padding-bottom: 0px;}
|
||||
#rooms_type_extra_demands .modal-title {
|
||||
margin: 0px;}
|
||||
#rooms_extra_demands .demand_header {
|
||||
padding: 10px;
|
||||
color: #333;
|
||||
border-bottom: 1px solid #ddd;}
|
||||
#rooms_extra_demands .room_demand_block {
|
||||
margin-bottom: 15px;
|
||||
color: #333;
|
||||
font-size: 14px;}
|
||||
#rooms_extra_demands .facility_nav_btn {
|
||||
margin-bottom: 20px;}
|
||||
#rooms_extra_demands .room_demands_container, #rooms_extra_demands .room_services_container {
|
||||
display: none;}
|
||||
#room_extra_demand_content #save_room_demands, #room_extra_demand_content #back_to_demands_btn, #room_extra_demand_content #save_service_service, #room_extra_demand_content #back_to_service_btn {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
@@ -1,49 +1,62 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
{if $refund_allowed}
|
||||
<th class="standard_refund_fields" style="display:none"></th>
|
||||
{/if}
|
||||
<th class="text-center"><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Image'}</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='Hotel Name'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Occupancy'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Room Price (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Extra Services/Fee (Tax excl.)'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Tax'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
|
||||
<th class="text-center"><span class="title_box">{l s='Refund/Cancellation Status'}</span></th>
|
||||
<th class="text-center"><span class="title_box">{l s='Refunded amount'}</span></th>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Edit Order'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $order_detail_data}
|
||||
{foreach from=$order_detail_data item=data}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_product_line.tpl'}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td class="list-empty" colspan="14">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No rooms found'}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_new_product.tpl'}
|
||||
</tbody>
|
||||
</table>
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{if $order_detail_data}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.'}</span></th>
|
||||
<th><span class="title_box">{l s='Image'}</th>
|
||||
<th><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration'}</span></th>
|
||||
<th class="fixed-width-lg"><span class="title_box">{l s='Occupancy'}</span></th>
|
||||
<th><span class="title_box">{l s='Room Price (Tax excl.)'}</span></th>
|
||||
<th><span class="title_box">{l s='Extra Services/Fee (Tax excl.)'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Tax'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
|
||||
<th><span class="title_box">{l s='Refund/Cancel Status'}</span></th>
|
||||
<th><span class="title_box">{l s='Refunded amount'}</span></th>
|
||||
{/if}
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<th class="fixed-width-md"><span class="title_box">{l s='Actions'}</th>
|
||||
{/if}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$order_detail_data item=data}
|
||||
{* Include product line partial *}
|
||||
{include file='controllers/orders/_product_line.tpl'}
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='Room information not available.'}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,3 +1,22 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<table class="table" id="customer_products_details" {if !$order_service_products}style="display:none"{/if}>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -65,446 +65,91 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
{block name="tableFilter"}{/block}
|
||||
{block name="override_form_extra"}
|
||||
{if !$simple_header && $show_filters}
|
||||
<script>
|
||||
$(function() {
|
||||
if ($("#list_filters_panel .datepicker").length > 0) {
|
||||
$("#list_filters_panel .datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
altFormat: 'yy-mm-dd'
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="list_action_wrapper">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-3 col-md-2">
|
||||
<div class="list_availibility_container">
|
||||
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
|
||||
<span>{l s='Available Fields'}
|
||||
<i class="icon-caret-down pull-right"></i>
|
||||
</button>
|
||||
<ul id="optional-list-toggle" class="dropdown-menu">
|
||||
{foreach $fields_optional as $key => $field}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
|
||||
{$field['title']}
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
{assign var="fields_optional" value=array()}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-xs-offset-5 col-sm-2 col-sm-offset-7 col-md-1 col-md-offset-9">
|
||||
<div class="list_filter_container">
|
||||
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
|
||||
<i class="icon-sliders"></i>
|
||||
<span>{l s='Filters'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{if $filters_has_value}
|
||||
<div id="selected_filter_container">
|
||||
{l s='Filters: '}
|
||||
<span class="selected_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if (!isset($params.search) || $params.search) && $params.value != ''}
|
||||
{if ($params.type == 'date' || $params.type == 'datetime' || $params.type == 'range') && $params.value|is_array}
|
||||
{assign var="filter_value" value=''}
|
||||
{foreach $params.value as $value}
|
||||
{if (isset($value) && ($value !== '' || $value === 0))}
|
||||
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
{assign var="filter_value" value=$value}
|
||||
{else}
|
||||
{assign var="filter_value" value="`$filter_value` - `$value`"}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
|
||||
{$params['title']|escape:'html':'UTF-8'}:
|
||||
<span class="filter_value">
|
||||
{foreach from=$params.value item=option name=foreachInfo}
|
||||
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: ' ' : ''}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="panel collapse" id="list_filters_panel">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="list_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if !isset($params.search) || $params.search}
|
||||
<div class="row">
|
||||
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
|
||||
<div class="col-xs-9">
|
||||
{if $params.type == 'range'}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{elseif $params.type == 'bool'}
|
||||
<select id="filter_input_{$key}" class="filter fixed-width-sm center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
|
||||
$('#local_{$params.id_date}_0').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
onClose: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
|
||||
if ((dateFrom && dateTo) && (dateFrom >= dateTo)) {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate());
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
|
||||
if (typeof dateFrom != 'undefined' && dateFrom != '') {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate());
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{else}
|
||||
{if isset($params.filter_key)}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" {if !isset($params.remove_onchange) || !$params.remove_onchange}onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();"{/if} name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $has_actions || $show_filters}
|
||||
<div class="actions">
|
||||
<hr>
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#selected_filter_container .selected_filters span i').on('click', function() {
|
||||
let form = $(this).closest('form');
|
||||
let type = $(this).parent().data('filter_type');
|
||||
$(this).parent().remove();
|
||||
if (type == 'date' || type == 'datetime') {
|
||||
$('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'range') {
|
||||
$('#list_filters_panel').find('[name*="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'select') {
|
||||
$('#list_filters_panel').find('select[name*="orderFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
|
||||
} else {
|
||||
$('#list_filters_panel').find('input[name="orderFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
}
|
||||
function updateRoomTypeFilter() {
|
||||
let filterInputHotelName = $('#filter_input_hotel_name');
|
||||
let filterInputRoomTypeName = $('#filter_input_room_type_name');
|
||||
|
||||
// set post data for empty multi-select filters
|
||||
$(form).find('select[multiple]').each(function (i, selectElement) {
|
||||
if ($(selectElement).find('option:selected').length == 0) {
|
||||
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
|
||||
}
|
||||
});
|
||||
let idHotel = parseInt($(filterInputHotelName).val() || '0');
|
||||
|
||||
form.submit();
|
||||
});
|
||||
$.ajax({
|
||||
url: currentIndex + '&token=' + token,
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'GetHotelRoomTypes',
|
||||
id_hotel: idHotel,
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
if (response.has_room_types) {
|
||||
$(filterInputRoomTypeName).html(response.html_room_types);
|
||||
} else {
|
||||
$(filterInputRoomTypeName).find('option').not(':first').remove();
|
||||
}
|
||||
|
||||
$('#form-order').submit(function () {
|
||||
let form = $(this);
|
||||
$(form).find('select[multiple]').each(function (i, selectElement) {
|
||||
if ($(selectElement).val() == null) {
|
||||
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
function updateRoomTypeFilter() {
|
||||
let filterInputHotelName = $('#filter_input_hotel_name');
|
||||
let filterInputRoomTypeName = $('#filter_input_room_type_name');
|
||||
|
||||
let idHotel = parseInt($(filterInputHotelName).val() || '0');
|
||||
|
||||
$.ajax({
|
||||
url: currentIndex + '&token=' + token,
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'GetHotelRoomTypes',
|
||||
id_hotel: idHotel,
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
if (response.has_room_types) {
|
||||
$(filterInputRoomTypeName).html(response.html_room_types);
|
||||
} else {
|
||||
$(filterInputRoomTypeName).find('option').not(':first').remove();
|
||||
// destroy current chosen and re-initialize
|
||||
$(filterInputRoomTypeName).chosen('destroy');
|
||||
$(filterInputRoomTypeName).chosen({
|
||||
disable_search_threshold: 5,
|
||||
search_contains: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// destroy current chosen and re-initialize
|
||||
$(filterInputRoomTypeName).chosen('destroy');
|
||||
$(filterInputRoomTypeName).chosen({
|
||||
disable_search_threshold: 5,
|
||||
search_contains: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
function updateHotelRoomsFilter(useRoomType = true) {
|
||||
let filterInputHotelName = $('#filter_input_hotel_name');
|
||||
let filterInputRoomTypeName = $('#filter_input_room_type_name');
|
||||
let filterInputRoomNumber = $('#filter_input_id_room_information');
|
||||
|
||||
function updateHotelRoomsFilter(useRoomType = true) {
|
||||
let filterInputHotelName = $('#filter_input_hotel_name');
|
||||
let filterInputRoomTypeName = $('#filter_input_room_type_name');
|
||||
let filterInputRoomNumber = $('#filter_input_id_room_information');
|
||||
let idHotel = parseInt($(filterInputHotelName).val() || '0');
|
||||
let idProduct = parseInt($(filterInputRoomTypeName).val() || '0');
|
||||
|
||||
let idHotel = parseInt($(filterInputHotelName).val() || '0');
|
||||
let idProduct = parseInt($(filterInputRoomTypeName).val() || '0');
|
||||
$.ajax({
|
||||
url: currentIndex + '&token=' + token,
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'GetHotelRooms',
|
||||
id_hotel: idHotel,
|
||||
id_product: useRoomType ? idProduct : 0,
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
if (response.has_hotel_rooms) {
|
||||
$(filterInputRoomNumber).html(response.html_hotel_rooms);
|
||||
} else {
|
||||
$(filterInputRoomNumber).find('option').not(':first').remove();
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: currentIndex + '&token=' + token,
|
||||
data: {
|
||||
ajax: true,
|
||||
action: 'GetHotelRooms',
|
||||
id_hotel: idHotel,
|
||||
id_product: useRoomType ? idProduct : 0,
|
||||
},
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
if (response.has_hotel_rooms) {
|
||||
$(filterInputRoomNumber).html(response.html_hotel_rooms);
|
||||
} else {
|
||||
$(filterInputRoomNumber).find('option').not(':first').remove();
|
||||
// destroy current chosen and re-initialize
|
||||
$(filterInputRoomNumber).chosen('destroy');
|
||||
$(filterInputRoomNumber).chosen({
|
||||
disable_search_threshold: 5,
|
||||
search_contains: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// destroy current chosen and re-initialize
|
||||
$(filterInputRoomNumber).chosen('destroy');
|
||||
$(filterInputRoomNumber).chosen({
|
||||
disable_search_threshold: 5,
|
||||
search_contains: true,
|
||||
});
|
||||
}
|
||||
},
|
||||
// manage Hotel and Room type filter inputs
|
||||
$(document).on('change', '#filter_input_hotel_name', function () {
|
||||
updateRoomTypeFilter();
|
||||
updateHotelRoomsFilter(false);
|
||||
});
|
||||
}
|
||||
|
||||
// manage Hotel and Room type filter inputs
|
||||
$(document).on('change', '#filter_input_hotel_name', function () {
|
||||
updateRoomTypeFilter();
|
||||
updateHotelRoomsFilter(false);
|
||||
});
|
||||
|
||||
$(document).on('change', '#filter_input_room_type_name', function () {
|
||||
updateHotelRoomsFilter();
|
||||
$(document).on('change', '#filter_input_room_type_name', function () {
|
||||
updateHotelRoomsFilter();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.list_action_wrapper {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.list_availibility_container {
|
||||
position: relative;}
|
||||
.list_availibility_container .dropdown-menu {
|
||||
right: 0;
|
||||
padding: 8px 12px;}
|
||||
.list_availibility_container .dropdown-menu label {
|
||||
font-weight: 400;}
|
||||
#selected_filter_container {
|
||||
background-color: #fff;
|
||||
padding: 8px 20px;
|
||||
border: solid 1px #d3d8db;
|
||||
border-radius: 5px 5px 0 0;
|
||||
font-size: 14px;
|
||||
min-height: 52px;
|
||||
margin-top: 15px;}
|
||||
#selected_filter_container .selected_filters > span {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
display: inline-block;
|
||||
background: #F5F8F9;
|
||||
border: 1px solid #A0D0EB;
|
||||
border-radius: 3px;}
|
||||
#selected_filter_container .selected_filters > span + span {
|
||||
margin-left: 12px;}
|
||||
#selected_filter_container .selected_filters > span .filter_value {
|
||||
font-weight: 700;
|
||||
}
|
||||
#selected_filter_container .selected_filters > span i {
|
||||
cursor: pointer;}
|
||||
|
||||
#content.bootstrap #list_filters_panel{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + #list_filters_panel {
|
||||
margin-top: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + div.panel {
|
||||
border-top: transparent;
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
.list_filters {
|
||||
padding: 0 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));;
|
||||
gap: 8px 40px;}
|
||||
.list_filters > .row {
|
||||
display: flex;
|
||||
align-items: center;}
|
||||
.list_filters .date_range, .list_filters .input_range {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 15px;}
|
||||
.list_filters .date_range .input-group:first-child {
|
||||
margin-bottom: 0;}
|
||||
.list_filters label {
|
||||
text-align: right;
|
||||
font-weight: 400;}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 4;}
|
||||
@media (max-width: 992px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(2, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 3;}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(1, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 2;}
|
||||
.list_filters label {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,152 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="new_product">
|
||||
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Room Type:'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="add_product_product_name" class="form-control" value="" placeholder="{l s='Enter the name of the room type'}" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="add_room_fields bookingDuration" style="display:none;">
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6 room_check_in_div">
|
||||
<label class="control-label">{l s='Check-In'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control add_room_date_from" name="add_product[date_from]" readonly />
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 room_check_out_div">
|
||||
<label class="control-label">{l s='Check-Out'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control add_room_date_to" name="add_product[date_to]" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" disabled="disabled"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax incl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" disabled="disabled"/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="productQuantity">
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Occupancy'}</label>
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy disabled form-control" type="button">
|
||||
<span>{l s='Select occupancy'}</span>
|
||||
</button>
|
||||
<input type="hidden" class="max_avail_type_qty" value="">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper well well-sm">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="">
|
||||
<input type="hidden" class="max_children" value="">
|
||||
<input type="hidden" class="max_guests" value="">
|
||||
<div class="occupancy_info_block row" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1'}</label></div>
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
<div class="row children_age_info_block" style="display:none">
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="">{l s='All Children'}</label>
|
||||
<div class="">
|
||||
<div class="row children_ages">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="occupancy-info-separator col-sm-12">
|
||||
</div>
|
||||
</div>
|
||||
<div class="add_occupancy_block">
|
||||
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room'}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='No. of rooms'}</label>
|
||||
<input type="number" class="form-control" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" min="1"/>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if sizeof($invoices_collection)}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Invoice'}</label>
|
||||
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
|
||||
<optgroup class="existing" label="{l s='Existing'}">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
|
||||
{/foreach}
|
||||
</optgroup>
|
||||
<optgroup label="{l s='New'}">
|
||||
<option value="0">{l s='Create a new invoice'}</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled" style="display:none;"></button>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,86 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="text-left errors-wrap"></div>
|
||||
<div class="documents-list form-group">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{l s='Preview'}</th>
|
||||
<th class="text-left">{l s='Title'}</th>
|
||||
<th class="text-center">{l s='Upload Date'}</th>
|
||||
<th class="text-center">{l s='Actions'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="well add-new-document-form" style="margin-top: 10px;">
|
||||
<form class="form-horizontal" id="form-add-new-document" method="post" action="#">
|
||||
<input type="hidden" name="id_htl_booking" value="0">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<label class="control-label">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Write the title for the document. Invalid characters <>;=#{}'}">
|
||||
{l s='Title'}
|
||||
</span>
|
||||
</label>
|
||||
<input class="form-control" type="text" name="title" value="" placeholder="{l s='eg. passport, driving license'}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<label class="control-label required">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Choose the document file to be uploaded.'}">
|
||||
{l s='File'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="input-file-wrap"></div>
|
||||
<div class="input-group">
|
||||
<input class="form-control file-name" type="text" readonly="">
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-primary btn-add-file">
|
||||
<i class="icon-folder-open"></i>
|
||||
{l s='Add file'}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-left" style="margin-top: 4px; font-style: italic;">
|
||||
{l s='Upload a PDF or an image file. Allowed image formats: .gif, .jpg, .jpeg and .png'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-primary pull-right upload" type="submit" name="uploadDocument" id="uploadDocument" style="display:none;">
|
||||
{l s='Upload'}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
{if $bookingOrderInfo|count > 0}
|
||||
<form id="order_discount_form" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}" method="post">
|
||||
<div class="form-group">
|
||||
<div class="table-responsive">
|
||||
<table class="table" id="customer_cart_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room Type'}</th>
|
||||
<th>{l s='Hotel Name'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total Price (Tax incl.)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach from=$bookingOrderInfo item=bookingInfo}
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="id_htl_booking[]" value="{$bookingInfo.id|escape:'html':'UTF-8'}"/>
|
||||
</td>
|
||||
<td><b>{$bookingInfo.room_num|escape:'html':'UTF-8'}</b></td>
|
||||
<td>{$bookingInfo.room_type_name|escape:'html':'UTF-8'}</td>
|
||||
<td>{$bookingInfo.hotel_name|escape:'html':'UTF-8'}</td>
|
||||
<td>{dateFormat date=$bookingInfo.date_from} - {dateFormat date=$bookingInfo.date_to}</span></td>
|
||||
<td>{convertPriceWithCurrency price=$bookingInfo.total_price_tax_incl currency=$currency->id}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Reason to Cancel'}</label>
|
||||
<textarea rows="3" class="textarea-autosize cancellation_reason" name="cancellation_reason"></textarea>
|
||||
</div>
|
||||
|
||||
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-primary" id="initiateRefund">
|
||||
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Submit'}{/if}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
{else}
|
||||
<div class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No room bookings found.'}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,92 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form id="order_discount_form" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Name'}</label>
|
||||
<input class="form-control" type="text" name="discount_name" value="" />
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Type'}</label>
|
||||
<select class="form-control" name="discount_type" id="discount_type">
|
||||
<option value="1">{l s='Percent'}</option>
|
||||
<option value="2">{l s='Amount'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6" id="discount_value_field">
|
||||
<label class="control-label">{l s='Value'}</label>
|
||||
<div>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span id="discount_currency_sign" style="display: none;">{$currency->sign}</span>
|
||||
<span id="discount_percent_symbol">%</span>
|
||||
</div>
|
||||
<input class="form-control" type="text" name="discount_value"/>
|
||||
</div>
|
||||
<p class="text-muted" id="discount_value_help" style="display: none;">
|
||||
{l s='This value must include taxes.'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if $order->hasInvoice()}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<label class="control-label">{l s='Invoice'}</label>
|
||||
<select name="discount_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" selected="selected">
|
||||
{$invoice->getInvoiceNumberFormatted($current_id_lang)} - {displayPrice price=$invoice->total_paid_tax_incl currency=$order->id_currency}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<p class="checkbox">
|
||||
<label class="control-label" for="discount_all_invoices">
|
||||
<input type="checkbox" name="discount_all_invoices" id="discount_all_invoices" value="1" />
|
||||
{l s='Apply on all invoices'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="help-block">
|
||||
{l s='If you chooses to create this discount for all invoices, only one discount will be created per order invoice.'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<button class="btn btn-default" type="submit" name="submitNewVoucher" style="display:none" id="submitNewVoucher"></button>
|
||||
</form>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="{$current_index}&vieworder&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Note Detail'}</label>
|
||||
<input type="hidden" name="id_order_invoice" id="id_order_invoice" value="" />
|
||||
<textarea name="note" id="editNote" class="edit-note textarea-autosize"></textarea>
|
||||
</div>
|
||||
<button class="btn btn-default" type="submit" name="submitEditNote" style="display:none" id="submitEditNote"></button>
|
||||
</form>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="edit_product">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#edit_room_tab" role="tab" data-toggle="tab">{l s='Rooms'}</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<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 class="tab-content clearfix">
|
||||
{include file='controllers/orders/modals/_edit_room_tab_content.tpl'}
|
||||
|
||||
{* below tpl contains tab contents for facilities and service products *}
|
||||
{include file='controllers/orders/modals/_partials/_room_extra_services_content.tpl'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,136 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="edit_room_tab" class="tab-pane active">
|
||||
<input type="hidden" name="id_order" value="{$data.id_order}" />
|
||||
<input type="hidden" name="id_room" value="{$data.id_room}" />
|
||||
<input type="hidden" name="id_product" value="{$data.id_product}" />
|
||||
<input type="hidden" name="id_hotel" value="{$data.id_hotel}" />
|
||||
<input type="hidden" name="date_from" value="{$data.date_from}" />
|
||||
<input type="hidden" name="date_to" value="{$data.date_to}" />
|
||||
<input type="hidden" name="id_order_detail" value="{$data.id_order_detail}" />
|
||||
<input type="hidden" name="product_price_tax_excl" value="{Tools::ps_round($data.original_unit_price_tax_excl, 2)}" />
|
||||
<input type="hidden" name="product_price_tax_incl" value="{Tools::ps_round($data.original_unit_price_tax_incl, 2)}" />
|
||||
|
||||
<div class="edit_room_fields">
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6 room_check_in_div">
|
||||
<label class="control-label">{l s='Check-In'}</label>
|
||||
<div class="input-group">
|
||||
<input type="hidden" class="edit_product_date_from_actual" name="edit_product[date_from]"/>
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
{dateFormat date=$data.date_from}
|
||||
{else}
|
||||
<input type="text" class="form-control edit_product_date_from" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 room_check_out_div">
|
||||
<label class="control-label">{l s='Check-Out'}</label>
|
||||
<div class="input-group">
|
||||
<input type="hidden" class="edit_product_date_to_actual" name="edit_product[date_to]"/>
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
{dateFormat date=$data.date_to}
|
||||
{else}
|
||||
<input type="text" class="form-control edit_product_date_to" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control room_unit_price" type="text" name="room_unit_price" value=""/>
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Occupancy'}</label>
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy_edit">
|
||||
<div class="dropdown">
|
||||
<button class="form-control booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="occupancy_info_block" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-sm-12">
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<span class="booking_occupancy_edit" style="display:none;">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="submitRoomChange" class="btn btn-primary"><i class="icon icon-bed"></i> {l s="Update Rooms"}</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="extra-services-content modal-body">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<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 class="tab-content clearfix">
|
||||
{include file='controllers/orders/modals/_partials/_room_extra_services_content.tpl'}
|
||||
</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2010-2023 Webkul.
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -13,11 +13,11 @@
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="room_type_demands_desc" class="tab-pane active">
|
||||
<div id="room_type_demands_desc" class="tab-pane {if (isset($show_active) && $show_active) || (!isset($orderEdit) || !$orderEdit)}active{/if} extra-services-container">
|
||||
<input type="hidden" value="{$id_booking_detail}" id="id_htl_booking">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
@@ -52,13 +52,13 @@
|
||||
</div>
|
||||
</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>
|
||||
<td class="text-right"><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}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<td colspan="4">
|
||||
<i class="icon-warning"></i> {l s='No facilities added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -77,7 +77,7 @@
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Option'}</th>
|
||||
<th class="text-right">{l s='Unit Price'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -105,8 +105,7 @@
|
||||
<input type="hidden" class="id_option" value="0" />
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currencySign}</span>
|
||||
{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price_tax_excl'])}
|
||||
@@ -126,41 +125,50 @@
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="save_room_demands" class="btn btn-primary"><i class="icon icon-save"></i> {l s="Update Facilities"}</button>
|
||||
</div>
|
||||
{else}
|
||||
<i class="icon-warning"></i> {l s='No facilities available for this room.'}
|
||||
<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>
|
||||
{/foreach}
|
||||
{else}
|
||||
{l s='No facilities selected!'}
|
||||
<div class="room_demand_detail">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Total Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if isset($extraDemands) && $extraDemands}
|
||||
{foreach $extraDemands as $roomDemand}
|
||||
{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>{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<i class="icon-warning"></i> {l s='No facilities added yet.'}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
{*
|
||||
* 2010-2023 Webkul.
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -13,11 +13,11 @@
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div id="room_type_service_product_desc" class="tab-pane {if isset($show_active) && $show_active}active{/if}">
|
||||
<div id="room_type_service_product_desc" class="tab-pane {if isset($show_active) && $show_active}active{/if} extra-services-container">
|
||||
{if isset($orderEdit) && $orderEdit}
|
||||
|
||||
<p class="col-sm-12 facility_nav_btn">
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
{* Already selected room services *}
|
||||
<div class="col-sm-12 room_ordered_services table-responsive">
|
||||
<table class="table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th class="fixed-width-sm"></th>
|
||||
<th class="fixed-width-sm">{l s='Quantity'}</th>
|
||||
<th class="fixed-width-sm text-center">{l s='Quantity'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Total Price'}</th>
|
||||
<th class="text-right">{l s='Action'}</th>
|
||||
@@ -45,7 +45,7 @@
|
||||
<td>
|
||||
<div>{$service['name']|escape:'html':'UTF-8'}</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td>
|
||||
{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}
|
||||
@@ -53,7 +53,7 @@
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
{if $service['allow_multiple_quantity']}
|
||||
<div class="qty_container">
|
||||
<input type="number" class="form-control qty" min="1" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
|
||||
@@ -78,7 +78,7 @@
|
||||
{/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>
|
||||
<td class="text-right"><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}
|
||||
@@ -100,7 +100,7 @@
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th class="fixed-width-sm"> </th>
|
||||
<th class="fixed-width-sm">{l s='Quantity'}</th>
|
||||
<th class="fixed-width-sm text-center">{l s='Quantity'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -121,7 +121,7 @@
|
||||
<span class="badge badge-info label">{l s='Convenience fee'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
{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">
|
||||
@@ -143,12 +143,15 @@
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" id="save_service_service" class="btn btn-primary"><i class="icon icon-save"></i> {l s="Update Services"}</button>
|
||||
</div>
|
||||
{else}
|
||||
<i class="icon-warning"></i> {l s='No services available to add to this room.'}
|
||||
{/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}
|
||||
@@ -159,7 +162,7 @@
|
||||
<th>{l s='Name'}</th>
|
||||
<th></th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th class="text-right">{l s='Total Price'}</th>
|
||||
<th>{l s='Total Price'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</tbody>
|
||||
@@ -169,7 +172,7 @@
|
||||
{$service['id_product']|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&id_product={$service['id_product']|escape:'html':'UTF-8'}&updateproduct"><i class="icon-external-link-sign"></i></a>
|
||||
</td>
|
||||
<td>{$service['name']|escape:'html':'UTF-8'}</td>
|
||||
<td class="text-center">
|
||||
<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}
|
||||
@@ -183,7 +186,7 @@
|
||||
{l s='/ night'}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<td>
|
||||
{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,77 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Payment Date'}</label>
|
||||
<b><div id="payment_date"></div></b>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Payment Method'}</label>
|
||||
<b><div id="payment_method"></div></b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Payment Source'}</label>
|
||||
<b><div id="payment_source"></div></b>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Transaction Id'}</label>
|
||||
<b><div id="transaction_id"></div></b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Amount'}</label>
|
||||
<b><div id="amount"></div></b>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Invoice'}</label>
|
||||
<b><div id="invoice_number"></div></b>
|
||||
</div>
|
||||
</div>
|
||||
{* <div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Card Number'}</label>
|
||||
<b><div id="card_number"></div></b>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Card Brand'}</label>
|
||||
<b><div id="card_brand"></div></b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Card Expiration'}</label>
|
||||
<b><div id="card_expiration"></div></b>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Card Holder'}</label>
|
||||
<b><div id="card_holder"></div></b>
|
||||
</div>
|
||||
</div> *}
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,94 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form id="form_add_payment" method="post" action="{$current_index}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'html':'UTF-8'}">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Date'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="payment_date" class="datepicker" value="{date('Y-m-d')}" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-calendar-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Payment method'}</label>
|
||||
<div>
|
||||
<input name="payment_method" list="payment_method" class="form-control payment_method">
|
||||
<datalist id="payment_method">
|
||||
{foreach from=$payment_methods item=payment_method}
|
||||
<option value="{$payment_method}">
|
||||
{/foreach}
|
||||
</datalist>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Payment source'}</label>
|
||||
<select name="payment_type" class="payment_type form-control">
|
||||
{foreach from=$payment_types item=payment_type}
|
||||
<option value="{$payment_type['value']}">{$payment_type['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Transaction ID'}</label>
|
||||
<input type="text" name="payment_transaction_id" value="" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Amount'}</label>
|
||||
<input type="text" name="payment_amount" value="" class="form-control" />
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Currency'}</label>
|
||||
<select name="payment_currency" class="payment_currency form-control pull-left">
|
||||
{foreach from=$currencies item=current_currency}
|
||||
<option value="{$current_currency['id_currency']}"{if $current_currency['id_currency'] == $currency->id} selected="selected"{/if}>{$current_currency['sign']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{if count($invoices_collection) > 0}
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Invoice'}</label>
|
||||
<select name="payment_invoice" id="payment_invoice">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<button style="display:none" class="btn btn-primary pull-right" type="submit" name="submitAddPayment" id="submitAddPayment">
|
||||
{l s='Add payment'}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{include file='controllers/orders/modals/_extra_services_facilities_tab_content.tpl'}
|
||||
{include file='controllers/orders/modals/_extra_services_service_products_tab_content.tpl'}
|
||||
|
||||
{* Css for handling extra demands changes *}
|
||||
<style type="text/css">
|
||||
/*Extra demands CSS*/
|
||||
#edit_product .extra-services-container .room_demands_container,
|
||||
#edit_product .extra-services-container .room_services_container {
|
||||
display: none;}
|
||||
#edit_product .extra-services-container #save_room_demands,
|
||||
#edit_product .extra-services-container #back_to_demands_btn,
|
||||
#edit_product .extra-services-container #save_service_service,
|
||||
#edit_product .extra-services-container #back_to_service_btn {
|
||||
display: none;}
|
||||
</style>
|
||||
|
||||
@@ -31,5 +31,5 @@ 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: ../../../../../../../../');
|
||||
header('Location: ../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,134 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active">
|
||||
<a href="#reallocate_room_tab" aria-controls="reallocate" role="tab" data-toggle="tab">{l s='Room Reallocation'}</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="#swap_room_tab" aria-controls="swap" role="tab" data-toggle="tab">{l s='Swap Room'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content active">
|
||||
<div role="tabpanel" class="tab-pane active" id="reallocate_room_tab">
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Currently Alloted Customer'}</label>
|
||||
<dd><i class="icon-user"></i> <span class="cust_name"></span></dd>
|
||||
<dd><i class="icon-envelope"></i> <span class="cust_email"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<form class="form-hozizontal" method="post" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}">
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="realloc_avail_room_type" class="control-label model-label">{l s='Room Type To Reallocate:'}</label>
|
||||
<input type="hidden" class="form-control modal_id_htl_booking" name="id_htl_booking">
|
||||
<div class="realloc_avail_room_type_container">
|
||||
<select class="form-control" name="realloc_avail_room_type" id="realloc_avail_room_type">
|
||||
<option value="0" selected="selected">{l s='Select Room Type'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="error_text" id="realloc_sel_rm_type_err_p"></p>
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="realloc_avail_rooms" class="control-label model-label">{l s='Room To Reallocate:'}</label>
|
||||
<div class="realloc_avail_rooms_container">
|
||||
<select class="form-control" name="realloc_avail_rooms" id="realloc_avail_rooms">
|
||||
<option value="0" selected="selected">{l s='Select Rooms'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="error_text" id="realloc_sel_rm_err_p"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="reallocation_price_diff_block" style="display:none;">
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="reallocation_price_diff" class="control-label model-label">{l s='Price Difference'} *</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
<input class="alert-warning" type="text" name="reallocation_price_diff" id="reallocation_price_diff" value="0" />
|
||||
<span class="input-group-addon">{l s='Tax excl.'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="alert alert-warning col-sm-12 realloc_roomtype_change_message" style="display:none">
|
||||
<p>{l s="If room type is changed while room reallocation then all additional facilities and services will be assigned to the selected room of new room type."}</p>
|
||||
<p>{l s="If you want to change additional facilities or services, you can update by editing the room after reallocation."}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="error_text" id="realloc_sel_rm_err_p"></p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default btn-close" data-dismiss="modal">{l s="Close"}</button>
|
||||
<button type="submit" id="realloc_allocated_rooms" name="realloc_allocated_rooms" class="btn btn-primary" value="Reallocate"><i class="icon icon-refresh"></i> {l s="Reallocate"}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="swap_room_tab">
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Currently Alloted Customer'}</label>
|
||||
<dd><i class="icon-user"></i> <span class="cust_name"></span></dd>
|
||||
<dd><i class="icon-envelope"></i> <span class="cust_email"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<hr>
|
||||
<form method="post" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}">
|
||||
<div class="form-group">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<label for="swap_avail_rooms" class="control-label model-label">{l s='Available rooms to swap'}</label>
|
||||
<input type="hidden" class="form-control modal_id_htl_booking" name="id_htl_booking">
|
||||
<div class="swap_avail_rooms_container"></div>
|
||||
|
||||
<p class="error_text" id="swap_sel_rm_err_p"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default btn-close" data-dismiss="modal">{l s="Close"}</button>
|
||||
<button type="submit" id="swap_allocated_rooms" name="swap_allocated_rooms" class="btn btn-primary" value="Swap"><i class="icon icon-refresh"></i> {l s="Swap"}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* If you want to show loader in your modals the send loaderImage from postProcess() method *}
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}" method="post" class="room_status_info_form">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Status'}</label>
|
||||
<select name="booking_order_status" class="form-control booking_order_status margin-bottom-5">
|
||||
{foreach from=$hotel_order_status item=state}
|
||||
<option value="{$state['id_status']|intval}">{$state.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" style="display:none;">
|
||||
<label class="control-label">{l s='Date'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="status_date" class="room_status_date wk-input-date" value="" />
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-calendar-o"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="room_status_id_hotel_booking_detail" name="id_hotel_booking_detail" />
|
||||
<input type="hidden" id="room_status_date_from" name="date_from" />
|
||||
<input type="hidden" id="room_status_date_to" name="date_to" />
|
||||
<input type="hidden" id="room_status_id_room" name="id_room" />
|
||||
<input type="hidden" id="room_status_id_order" name="id_order" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary" type="submit" name="submitbookingOrderStatus" style="display:none" id="submitbookingOrderStatus"></button>
|
||||
</form>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,57 @@
|
||||
{*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form id="customer-guest-details-form">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-2">
|
||||
<label class="control-label">{l s='Date'}</label>
|
||||
<select name="id_gender">
|
||||
{foreach from=$genders key=k item=gender}
|
||||
<option value="{$gender->id_gender}"{if $customerGuestDetail->id_gender == $gender->id_gender} selected="selected"{/if}>{$gender->name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<label class="control-label">{l s='First Name'}</label>
|
||||
<input type="text" value="{$customerGuestDetail->firstname}" name="firstname">
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<label class="control-label">{l s='Last Name'}</label>
|
||||
<input type="text" value="{$customerGuestDetail->lastname}" name="lastname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Email'}</label>
|
||||
<input type="text" value="{$customerGuestDetail->email}" name="email">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Phone'}</label>
|
||||
<input type="text" value="{$customerGuestDetail->phone}" name="phone">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
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;
|
||||
@@ -1,417 +0,0 @@
|
||||
{*
|
||||
* 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
|
||||
*}
|
||||
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
|
||||
{block name="tableFilter"}{/block}
|
||||
{block name="override_form_extra"}
|
||||
{if !$simple_header && $show_filters}
|
||||
<script>
|
||||
$(function() {
|
||||
if ($("#list_filters_panel .datepicker").length > 0) {
|
||||
$("#list_filters_panel .datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
altFormat: 'yy-mm-dd'
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div class="list_action_wrapper">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-3 col-md-2">
|
||||
<div class="list_availibility_container">
|
||||
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
|
||||
<span>{l s='Available Fields'}
|
||||
<i class="icon-caret-down pull-right"></i>
|
||||
</button>
|
||||
<ul id="optional-list-toggle" class="dropdown-menu">
|
||||
{foreach $fields_optional as $key => $field}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
|
||||
{$field['title']}
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
{assign var="fields_optional" value=array()}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-3 col-xs-offset-5 col-sm-2 col-sm-offset-7 col-md-1 col-md-offset-9">
|
||||
<div class="list_filter_container">
|
||||
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
|
||||
<i class="icon-sliders"></i>
|
||||
<span>{l s='Filters'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{if $filters_has_value}
|
||||
<div id="selected_filter_container">
|
||||
{l s='Filters: '}
|
||||
<span class="selected_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if (!isset($params.search) || $params.search) && $params.value != ''}
|
||||
{if ($params.type == 'date' || $params.type == 'datetime') && $params.value|is_array}
|
||||
{assign var="filter_value" value=''}
|
||||
{foreach $params.value as $value}
|
||||
{if ($value|is_string && !empty($value))}
|
||||
{if empty($filter_value)}
|
||||
{assign var="filter_value" value=$value}
|
||||
{else}
|
||||
{assign var="filter_value" value="`$filter_value` - `$value`"}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if !empty($filter_value)}
|
||||
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'range' && $params.value|is_array}
|
||||
{assign var="filter_value" value=''}
|
||||
{foreach $params.value as $value}
|
||||
{if (isset($value) && ($value !== '' || $value === 0))}
|
||||
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
{assign var="filter_value" value=$value}
|
||||
{else}
|
||||
{assign var="filter_value" value="`$filter_value` - `$value`"}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
|
||||
{$params['title']|escape:'html':'UTF-8'}:
|
||||
<span class="filter_value">
|
||||
{foreach from=$params.value item=option name=foreachInfo}
|
||||
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: ' ' : ''}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'bool' && $key == 'advance_payment'}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{if $params['value'] == 1}{l s='Yes'}{elseif $params['value'] == 0}{l s='No'}{/if}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="panel collapse" id="list_filters_panel">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="list_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if !isset($params.search) || $params.search}
|
||||
<div class="row">
|
||||
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
|
||||
<div class="col-xs-9">
|
||||
{if $params.type == 'range'}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{else if $params.type == 'bool'}
|
||||
<select id="filter_input_{$key}" class="filter center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
|
||||
$('#local_{$params.id_date}_0').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
if (typeof dateTo != 'undefined' && dateTo != '') {
|
||||
let objDateToMax = $.datepicker.parseDate('yy-mm-dd', dateTo);
|
||||
objDateToMax.setDate(objDateToMax.getDate() - 1);
|
||||
$('#local_{$params.id_date}_0').datepicker('option', 'maxDate', objDateToMax);
|
||||
}
|
||||
},
|
||||
onClose: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
|
||||
if (dateFrom >= dateTo) {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
|
||||
if (typeof dateFrom != 'undefined' && dateFrom != '') {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate() + 1);
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{else}
|
||||
{if isset($params.filter_key)}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" {if !isset($params.remove_onchange) || !$params.remove_onchange}onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();"{/if} name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $has_actions || $show_filters}
|
||||
<div class="actions">
|
||||
<hr>
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#selected_filter_container .selected_filters span i').on('click', function() {
|
||||
let form = $(this).closest('form');
|
||||
let type = $(this).parent().data('filter_type');
|
||||
$(this).parent().remove();
|
||||
if (type == 'date' || type == 'datetime') {
|
||||
$('#list_filters_panel').find('[name*="'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'range') {
|
||||
$('#list_filters_panel').find('[name*="productFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'select') {
|
||||
$('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
|
||||
} else if (type == 'bool' && $(this).parent().data('filter_key') == 'advance_payment') {
|
||||
$('#list_filters_panel').find('select[name*="productFilter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
|
||||
} else {
|
||||
$('#list_filters_panel').find('input[name*="productFilter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
}
|
||||
|
||||
// set post data for empty multi-select filters
|
||||
$(form).find('select[multiple]').each(function (i, selectElement) {
|
||||
if ($(selectElement).find('option:selected').length == 0) {
|
||||
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
|
||||
}
|
||||
});
|
||||
|
||||
form.submit();
|
||||
});
|
||||
|
||||
$('#form-product').submit(function () {
|
||||
let form = $(this);
|
||||
$(form).find('select[multiple]').each(function (i, selectElement) {
|
||||
if ($(selectElement).val() == null) {
|
||||
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.list_action_wrapper {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.list_availibility_container {
|
||||
position: relative;}
|
||||
.list_availibility_container .dropdown-menu {
|
||||
right: 0;
|
||||
padding: 8px 12px;}
|
||||
.list_availibility_container .dropdown-menu label {
|
||||
font-weight: 400;}
|
||||
#selected_filter_container {
|
||||
background-color: #fff;
|
||||
padding: 8px 20px;
|
||||
border: solid 1px #d3d8db;
|
||||
border-radius: 5px 5px 0 0;
|
||||
font-size: 14px;
|
||||
min-height: 52px;
|
||||
margin-top: 15px;}
|
||||
#selected_filter_container .selected_filters > span {
|
||||
font-size: 12px;
|
||||
padding: 6px 10px;
|
||||
display: inline-block;
|
||||
background: #F5F8F9;
|
||||
border: 1px solid #A0D0EB;
|
||||
border-radius: 3px;}
|
||||
#selected_filter_container .selected_filters > span + span {
|
||||
margin-left: 12px;}
|
||||
#selected_filter_container .selected_filters > span .filter_value {
|
||||
font-weight: 700;
|
||||
}
|
||||
#selected_filter_container .selected_filters > span i {
|
||||
cursor: pointer;}
|
||||
|
||||
#content.bootstrap #list_filters_panel{
|
||||
margin-top: 15px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + #list_filters_panel {
|
||||
margin-top: 0;
|
||||
}
|
||||
#content.bootstrap #selected_filter_container + div.panel {
|
||||
border-top: transparent;
|
||||
border-radius: 0 0 5px 5px;
|
||||
}
|
||||
|
||||
.list_filters {
|
||||
padding: 0 30px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px 40px;}
|
||||
.list_filters > .row {
|
||||
display: flex;
|
||||
align-items: center;}
|
||||
.list_filters .date_range, .list_filters .input_range {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 15px;}
|
||||
.list_filters .date_range .input-group:first-child {
|
||||
margin-bottom: 0;}
|
||||
.list_filters label {
|
||||
text-align: right;
|
||||
font-weight: 400;}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 4;}
|
||||
@media (max-width: 992px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(2, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 3;}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.list_filters {
|
||||
grid-template-columns: repeat(1, 1fr);}
|
||||
.list_filters .actions {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 2;}
|
||||
.list_filters label {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -297,7 +297,7 @@
|
||||
{/if}
|
||||
|
||||
<ul id="header_employee_box">
|
||||
{if $upgrade_info->update_available > 0}
|
||||
{if isset($upgrade_info->update_available) && $upgrade_info->update_available > 0}
|
||||
<li class="hidden-md hidden-sm hidden-xs"><a href="{$upgrade_info->upgrade_url}">{l s='QloApps Update Availabe:'} {$upgrade_info->latest_availabe}</a></li>
|
||||
{/if}
|
||||
<li class="hidden-sm hidden-xs">
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
$('#submitFilter{$list_id}').val(1);
|
||||
});
|
||||
|
||||
if ($("table .datepicker").length > 0) {
|
||||
$("table .datepicker").datepicker({
|
||||
if ($("form .datepicker").length > 0) {
|
||||
$("form .datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
altFormat: 'yy-mm-dd'
|
||||
@@ -121,7 +121,305 @@
|
||||
<input type="hidden" name="page" value="{$page|intval}"/>
|
||||
<input type="hidden" name="selected_pagination" value="{$selected_pagination|intval}"/>
|
||||
{block name="override_form_extra"}{/block}
|
||||
<div class="panel col-lg-12">
|
||||
{if !$simple_header && $show_filters}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#selected_filter_container .selected_filters span i').on('click', function() {
|
||||
let form = $(this).closest('form');
|
||||
let type = $(this).parent().data('filter_type');
|
||||
$(this).parent().remove();
|
||||
if (type == 'date' || type == 'datetime') {
|
||||
$(form).find('#list_filters_panel [name*="'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'range') {
|
||||
$(form).find('#list_filters_panel [name*="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
} else if (type == 'select' || type == 'bool') {
|
||||
$(form).find('#list_filters_panel select[name*="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"] option:selected').prop('selected', false);
|
||||
} else {
|
||||
$(form).find('#list_filters_panel input[name="{$list_id}Filter_'+$(this).parent().data('filter_key')+'"]').val('');
|
||||
}
|
||||
|
||||
// set post data for empty multi-select filters
|
||||
$(form).find('select[multiple]').each(function (i, selectElement) {
|
||||
if ($(selectElement).find('option:selected').length == 0) {
|
||||
$(form).append('<input type="hidden" name="' + $(selectElement).attr('name').slice(0, -2) + '" value="">');
|
||||
}
|
||||
});
|
||||
|
||||
form.submit();
|
||||
});
|
||||
{if $fields_optional|count}
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
{/if}
|
||||
$('#optional-list-toggle').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('#form-{$list_id} input[name="list_fields_visibility"]').on('change', function(){
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
})
|
||||
});
|
||||
|
||||
function toggleVisibleColumns(form) {
|
||||
var list_fields_visibility = [];
|
||||
$(form).find('input[name="list_fields_visibility"]:checked').each(function(i, field){
|
||||
list_fields_visibility.push($(field).val());
|
||||
});
|
||||
|
||||
$(form).find('table.table .field_optional').hide();
|
||||
$(form).find('table.table .field_optional').each(function(i, val) {
|
||||
if (list_fields_visibility.includes($(this).data('key'))) {
|
||||
$(this).css('display', '');
|
||||
}
|
||||
});
|
||||
updateListVisibility(list_fields_visibility)
|
||||
}
|
||||
function updateListVisibility(list_fields_visibility) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: '{$action}',
|
||||
data: {
|
||||
ajax: 1,
|
||||
action: 'updateListVisivility',
|
||||
list_fields_visibility: list_fields_visibility
|
||||
},
|
||||
cache: false,
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
{block name="updatelist"}
|
||||
{if $new_list_header_design}
|
||||
<div class="list_action_wrapper">
|
||||
<div class="row">
|
||||
{if $fields_optional|count}
|
||||
<div class="col-xs-4 col-sm-3 col-md-2">
|
||||
<div class="list_availibility_container">
|
||||
<button type="button" class="btn btn-default btn-left btn-block dropdown-toggle" data-toggle="dropdown">
|
||||
<span>{l s='Available Fields'}
|
||||
<i class="icon-caret-down pull-right"></i>
|
||||
</button>
|
||||
<ul id="optional-list-toggle" class="dropdown-menu">
|
||||
{foreach $fields_optional as $key => $field}
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="list_fields_visibility" value="{$key}" {if isset($field['selected']) && $field['selected']}checked="checked"{/if}>
|
||||
{$field['title']}
|
||||
</label>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if !$simple_header && $show_filters}
|
||||
<div class="col-xs-3 col-xs-offset-{if $fields_optional|count}}5{else}9{/if} col-sm-2 col-sm-offset-{if $fields_optional|count}}7{else}10{/if} col-md-1 col-md-offset-{if $fields_optional|count}9{else}11{/if}">
|
||||
<div class="list_filter_container">
|
||||
<button type="button" class="btn btn-default btn-block" data-toggle="collapse" data-target="#list_filters_panel">
|
||||
<i class="icon-sliders"></i>
|
||||
<span>{l s='Filters'}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{if $filters_has_value}
|
||||
<div id="selected_filter_container">
|
||||
{l s='Filters: '}
|
||||
<span class="selected_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if (!isset($params.search) || $params.search) && $params.value != ''}
|
||||
{if ($params.type == 'date' || $params.type == 'datetime' || $params.type == 'range') && $params.value|is_array}
|
||||
{assign var="filter_value" value=''}
|
||||
{foreach $params.value as $value}
|
||||
{if (isset($value) && ($value !== '' || $value === 0))}
|
||||
{if !(isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
{assign var="filter_value" value=$value}
|
||||
{else}
|
||||
{assign var="filter_value" value="`$filter_value` - `$value`"}
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if (isset($filter_value) && ($filter_value !== '' || $filter_value === 0))}
|
||||
<span data-filter_key="{if isset($params.name_date)}{$params.name_date}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$filter_value|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}" data-multiple="{$params.multiple|intval}" data-operator="{$params.operator}">
|
||||
{$params['title']|escape:'html':'UTF-8'}:
|
||||
<span class="filter_value">
|
||||
{foreach from=$params.value item=option name=foreachInfo}
|
||||
{$params.list[$option]}{if !$smarty.foreach.foreachInfo.last}{if $params.operator == 'or'} | {else}, {/if}{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['list'][$params['value']]|replace: ' ' : ''}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $params.type == 'bool'}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{if $params['value'] == 1}{l s='Yes'}{else}{l s='No'}{/if}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{else}
|
||||
<span data-filter_key="{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" data-filter_type="{$params.type}">
|
||||
{$params['title']|escape:'html':'UTF-8'}: <span class="filter_value">{$params['value']|escape:'html':'UTF-8'}</span>
|
||||
<i class="icon-times"></i>
|
||||
</span>
|
||||
{/if}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="panel collapse" id="list_filters_panel">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="list_filters">
|
||||
{foreach $fields_display AS $key => $params}
|
||||
{if !isset($params.search) || $params.search}
|
||||
<div class="row">
|
||||
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
|
||||
<div class="col-xs-9">
|
||||
{if $params.type == 'range'}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{elseif $params.type == 'bool'}
|
||||
<select id="filter_input_{$key}" class="filter center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
var dateStart = parseDate($("#{$params.id_date}_0").val());
|
||||
var dateEnd = parseDate($("#{$params.id_date}_1").val());
|
||||
$("#local_{$params.id_date}_0").datepicker("option", "altField", "#{$params.id_date}_0");
|
||||
$("#local_{$params.id_date}_1").datepicker("option", "altField", "#{$params.id_date}_1");
|
||||
if (dateStart !== null){
|
||||
$("#local_{$params.id_date}_0").datepicker("setDate", dateStart);
|
||||
}
|
||||
if (dateEnd !== null){
|
||||
$("#local_{$params.id_date}_1").datepicker("setDate", dateEnd);
|
||||
}
|
||||
|
||||
$('#local_{$params.id_date}_0').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
onClose: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
let dateTo = $('#local_{$params.id_date}_1').val().trim();
|
||||
|
||||
if ((dateFrom && dateTo) && (dateFrom >= dateTo)) {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate());
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', {
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
beforeShow: function() {
|
||||
let dateFrom = $('#local_{$params.id_date}_0').val().trim();
|
||||
|
||||
if (typeof dateFrom != 'undefined' && dateFrom != '') {
|
||||
let objDateToMin = $.datepicker.parseDate('yy-mm-dd', dateFrom);
|
||||
objDateToMin.setDate(objDateToMin.getDate());
|
||||
|
||||
$('#local_{$params.id_date}_1').datepicker('option', 'minDate', objDateToMin);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{else}
|
||||
{if isset($params.filter_key)}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $has_actions || $show_filters}
|
||||
<div class="actions">
|
||||
<hr>
|
||||
{if $show_filters}
|
||||
<span class="pull-right">
|
||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||
<i class="icon-search"></i> {l s='Search'}
|
||||
</button>
|
||||
{if $filters_has_value}
|
||||
<button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
|
||||
<i class="icon-eraser"></i> {l s='Reset'}
|
||||
</button>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
<div class="panel col-lg-12">
|
||||
{block name="panel_heading"}
|
||||
<div class="panel-heading">
|
||||
{if isset($icon)}<i class="{$icon}"></i> {/if}{if is_array($title)}{$title|end}{else}{$title}{/if}
|
||||
@@ -138,7 +436,7 @@
|
||||
</a>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $fields_optional|count}
|
||||
{if $fields_optional|count && !$new_list_header_design}
|
||||
<a class="list-toolbar-btn dropdown-toggle" data-toggle="dropdown" data-target="#dropdown-option-toggle">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Toggle list'}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-cogs"></i>
|
||||
@@ -154,46 +452,6 @@
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
updateListVisibility();
|
||||
$('#optional-list-toggle').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('input[name="list_fields_visibility"]').on('change', function(){
|
||||
updateListVisibility();
|
||||
})
|
||||
});
|
||||
function updateListVisibility() {
|
||||
var list_fields_visibility = [];
|
||||
$('input[name="list_fields_visibility"]:checked').each(function(i, field){
|
||||
list_fields_visibility.push($(field).val());
|
||||
});
|
||||
const table = $('table.table.{$table}');
|
||||
$(table).find('.field_optional').hide();
|
||||
$(table).find('.field_optional').each(function(i, val) {
|
||||
if (list_fields_visibility.includes($(this).data('key'))) {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: '{$action}',
|
||||
data: {
|
||||
ajax: 1,
|
||||
action: 'updateListVisivility',
|
||||
list_fields_visibility: list_fields_visibility
|
||||
},
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<a class="list-toolbar-btn" href="javascript:location.reload();">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Refresh list'}" data-html="true" data-placement="top">
|
||||
<i class="process-icon-refresh"></i>
|
||||
@@ -295,10 +553,11 @@
|
||||
<style>
|
||||
@media (max-width: 992px) {
|
||||
{foreach from=$fields_display item=param name=params}
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
.table-responsive-row td:nth-of-type({math equation="x+y" x=$smarty.foreach.params.index y=$y}):before {
|
||||
{if isset($param.displayed) && $param.displayed === false}{continue}{/if}
|
||||
.table-responsive-row td:nth-of-type({$y}):before {
|
||||
content: "{$param.title}";
|
||||
}
|
||||
{assign var=y value=$y+1}
|
||||
{/foreach}
|
||||
}
|
||||
</style>
|
||||
@@ -364,7 +623,7 @@
|
||||
</tr>
|
||||
{/block}
|
||||
{block name="tableFilter"}
|
||||
{if !$simple_header && $show_filters}
|
||||
{if !$simple_header && $show_filters && !$new_list_header_design}
|
||||
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
|
||||
{if $has_bulk_actions}
|
||||
<th class="text-center">
|
||||
@@ -455,7 +714,7 @@
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<select class="filter{if isset($params.align) && $params.align == 'center'}center{/if}" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="modal-content">
|
||||
{if isset($modal_title)}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<button type="button" class="close" data-dismiss="modal"><i class="icon-remove-sign"></i></button>
|
||||
<h4 class="modal-title">{$modal_title}</h4>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
{if isset($modal_actions)}
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{l s='Close'}</button>
|
||||
<button type="button" class="btn btn-default btn-close" data-dismiss="modal">{l s='Close'}</button>
|
||||
{foreach $modal_actions as $action}
|
||||
{if $action.type == 'link'}
|
||||
<a href="{$action.href}" class="btn {$action.class}">{$action.label}</a>
|
||||
|
||||
@@ -483,6 +483,14 @@ class AddressCore extends ObjectModel
|
||||
return array();
|
||||
}
|
||||
|
||||
public function cacheFieldsRequiredDatabase($all = false)
|
||||
{
|
||||
parent::cacheFieldsRequiredDatabase($all);
|
||||
if ($this->id_hotel) {
|
||||
self::$fieldsRequiredDatabase['Address'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
public function searchByName($query, $idLang = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
|
||||
169
classes/Cart.php
169
classes/Cart.php
@@ -374,7 +374,7 @@ class CartCore extends ObjectModel
|
||||
if ($cart_vat_amount == 0 || $cart_amount_te == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return Tools::ps_round($cart_vat_amount / $cart_amount_te, 3);
|
||||
return Tools::ps_round($cart_vat_amount / $cart_amount_te, 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1797,18 +1797,13 @@ class CartCore extends ObjectModel
|
||||
(int)$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
isset($product['date_from']) ? $product['date_from'] : 0,
|
||||
isset($product['date_to']) ? $product['date_to'] : 0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
$with_taxes,
|
||||
null
|
||||
);
|
||||
} else if ($roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct(
|
||||
$this->id,
|
||||
$product['id_product'],
|
||||
isset($product['date_from']) ? $product['date_from'] : 0,
|
||||
isset($product['date_to']) ? $product['date_to'] : 0,
|
||||
)) {
|
||||
} else if ($roomTypesByIdProduct = $objCartBookingData->getCartInfoIdCartIdProduct($this->id, $product['id_product'])) {
|
||||
// by webkul to calculate rates of the product from hotelreservation syatem tables with feature prices....
|
||||
$totalPriceByProduct = 0;
|
||||
$priceDisplay = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
@@ -2355,78 +2350,28 @@ class CartCore extends ObjectModel
|
||||
foreach ($packages as $id_package => $package) {
|
||||
foreach ($package['product_list'] as $product) {
|
||||
if ($product['booking_product']) {
|
||||
if ($roomsBookingDetails = $objHtlCartBookingData->getOnlyCartBookingData(
|
||||
$this->id,
|
||||
$this->id_guest,
|
||||
$product['id_product']
|
||||
)) {
|
||||
$productInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
|
||||
$idHotel = $productInfo['id_hotel'] ? $productInfo['id_hotel'] : 0;
|
||||
$cartRoomInfo = array();
|
||||
foreach ($roomsBookingDetails as $roomBooking) {
|
||||
$dateJoinKey = $idHotel.'-'.strtotime($roomBooking['date_from']).strtotime($roomBooking['date_to']);
|
||||
$roomTotalPrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$product['id_product'],
|
||||
$roomBooking['date_from'],
|
||||
$roomBooking['date_to'],
|
||||
0,
|
||||
Group::getCurrent()->id,
|
||||
$this->id,
|
||||
$this->id_guest,
|
||||
0,
|
||||
0
|
||||
);
|
||||
$newQty = HotelHelper::getNumberOfDays(
|
||||
$roomBooking['date_from'],
|
||||
$roomBooking['date_to']
|
||||
);
|
||||
if (isset($cartRoomInfo[$dateJoinKey])) {
|
||||
$cartRoomInfo[$dateJoinKey]['cart_quantity'] += $newQty;
|
||||
$cartRoomInfo[$dateJoinKey]['total_price_tax_incl'] += $roomTotalPrice['total_price_tax_incl'];
|
||||
$cartRoomInfo[$dateJoinKey]['total_price_tax_excl'] += $roomTotalPrice['total_price_tax_excl'];
|
||||
} else {
|
||||
$cartRoomInfo[$dateJoinKey] = array(
|
||||
'cart_quantity' => $newQty,
|
||||
'total_price_tax_incl' => $roomTotalPrice['total_price_tax_incl'],
|
||||
'total_price_tax_excl' => $roomTotalPrice['total_price_tax_excl'],
|
||||
'date_from' => $roomBooking['date_from'],
|
||||
'date_to' => $roomBooking['date_to'],
|
||||
);
|
||||
}
|
||||
}
|
||||
foreach ($cartRoomInfo as $dateJoinKey => $cartRoom) {
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['product_list'] = array();
|
||||
$productInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']);
|
||||
$idHotel = $productInfo['id_hotel'] ? $productInfo['id_hotel'] : 0;
|
||||
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_hotel'] = $idHotel;
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_hotel'] = $productInfo['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$dateJoinKey]['carrier_list'] = array_intersect($orderPackage[$id_address][$dateJoinKey]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$product['date_from'] = $cartRoom['date_from'];
|
||||
$product['date_to'] = $cartRoom['date_to'];
|
||||
$product['total_wt'] = $cartRoom['total_price_tax_incl'];
|
||||
$product['total'] = $cartRoom['total_price_tax_excl'];
|
||||
$product['cart_quantity'] = $cartRoom['cart_quantity'];
|
||||
$product['price_wt'] = $cartRoom['total_price_tax_incl'] / $cartRoom['cart_quantity'];
|
||||
$product['price'] = $cartRoom['total_price_tax_excl'] / $cartRoom['cart_quantity'];
|
||||
$orderPackage[$id_address][$dateJoinKey]['product_list'][] = $product;
|
||||
$orderPackage[$id_address][$idHotel]['product_list'][] = $product;
|
||||
$orderPackage[$id_address][$idHotel]['id_hotel'] = $idHotel;
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_hotel'] = $productInfo['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$idHotel]['carrier_list'] = array_intersect($orderPackage[$id_address][$idHotel]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$idHotel]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$idHotel]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$idHotel]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -2434,16 +2379,14 @@ class CartCore extends ObjectModel
|
||||
if ($selectedServiceProducts = $objRoomTypeServiceProductCartDetail->getServiceProductsInCart($this->id, $product['id_product'], 0, 0, 0, 0, 0, 0, null, null)) {
|
||||
$array = array();
|
||||
foreach($selectedServiceProducts as $selectedProduct) {
|
||||
$dateJoinKey = $selectedProduct['id_hotel'].'-'.strtotime($selectedProduct['date_from']).strtotime($selectedProduct['date_to']);
|
||||
if (isset($array[$dateJoinKey])) {
|
||||
$array[$dateJoinKey]['total_price_tax_excl'] += $selectedProduct['total_price_tax_excl'];
|
||||
$array[$dateJoinKey]['total_price_tax_incl'] += $selectedProduct['total_price_tax_incl'];
|
||||
if (isset($array[$selectedProduct['id_hotel']])) {
|
||||
$array[$selectedProduct['id_hotel']]['quantity'] += $selectedProduct['quantity'];
|
||||
$array[$selectedProduct['id_hotel']]['total_price_tax_excl'] += $selectedProduct['total_price_tax_excl'];
|
||||
$array[$selectedProduct['id_hotel']]['total_price_tax_incl'] += $selectedProduct['total_price_tax_incl'];
|
||||
} else {
|
||||
$array[$dateJoinKey] = array(
|
||||
'id_hotel' => $selectedProduct['id_hotel'],
|
||||
$array[$selectedProduct['id_hotel']] = array(
|
||||
'quantity' => 0,
|
||||
'date_from' => $selectedProduct['date_from'],
|
||||
'date_to' => $selectedProduct['date_to'],
|
||||
'id_hotel' => $selectedProduct['id_hotel'],
|
||||
'total_price_tax_excl' => $selectedProduct['total_price_tax_excl'],
|
||||
'total_price_tax_incl' => $selectedProduct['total_price_tax_incl'],
|
||||
);
|
||||
@@ -2453,40 +2396,38 @@ class CartCore extends ObjectModel
|
||||
$selectedProduct['date_from'],
|
||||
$selectedProduct['date_to']
|
||||
);
|
||||
$array[$dateJoinKey]['quantity'] += ($selectedProduct['quantity'] * $numDays);
|
||||
$array[$selectedProduct['id_hotel']]['quantity'] += ($selectedProduct['quantity'] * $numDays);
|
||||
} else {
|
||||
$array[$dateJoinKey]['quantity'] += $selectedProduct['quantity'];
|
||||
$array[$selectedProduct['id_hotel']]['quantity'] += $selectedProduct['quantity'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach($array as $dateJoinKey => $selectedProduct) {
|
||||
foreach($array as $selectedProduct) {
|
||||
$product['cart_quantity'] = $selectedProduct['quantity'];
|
||||
$product['total'] = $selectedProduct['total_price_tax_excl'];
|
||||
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
|
||||
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $product['cart_quantity'];
|
||||
$product['price'] = $selectedProduct['total_price_tax_excl'] / $product['cart_quantity'];
|
||||
$product['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
$product['date_from'] = $selectedProduct['date_from'];
|
||||
$product['date_to'] = $selectedProduct['date_to'];
|
||||
$orderPackage[$id_address][$dateJoinKey]['product_list'][] = $product;
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product;
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['carrier_list'] = $product['carrier_list'];
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
|
||||
} else {
|
||||
$orderPackage[$id_address][$dateJoinKey]['carrier_list'] = array_intersect($orderPackage[$id_address][$dateJoinKey]['carrier_list'], $product['carrier_list']);
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['warehouse_list'] = $package['warehouse_list'];
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
|
||||
}
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_warehouse'] = $package['id_warehouse'];
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
|
||||
}
|
||||
if (isset($package['id_carrier'])) {
|
||||
if (!isset($orderPackage[$id_address][$dateJoinKey]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$dateJoinKey]['id_carrier'] = $package['id_carrier'];
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'])) {
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2525,28 +2466,28 @@ class CartCore extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
$hotelAndDateWisePackageList = array();
|
||||
$hotelWisePackageList = array();
|
||||
$numHotels = 0;
|
||||
|
||||
|
||||
if (!empty($serviceProducts)) {
|
||||
foreach ($serviceProducts as $id_address => $packagesByHotels) {
|
||||
foreach ($packagesByHotels as $packageByHotel) {
|
||||
$hotelAndDateWisePackageList[$id_address][] = $packageByHotel;
|
||||
$hotelWisePackageList[$id_address][] = $packageByHotel;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($orderPackage as $id_address => $packageByAddress) {
|
||||
$numHotels += count($packageByAddress);
|
||||
foreach ($packageByAddress as $id_package => $package) {
|
||||
$hotelAndDateWisePackageList[$id_address][] = $package;
|
||||
$hotelWisePackageList[$id_address][] = $package;
|
||||
}
|
||||
}
|
||||
// add sevice products as new package if there are multiple hotels in cart
|
||||
// if ($numHotels > 1 || count($serviceProducts) > 1) {
|
||||
// foreach ($serviceProducts as $productsByAddress) {
|
||||
// if (isset($orderPackage[$id_address])) {
|
||||
// $hotelAndDateWisePackageList[$id_address][] = array(
|
||||
// $hotelWisePackageList[$id_address][] = array(
|
||||
// 'product_list' => $productsByAddress['products'],
|
||||
// 'carrier_list' => $productsByAddress['carrier_list'],
|
||||
// 'warehouse_list' => $productsByAddress['warehouse_list'],
|
||||
@@ -2559,13 +2500,13 @@ class CartCore extends ObjectModel
|
||||
// } else if (!empty($serviceProducts)) {
|
||||
// $serviceProductsIdAddress = array_keys($serviceProducts)[0];
|
||||
// $productsByAddress = array_shift($serviceProducts);
|
||||
// if (isset($hotelAndDateWisePackageList[$serviceProductsIdAddress])) {
|
||||
// $hotelAndDateWisePackageList[$serviceProductsIdAddress][0]['product_list'] = array_merge(
|
||||
// $hotelAndDateWisePackageList[$serviceProductsIdAddress][0]['product_list'],
|
||||
// if (isset($hotelWisePackageList[$serviceProductsIdAddress])) {
|
||||
// $hotelWisePackageList[$serviceProductsIdAddress][0]['product_list'] = array_merge(
|
||||
// $hotelWisePackageList[$serviceProductsIdAddress][0]['product_list'],
|
||||
// $productsByAddress['products']
|
||||
// );
|
||||
// } else {
|
||||
// $hotelAndDateWisePackageList[$id_address][] = array(
|
||||
// $hotelWisePackageList[$id_address][] = array(
|
||||
// 'product_list' => $productsByAddress['products'],
|
||||
// 'carrier_list' => $productsByAddress['carrier_list'],
|
||||
// 'warehouse_list' => $productsByAddress['warehouse_list'],
|
||||
@@ -2575,7 +2516,7 @@ class CartCore extends ObjectModel
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
$final_package_list = $hotelAndDateWisePackageList;
|
||||
$final_package_list = $hotelWisePackageList;
|
||||
// END $package_list hotel wise
|
||||
$cache[$cache_key] = $final_package_list;
|
||||
return $final_package_list;
|
||||
|
||||
@@ -294,6 +294,13 @@ class CartRuleCore extends ObjectModel
|
||||
return array();
|
||||
}
|
||||
|
||||
// Remove cart rule that does not match the id_customer
|
||||
foreach ($result as $key => $cart_rule) {
|
||||
if ($cart_rule['id_customer'] && $cart_rule['id_customer'] != $id_customer) {
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove cart rule that does not match the customer groups
|
||||
$customerGroups = Customer::getGroupsStatic($id_customer);
|
||||
|
||||
@@ -1154,6 +1161,18 @@ class CartRuleCore extends ObjectModel
|
||||
$previous_reduction_amount = $prorata * $previous_reduction_amount * (1 + $cart_average_vat_rate);
|
||||
}
|
||||
|
||||
// First we convert the voucher value to the default currency
|
||||
$previousCartRuleCurrency = new Currency($this->reduction_currency);
|
||||
|
||||
if ($previous_reduction_amount == 0 || $previousCartRuleCurrency->conversion_rate == 0) {
|
||||
$previous_reduction_amount = 0;
|
||||
} else {
|
||||
$previous_reduction_amount /= $previousCartRuleCurrency->conversion_rate;
|
||||
}
|
||||
|
||||
// Then we convert the voucher value in the default currency into the cart currency
|
||||
$previous_reduction_amount *= $context->currency->conversion_rate;
|
||||
$previous_reduction_amount = Tools::ps_round($previous_reduction_amount, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$current_cart_amount = max($current_cart_amount - (float)$previous_reduction_amount, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,9 +72,11 @@ class NotificationCore
|
||||
SELECT SQL_CALC_FOUND_ROWS o.`id_order`, o.`id_customer`, o.`total_paid`, o.`id_currency`, o.`date_upd`, c.`firstname`, c.`lastname`
|
||||
FROM `'._DB_PREFIX_.'orders` as o
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` as c ON (c.`id_customer` = o.`id_customer`)
|
||||
WHERE `id_order` > '.(int)$id_last_element.
|
||||
Shop::addSqlRestriction(false, 'o').'
|
||||
ORDER BY `id_order` DESC
|
||||
LEFT JOIN '._DB_PREFIX_.'htl_booking_detail hbd ON (hbd.id_order = o.id_order)
|
||||
WHERE o.`id_order` > '.(int)$id_last_element.
|
||||
Shop::addSqlRestriction(false, 'o'). HotelBranchInformation::addHotelRestriction(false, 'hbd').'
|
||||
GROUP BY o.`id_order`
|
||||
ORDER BY o.`id_order` DESC
|
||||
LIMIT 5';
|
||||
break;
|
||||
|
||||
|
||||
@@ -775,9 +775,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$maxOverbookingCount = 0;
|
||||
foreach ($order->product_list as $product) {
|
||||
$idProduct = $product['id_product'];
|
||||
if ($product['booking_product']
|
||||
&& $cartBookingData = $objCartBookingData->getCartInfoIdCartIdProduct($this->context->cart->id, $idProduct, $product['date_from'], $product['date_to'])
|
||||
) {
|
||||
$cartBookingData = $objCartBookingData->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $idProduct);
|
||||
if ($cartBookingData) {
|
||||
foreach ($cartBookingData as $bookingInfo) {
|
||||
$objCartBookingData = new HotelCartBookingData($bookingInfo['id']);
|
||||
$objCartBookingData->id_order = $order->id;
|
||||
@@ -990,8 +989,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$product['id_product'],
|
||||
isset($product['id_hotel']) ? $product['id_hotel'] : 0,
|
||||
0,
|
||||
$product['date_from'],
|
||||
$product['date_to'],
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
|
||||
@@ -3437,14 +3437,9 @@ exit;
|
||||
$post_data .= '&method=listing&action=install-modules';
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'catalog-recommendation':
|
||||
$protocols[] = 'http';
|
||||
$post_data .= '&method=content&action=catalogRecommendation';
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'dashboard-recommendation':
|
||||
$protocols[] = 'http';
|
||||
$post_data .= '&method=content&action=dashboardRecommendation';
|
||||
case 'recommendation':
|
||||
$post_data .= '&method=recommendation&controller=';
|
||||
$post_data .= (isset($params['controller']) ? $params['controller'] : Context::getContext()->controller->controller_name);
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'check-version':
|
||||
|
||||
373
classes/cache/Cache.php
vendored
373
classes/cache/Cache.php
vendored
@@ -41,6 +41,27 @@ abstract class CacheCore
|
||||
*/
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* Store the number of time a query is fetched from the cache.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $queryCounter = array();
|
||||
|
||||
/**
|
||||
* Max number of queries cached in memcached, for each SQL table.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $maxCachedObjectsByTable = 10000;
|
||||
|
||||
/**
|
||||
* If a cache set this variable to true, we need to adjust the size of the table cache object.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $adjustTableCacheSize = false;
|
||||
|
||||
/**
|
||||
* @var array List all keys of cached data and their associated ttl
|
||||
*/
|
||||
@@ -49,7 +70,7 @@ abstract class CacheCore
|
||||
/**
|
||||
* @var array Store list of tables and their associated keys for SQL cache (warning: this var must not be initialized here !)
|
||||
*/
|
||||
protected $sql_tables_cached;
|
||||
protected $sql_tables_cached = array();
|
||||
|
||||
/**
|
||||
* @var array List of blacklisted tables for SQL cache, these tables won't be indexed
|
||||
@@ -67,6 +88,8 @@ abstract class CacheCore
|
||||
'guest',
|
||||
'pagenotfound',
|
||||
'page_viewed',
|
||||
'employee',
|
||||
'log',
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -120,6 +143,33 @@ abstract class CacheCore
|
||||
*/
|
||||
abstract public function flush();
|
||||
|
||||
/**
|
||||
* Delete multiple keys from the cache
|
||||
* @param array $keyArray
|
||||
*/
|
||||
protected function _deleteMulti(array $keyArray)
|
||||
{
|
||||
foreach ($keyArray as $key) {
|
||||
$this->delete($key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxCachedObjectsByTable()
|
||||
{
|
||||
return $this->maxCachedObjectsByTable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $maxCachedObjectsByTable
|
||||
*/
|
||||
public function setMaxCachedObjectsByTable($maxCachedObjectsByTable)
|
||||
{
|
||||
$this->maxCachedObjectsByTable = $maxCachedObjectsByTable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cache
|
||||
*/
|
||||
@@ -127,20 +177,36 @@ abstract class CacheCore
|
||||
{
|
||||
if (!self::$instance) {
|
||||
$caching_system = _PS_CACHING_SYSTEM_;
|
||||
self::$instance = new $caching_system();
|
||||
if (class_exists($caching_system)) {
|
||||
/** @var Cache $cache */
|
||||
$cache = new $caching_system();
|
||||
self::$instance = $cache;
|
||||
}
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit testing purpose only
|
||||
* @param $test_instance Cache
|
||||
* @param Cache $test_instance
|
||||
*/
|
||||
public static function setInstanceForTesting($test_instance)
|
||||
{
|
||||
self::$instance = $test_instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* If a cache set this variable to true, we need to adjust the size of the table cache object
|
||||
* Useful when the cache is reported to be full (e.g. memcached::RES_E2BIG error message).
|
||||
*
|
||||
* @param bool $value
|
||||
*/
|
||||
protected function setAdjustTableCacheSize($value)
|
||||
{
|
||||
$this->adjustTableCacheSize = (bool) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unit testing purpose only
|
||||
*/
|
||||
@@ -201,12 +267,22 @@ abstract class CacheCore
|
||||
return $this->_exists($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete several keys at once from the cache
|
||||
*
|
||||
* @param array $keyArray
|
||||
*/
|
||||
public function deleteMulti(array $keyArray)
|
||||
{
|
||||
$this->_deleteMulti($keyArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete one or several data from cache (* joker can be used)
|
||||
* E.g.: delete('*'); delete('my_prefix_*'); delete('my_key_name');
|
||||
*
|
||||
* @param string $key
|
||||
* @return array List of deleted keys
|
||||
* @return bool
|
||||
*/
|
||||
public function delete($key)
|
||||
{
|
||||
@@ -237,7 +313,22 @@ abstract class CacheCore
|
||||
}
|
||||
|
||||
$this->_writeKeys();
|
||||
return $keys;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the query counter for the given query
|
||||
*
|
||||
* @param string $query
|
||||
*/
|
||||
public function incrementQueryCounter($query)
|
||||
{
|
||||
if (isset($this->queryCounter[$query])) {
|
||||
++$this->queryCounter[$query];
|
||||
} else {
|
||||
$this->queryCounter[$query] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,51 +347,175 @@ abstract class CacheCore
|
||||
$result = array();
|
||||
}
|
||||
|
||||
if (is_null($this->sql_tables_cached)) {
|
||||
$this->sql_tables_cached = $this->get(Tools::encryptIV(self::SQL_TABLES_NAME));
|
||||
if (!is_array($this->sql_tables_cached)) {
|
||||
$this->sql_tables_cached = array();
|
||||
}
|
||||
}
|
||||
// use the query counter to update the cache statistics
|
||||
$this->updateQueryCacheStatistics();
|
||||
|
||||
$key = $this->updateTableToQueryMap($query);
|
||||
|
||||
// Store query results in cache
|
||||
$key = Tools::encryptIV($query);
|
||||
// no need to check the key existence before the set : if the query is already
|
||||
// in the cache, setQuery is not invoked
|
||||
$this->set($key, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the hash associated with a query, used to store data into the cache
|
||||
*
|
||||
* @param string $query
|
||||
* @return string
|
||||
*/
|
||||
public function getQueryHash($query)
|
||||
{
|
||||
return Tools::encryptIV($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the hash associated with a table name, used to store the "table to query hash" map
|
||||
*
|
||||
* @param string $table
|
||||
* @return string
|
||||
*/
|
||||
public function getTableMapCacheKey($table)
|
||||
{
|
||||
return Tools::encryptIV(self::SQL_TABLES_NAME . '_' . $table);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function extract all the tables involded in a query, and in the each table map the query hash
|
||||
*
|
||||
* @param string $query
|
||||
* @return string
|
||||
*/
|
||||
private function updateTableToQueryMap($query)
|
||||
{
|
||||
$key = $this->getQueryHash($query);
|
||||
|
||||
// Get all table from the query and save them in cache
|
||||
if ($tables = $this->getTables($query)) {
|
||||
foreach ($tables as $table) {
|
||||
if (!isset($this->sql_tables_cached[$table][$key])) {
|
||||
$this->adjustTableCacheSize($table);
|
||||
$this->sql_tables_cached[$table][$key] = true;
|
||||
}
|
||||
$this->addQueryKeyToTableMap($key, $table, $tables);
|
||||
}
|
||||
}
|
||||
$this->set(Tools::encryptIV(self::SQL_TABLES_NAME), $this->sql_tables_cached);
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Autoadjust the table cache size to avoid storing too big elements in the cache
|
||||
* Add the given query hash to the table to query key map
|
||||
*
|
||||
* @param $table
|
||||
* @param string $key query hash
|
||||
* @param string $table table name
|
||||
* @param array $otherTables the tables associated with the query
|
||||
*/
|
||||
protected function adjustTableCacheSize($table)
|
||||
private function addQueryKeyToTableMap($key, $table, $otherTables)
|
||||
{
|
||||
if (isset($this->sql_tables_cached[$table])
|
||||
&& count($this->sql_tables_cached[$table]) > 5000) {
|
||||
// make sure the cache doesn't contains too many elements : delete the first 1000
|
||||
$table_buffer = array_slice($this->sql_tables_cached[$table], 0, 1000, true);
|
||||
foreach ($table_buffer as $fs_key => $value) {
|
||||
$this->delete($fs_key);
|
||||
$this->delete($fs_key.'_nrows');
|
||||
unset($this->sql_tables_cached[$table][$fs_key]);
|
||||
// the name of the cache entry which cache the table map
|
||||
$cacheKey = $this->getTableMapCacheKey($table);
|
||||
|
||||
$this->initializeTableCache($table);
|
||||
|
||||
if (!isset($this->sql_tables_cached[$table][$key])) {
|
||||
if (count($this->sql_tables_cached[$table]) >= $this->maxCachedObjectsByTable) {
|
||||
$this->adjustTableCacheSize($table);
|
||||
}
|
||||
|
||||
unset($otherTables[array_search($table, $otherTables)]);
|
||||
$this->sql_tables_cached[$table][$key] = [
|
||||
'count' => 1,
|
||||
'otherTables' => $otherTables,
|
||||
];
|
||||
$this->set($cacheKey, $this->sql_tables_cached[$table]);
|
||||
// if the set fails because the object is too big, the adjustTableCacheSize flag is set
|
||||
if ($this->adjustTableCacheSize) {
|
||||
$this->adjustTableCacheSize($table, $key);
|
||||
$this->set($cacheKey, $this->sql_tables_cached[$table]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getTables($string)
|
||||
/**
|
||||
* Use the query counter to update the query cache statistics
|
||||
* So far its only called during a set operation to avoid overloading / slowing down the cache server
|
||||
*/
|
||||
protected function updateQueryCacheStatistics()
|
||||
{
|
||||
$changedTables = array();
|
||||
|
||||
foreach ($this->queryCounter as $query => $count) {
|
||||
$key = $this->getQueryHash($query);
|
||||
|
||||
if ($tables = $this->getTables($query)) {
|
||||
foreach ($tables as $table) {
|
||||
$this->initializeTableCache($table);
|
||||
|
||||
if (isset($this->sql_tables_cached[$table][$key])) {
|
||||
$this->sql_tables_cached[$table][$key]['count'] += $count;
|
||||
$changedTables[$table] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_keys($changedTables) as $table) {
|
||||
$this->set($this->getTableMapCacheKey($table), $this->sql_tables_cached[$table]);
|
||||
}
|
||||
|
||||
$this->queryCounter = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the first less used query results from the cache
|
||||
*
|
||||
* @param string $table
|
||||
* @param string|null $keyToKeep the key we want to keep inside the table cache
|
||||
*/
|
||||
protected function adjustTableCacheSize($table, $keyToKeep = null)
|
||||
{
|
||||
$invalidKeys = array();
|
||||
if (isset($this->sql_tables_cached[$table])) {
|
||||
if ($keyToKeep && isset($this->sql_tables_cached[$table][$keyToKeep])) {
|
||||
$toKeep = $this->sql_tables_cached[$table][$keyToKeep];
|
||||
// remove the key we plan to keep before adjusting the table cache size
|
||||
unset($this->sql_tables_cached[$table][$keyToKeep]);
|
||||
}
|
||||
|
||||
// sort the array with the query with the lowest count first
|
||||
uasort($this->sql_tables_cached[$table], function ($a, $b) {
|
||||
if ($a['count'] == $b['count']) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ($a['count'] < $b['count']) ? -1 : 1;
|
||||
});
|
||||
// reduce the size of the cache : delete the first entries (those with the lowest count)
|
||||
$tableBuffer = array_slice(
|
||||
$this->sql_tables_cached[$table],
|
||||
0,
|
||||
(int) ceil($this->maxCachedObjectsByTable / 3),
|
||||
true
|
||||
);
|
||||
foreach (array_keys($tableBuffer) as $fs_key) {
|
||||
$invalidKeys[] = $fs_key;
|
||||
$invalidKeys[] = $fs_key . '_nrows';
|
||||
unset($this->sql_tables_cached[$table][$fs_key]);
|
||||
}
|
||||
$this->_deleteMulti($invalidKeys);
|
||||
|
||||
if ($keyToKeep) {
|
||||
$this->sql_tables_cached[$table][$keyToKeep] = $toKeep ?? null;
|
||||
}
|
||||
}
|
||||
$this->adjustTableCacheSize = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tables used in a SQL query.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return array|bool
|
||||
*/
|
||||
public function getTables($string)
|
||||
{
|
||||
if (preg_match_all('/(?:from|join|update|into)\s+`?('._DB_PREFIX_.'[0-9a-z_-]+)(?:`?\s{0,},\s{0,}`?('._DB_PREFIX_.'[0-9a-z_-]+)`?)?(?:`|\s+|\Z)(?!\s*,)/Umsi', $string, $res)) {
|
||||
foreach ($res[2] as $table) {
|
||||
@@ -321,25 +536,90 @@ abstract class CacheCore
|
||||
*/
|
||||
public function deleteQuery($query)
|
||||
{
|
||||
if (is_null($this->sql_tables_cached)) {
|
||||
$this->sql_tables_cached = $this->get(Tools::encryptIV(self::SQL_TABLES_NAME));
|
||||
if (!is_array($this->sql_tables_cached)) {
|
||||
$this->sql_tables_cached = array();
|
||||
if ($this->isBlacklist($query)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$invalidKeys = array();
|
||||
$tableKeysToUpdate = array();
|
||||
if ($tables = $this->getTables($query)) {
|
||||
foreach ($tables as $table) {
|
||||
$cacheKey = $this->initializeTableCache($table);
|
||||
|
||||
if (!empty($this->sql_tables_cached[$table])) {
|
||||
foreach ($this->sql_tables_cached[$table] as $fs_key => $tableMapInfos) {
|
||||
$invalidKeys[] = $fs_key;
|
||||
$invalidKeys[] = $fs_key . '_nrows';
|
||||
|
||||
foreach ($tableMapInfos['otherTables'] as $otherTable) {
|
||||
if ($this->removeEntryInTableMapCache($fs_key, $otherTable)) {
|
||||
$tableKeysToUpdate[$otherTable] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($this->sql_tables_cached[$table]);
|
||||
$this->deleteMulti($invalidKeys);
|
||||
$this->delete($cacheKey);
|
||||
}
|
||||
}
|
||||
$this->flushUpdatedTableKeyEntries($tableKeysToUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Flush into the cache the updated entries from the sql_tables_caches.
|
||||
*
|
||||
* @param array $tableKeysToUpdate
|
||||
*/
|
||||
private function flushUpdatedTableKeyEntries($tableKeysToUpdate)
|
||||
{
|
||||
foreach (array_keys($tableKeysToUpdate) as $tableKeyToUpdate) {
|
||||
$cacheKey = $this->getTableMapCacheKey($tableKeyToUpdate);
|
||||
if (empty($this->sql_tables_cached[$tableKeyToUpdate])) {
|
||||
$this->delete($cacheKey);
|
||||
} else {
|
||||
$this->set($cacheKey, $this->sql_tables_cached[$tableKeyToUpdate]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the table cache entry associated with $table.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function initializeTableCache($table)
|
||||
{
|
||||
$cacheKey = $this->getTableMapCacheKey($table);
|
||||
|
||||
if (!array_key_exists($table, $this->sql_tables_cached)) {
|
||||
$this->sql_tables_cached[$table] = $this->get($cacheKey);
|
||||
if (!is_array($this->sql_tables_cached[$table])) {
|
||||
$this->sql_tables_cached[$table] = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($tables = $this->getTables($query)) {
|
||||
foreach ($tables as $table) {
|
||||
if (isset($this->sql_tables_cached[$table])) {
|
||||
foreach (array_keys($this->sql_tables_cached[$table]) as $fs_key) {
|
||||
$this->delete($fs_key);
|
||||
$this->delete($fs_key.'_nrows');
|
||||
}
|
||||
unset($this->sql_tables_cached[$table]);
|
||||
}
|
||||
}
|
||||
return $cacheKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove $key from the tableMap
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $table
|
||||
* @return bool True is the key exists in the table
|
||||
*/
|
||||
private function removeEntryInTableMapCache($key, $table)
|
||||
{
|
||||
if (isset($this->sql_tables_cached[$table][$key])) {
|
||||
unset($this->sql_tables_cached[$table][$key]);
|
||||
|
||||
return true;
|
||||
}
|
||||
$this->set(Tools::encryptIV(self::SQL_TABLES_NAME), $this->sql_tables_cached);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,6 +649,11 @@ abstract class CacheCore
|
||||
Cache::$local[$key] = $value;
|
||||
}
|
||||
|
||||
public static function clear()
|
||||
{
|
||||
Cache::$local = array();
|
||||
}
|
||||
|
||||
public static function retrieve($key)
|
||||
{
|
||||
return isset(Cache::$local[$key]) ? Cache::$local[$key] : null;
|
||||
|
||||
8
classes/cache/CacheApc.php
vendored
8
classes/cache/CacheApc.php
vendored
@@ -81,7 +81,13 @@ class CacheApcCore extends Cache
|
||||
*/
|
||||
protected function _set($key, $value, $ttl = 0)
|
||||
{
|
||||
return (($this->apcu) ? apcu_store($key, $value, $ttl) : apc_store($key, $value, $ttl));
|
||||
|
||||
$result = (($this->apcu) ? apcu_store($key, $value, $ttl) : apc_store($key, $value, $ttl));
|
||||
if ($result === false) {
|
||||
$this->setAdjustTableCacheSize(true);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
8
classes/cache/CacheMemcache.php
vendored
8
classes/cache/CacheMemcache.php
vendored
@@ -80,7 +80,13 @@ class CacheMemcacheCore extends Cache
|
||||
if (!$this->is_connected) {
|
||||
return false;
|
||||
}
|
||||
return $this->memcache->set($key, $value, 0, $ttl);
|
||||
$result = $this->memcache->set($key, $value, 0, $ttl);
|
||||
|
||||
if ($result === false) {
|
||||
$this->setAdjustTableCacheSize(true);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
13
classes/cache/CacheMemcached.php
vendored
13
classes/cache/CacheMemcached.php
vendored
@@ -64,7 +64,7 @@ class CacheMemcachedCore extends Cache
|
||||
$this->memcached = new Memcached();
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
$servers = self::getMemcachedServers();
|
||||
if (!$servers)
|
||||
return;
|
||||
@@ -81,7 +81,16 @@ class CacheMemcachedCore extends Cache
|
||||
{
|
||||
if (!$this->is_connected)
|
||||
return false;
|
||||
return $this->memcached->set($key, $value, $ttl);
|
||||
|
||||
$result = $this->memcached->set($key, $value, $ttl);
|
||||
|
||||
if ($result === false) {
|
||||
if ($this->memcached->getResultCode() === memcached::RES_E2BIG) {
|
||||
$this->setAdjustTableCacheSize(true);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
8
classes/cache/CacheXcache.php
vendored
8
classes/cache/CacheXcache.php
vendored
@@ -43,7 +43,13 @@ class CacheXcacheCore extends Cache
|
||||
*/
|
||||
protected function _set($key, $value, $ttl = 0)
|
||||
{
|
||||
return xcache_set($key, $value, $ttl);
|
||||
$result = xcache_set($key, $value, $ttl);
|
||||
|
||||
if ($result === false) {
|
||||
$this->setAdjustTableCacheSize(true);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -197,6 +197,9 @@ class AdminControllerCore extends Controller
|
||||
/** @var string */
|
||||
protected $_filterHaving;
|
||||
|
||||
/** @var string */
|
||||
protected $_new_list_header_design = false;
|
||||
|
||||
/** @var array Temporary SQL table WHERE clause determined by filter fields */
|
||||
protected $_tmpTableFilter = '';
|
||||
|
||||
@@ -406,6 +409,9 @@ class AdminControllerCore extends Controller
|
||||
const QLO_SEARCH_TYPE_MODULE = 7;
|
||||
const QLO_SEARCH_TYPE_HOTEL = 8;
|
||||
|
||||
/** @var string path for recomendation content */
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $timer_start;
|
||||
@@ -2307,6 +2313,7 @@ class AdminControllerCore extends Controller
|
||||
public function ajaxProcessRefreshModuleList($force_reload_cache = false)
|
||||
{
|
||||
$this->status = Module::refreshModuleList($force_reload_cache);
|
||||
$this->ajaxDie(json_encode(array('status' => $this->status)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2511,6 +2518,7 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
$this->setHelperDisplay($helper);
|
||||
$helper->_new_list_header_design = $this->_new_list_header_design;
|
||||
$helper->_default_pagination = $this->_default_pagination;
|
||||
$helper->_pagination = $this->_pagination;
|
||||
$helper->tpl_vars = $this->getTemplateListVars();
|
||||
@@ -3985,17 +3993,65 @@ class AdminControllerCore extends Controller
|
||||
public function ajaxProcessGetRecommendationContent()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if (isset($this->context->cookie->{$this->controller_name.'_closed'}) && $this->context->cookie->{$this->controller_name.'_closed'}) {
|
||||
$response['success'] = true;
|
||||
} else {
|
||||
if (method_exists($this, 'getRecommendationContent')) {
|
||||
if ($content = $this->getRecommendationContent()) {
|
||||
$response['success'] = true;
|
||||
$response['content'] = $content;
|
||||
if ($this->context->controller->getRecommendationFilePath()) {
|
||||
$response = $this->getRecommendationContent();
|
||||
}
|
||||
$this->context->cookie->write();
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
$content = array(
|
||||
'success' => false,
|
||||
'cache' => true,
|
||||
'html' => ''
|
||||
);
|
||||
|
||||
if ($recommendationContent = $this->updateRecommendationContent()) {
|
||||
$content['cache'] = false;
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
$content['success'] = true;
|
||||
if (!isset($this->context->cookie->{$this->controller_name.'_closed'}) || !$this->context->cookie->{$this->controller_name.'_closed'}) {
|
||||
$content['html'] = file_get_contents(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function updateRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh($this->context->controller->getRecommendationFilePath(), _TIME_1_DAY_, false)) {
|
||||
if ($recommendationContent = Tools::addonsRequest(
|
||||
'recommendation',
|
||||
array('controller' => $this->context->controller->controller_name)
|
||||
)) {
|
||||
$recommendationContent = json_decode($recommendationContent, true);
|
||||
if (!isset($this->context->cookie->{$this->context->controller->controller_name.'_key'})) {
|
||||
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = '';
|
||||
}
|
||||
if ($this->context->cookie->{$this->context->controller->controller_name.'_key'} != $recommendationContent['key']) {
|
||||
unset($this->context->cookie->{$this->context->controller->controller_name.'_closed'});
|
||||
}
|
||||
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = $recommendationContent['key'];
|
||||
if (isset($recommendationContent['success']) && $recommendationContent['success']) {
|
||||
@file_put_contents(
|
||||
_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath(),
|
||||
$recommendationContent['html']
|
||||
);
|
||||
} elseif (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
return $recommendationContent;
|
||||
} else {
|
||||
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
return false;
|
||||
}
|
||||
|
||||
public function ajaxProcessRecommendationClosed()
|
||||
@@ -4005,6 +4061,11 @@ class AdminControllerCore extends Controller
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function getRecommendationFilePath()
|
||||
{
|
||||
return static::RECOMMENDATION_CONTENT_FILE_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save list visible columns
|
||||
*
|
||||
|
||||
@@ -629,8 +629,9 @@ abstract class DbCore
|
||||
$this->last_query = $sql;
|
||||
|
||||
if ($use_cache && $this->is_cache_enabled && $array) {
|
||||
$this->last_query_hash = Tools::encryptIV($sql);
|
||||
$this->last_query_hash = Cache::getInstance()->getQueryHash($sql);
|
||||
if (($result = Cache::getInstance()->get($this->last_query_hash)) !== false) {
|
||||
Cache::getInstance()->incrementQueryCounter($sql);
|
||||
$this->last_cached = true;
|
||||
return $result;
|
||||
}
|
||||
@@ -684,8 +685,9 @@ abstract class DbCore
|
||||
$this->last_query = $sql;
|
||||
|
||||
if ($use_cache && $this->is_cache_enabled) {
|
||||
$this->last_query_hash = Tools::encryptIV($sql);
|
||||
$this->last_query_hash = Cache::getInstance()->getQueryHash($sql);
|
||||
if (($result = Cache::getInstance()->get($this->last_query_hash)) !== false) {
|
||||
Cache::getInstance()->incrementQueryCounter($sql);
|
||||
$this->last_cached = true;
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ class HelperListCore extends Helper
|
||||
/** @var array WHERE clause determined by filter fields */
|
||||
protected $_filter;
|
||||
|
||||
public $_new_list_header_design = false;
|
||||
|
||||
/** @var array Number of results in list per page (used in select field) */
|
||||
public $_pagination = array(20, 50, 100, 300, 1000);
|
||||
|
||||
@@ -742,6 +744,7 @@ class HelperListCore extends Helper
|
||||
Context::getContext()->smarty->assign(array(
|
||||
'page' => $page,
|
||||
'simple_header' => $this->simple_header,
|
||||
'new_list_header_design' => $this->_new_list_header_design,
|
||||
'total_pages' => $total_pages,
|
||||
'selected_pagination' => $selected_pagination,
|
||||
'pagination' => $this->_pagination,
|
||||
|
||||
@@ -154,13 +154,12 @@ abstract class ModuleGridCore extends Module
|
||||
{
|
||||
$this->_sort = $datas['defaultSortColumn'];
|
||||
$this->setLang(Context::getContext()->language->id);
|
||||
$this->getData();
|
||||
|
||||
$layers = isset($datas['layers']) ? $datas['layers'] : 1;
|
||||
|
||||
if (isset($datas['option'])) {
|
||||
$this->setOption($datas['option'], $layers);
|
||||
}
|
||||
$this->getData();
|
||||
|
||||
$layers = isset($datas['layers']) ? $datas['layers'] : 1;
|
||||
|
||||
if (count($datas['columns'])) {
|
||||
foreach ($datas['columns'] as $column) {
|
||||
|
||||
@@ -797,8 +797,9 @@ class OrderCore extends ObjectModel
|
||||
|
||||
public function getTaxesAverageUsed()
|
||||
{
|
||||
// @todo should use order table to get tax average
|
||||
return Cart::getTaxesAverageUsed((int)$this->id_cart);
|
||||
$cart = new Cart((int) $this->id_cart);
|
||||
|
||||
return $cart->getAverageProductsTaxRate() * 100;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2687,4 +2688,133 @@ class OrderCore extends ObjectModel
|
||||
{
|
||||
$this->transaction_id = $transactionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and change order status
|
||||
* @return array of status, errors, has_mail_error(if order status is changes but mail error occurs while sending mail)
|
||||
*/
|
||||
public function ChangeOrderStatus()
|
||||
{
|
||||
$result = array();
|
||||
$result['status'] = false;
|
||||
$result['has_mail_error'] = false;
|
||||
$result['errors'] = array();
|
||||
$objNewOrderState = new OrderState(Tools::getValue('id_order_state'));
|
||||
if (!Validate::isLoadedObject($objNewOrderState)) {
|
||||
$result['errors'][] = Tools::displayError('The new order status is invalid.');
|
||||
} else {
|
||||
$objHotelBooking = new HotelBookingDetail();
|
||||
$objCurrentOrderState = $this->getCurrentOrderState();
|
||||
|
||||
if ($objCurrentOrderState->id == Configuration::get('PS_OS_REFUND')) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Refunded.');
|
||||
} elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_CANCELED')) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Cancelled.');
|
||||
} elseif (in_array($objNewOrderState->id, array (Configuration::get('PS_OS_OVERBOOKING_PAID'), Configuration::get('PS_OS_OVERBOOKING_UNPAID'), Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')))) {
|
||||
if (!$objHotelBooking->getOverbookedRooms($this->id)) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed to any overbooking status as there are no overbooked rooms in the order.');
|
||||
}
|
||||
} elseif ($objNewOrderState->id == Configuration::get('PS_OS_REFUND')
|
||||
&& !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_REFUND_FLAG)
|
||||
) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be set to Refunded until all bookings in the order are completely refunded.');
|
||||
} elseif ($objNewOrderState->id == Configuration::get('PS_OS_CANCELED')
|
||||
&& !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)
|
||||
) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be set to Cancelled until all bookings in the order are cancelled.');
|
||||
} elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_ERROR') && !($objNewOrderState->id == Configuration::get('PS_OS_ERROR'))) {
|
||||
// All rooms must be available before changing status from Payment Error to Other status in which rooms are getting blocked again
|
||||
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
|
||||
foreach ($orderBookings as $orderBooking) {
|
||||
// If booking is refunded then no need to check inventory
|
||||
if ((OrderReturn::getOrdersReturnDetail($this->id, 0, $orderBooking['id']) && $orderBooking['is_refunded'])
|
||||
|| ($orderBooking['is_cancelled'] && $orderBooking['is_refunded'])
|
||||
) {
|
||||
continue;
|
||||
} else {
|
||||
// if inventory is available for that booking
|
||||
$bookingParams = array(
|
||||
'date_from' => $orderBooking['date_from'],
|
||||
'date_to' => $orderBooking['date_to'],
|
||||
'hotel_id' => $orderBooking['id_hotel'],
|
||||
'id_room_type' => $orderBooking['id_product'],
|
||||
'only_search_data' => 1
|
||||
);
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail($orderBooking['id']);
|
||||
if ($searchRoomsInfo = $objHotelBooking->getBookingData($bookingParams)) {
|
||||
if (isset($searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available'])
|
||||
&& $searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available']
|
||||
) {
|
||||
$availableRoomsInfo = $searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available'];
|
||||
if ($roomIdsAvailable = array_column($availableRoomsInfo, 'id_room')) {
|
||||
// Check If room is still there in the available rooms list
|
||||
if (!in_array($orderBooking['id_room'], $roomIdsAvailable)) {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
|
||||
break;
|
||||
} else {
|
||||
$objHotelBookingDetail->is_refunded = 0;
|
||||
$objHotelBookingDetail->save();
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($objCurrentOrderState->id == $objNewOrderState->id) {
|
||||
$result['errors'][] = Tools::displayError('The order has already been assigned this status.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($result['errors'])) {
|
||||
// Create new OrderHistory
|
||||
$context = Context::getContext();
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = $this->id;
|
||||
$history->id_employee = (int)$context->employee->id;
|
||||
|
||||
$useExistingsPayment = false;
|
||||
if (!$this->hasInvoice()) {
|
||||
$useExistingsPayment = true;
|
||||
}
|
||||
$history->changeIdOrderState((int)$objNewOrderState->id, $this, $useExistingsPayment);
|
||||
|
||||
// Save all changes
|
||||
$templateVars = array();
|
||||
if ($history->add(true)) {
|
||||
if (!$history->sendEmail($this, $templateVars)) {
|
||||
// if an error occurred while sending an email the set has_mail_error to true
|
||||
$result['has_mail_error'] = true;
|
||||
$result['errors'][] = Tools::displayError('We were unable to send an email to the customer while changing order status.');
|
||||
}
|
||||
|
||||
// synchronizes quantities if needed..
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) {
|
||||
foreach ($this->getProducts() as $product) {
|
||||
if (StockAvailable::dependsOnStock($product['product_id'])) {
|
||||
StockAvailable::synchronize($product['product_id'], (int)$product['id_shop']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('An error occurred while changing order status.');
|
||||
}
|
||||
}
|
||||
|
||||
// if no errors then return status true
|
||||
if (!count($result['errors'])) {
|
||||
$result['status'] = true;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ class OrderHistoryCore extends ObjectModel
|
||||
);
|
||||
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang);
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel);
|
||||
$fields = array_merge(
|
||||
$objHotelBranchInformation->getFields(),
|
||||
$objHotelBranchInformation->getFieldsLang()[$order->id_lang],
|
||||
|
||||
@@ -271,7 +271,7 @@ class OrderReturnCore extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
}
|
||||
$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`,
|
||||
orr.`id_return_type`, orr.`return_type`, ors.`id_cart_rule`, orr.`date_add`, orr.`date_upd`, orr.`refunded_amount`,
|
||||
hbd.`is_cancelled`, COUNT(ord.`id_order_return_detail`) AS total_rooms
|
||||
FROM `'._DB_PREFIX_.'order_return` orr
|
||||
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord
|
||||
|
||||
@@ -42,11 +42,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
$this->allow_export = true;
|
||||
$this->_orderWay = 'DESC';
|
||||
$this->context = Context::getContext();
|
||||
|
||||
$this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total,
|
||||
TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`,
|
||||
IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order,
|
||||
|
||||
IFNULL(GROUP_CONCAT(DISTINCT o.`id_order`), 0) AS `ids_order`,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > '._TIME_1_DAY_.', \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(DISTINCT o.`id_order`)) AS filter_ids_order,
|
||||
IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
|
||||
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
|
||||
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)
|
||||
@@ -54,10 +54,6 @@ class AdminCartsControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', co.`date_add`)) < 1800)';
|
||||
$this->_group = ' GROUP BY a.`id_cart`';
|
||||
|
||||
if (Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
|
||||
$this->_filterHaving = ' AND `ids_order` = 0 AND `time_diff` > 86400';
|
||||
}
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_cart' => array(
|
||||
'title' => $this->l('ID'),
|
||||
@@ -96,7 +92,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'type' => 'bool',
|
||||
'havingFilter' => true,
|
||||
'class' => 'fixed-width-xs',
|
||||
'icon' => array(0 => 'icon-', 1 => 'icon-user')
|
||||
'callback' => 'getOnlineStatus',
|
||||
)
|
||||
);
|
||||
$this->shopLinkType = 'shop';
|
||||
@@ -117,10 +113,32 @@ class AdminCartsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->list_no_link = true;
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
|
||||
$this->processResetFilters();
|
||||
$this->context->cookie->{'submitFilter'.$this->table} = true;
|
||||
$prefix = $this->getCookieFilterPrefix();
|
||||
$this->context->cookie->{$prefix.$this->table.'Filter_filter_ids_order'} = $this->l('Abandoned cart');
|
||||
if (($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
&& strtotime($dateTo) >= strtotime($dateFrom)
|
||||
) {
|
||||
//Updating the date format of the filter dates to the required format.
|
||||
$dateFrom = date('Y-m-d', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d', strtotime($dateTo));
|
||||
$this->context->cookie->{$prefix.$this->table.'Filter_'.$this->fields_list['date_add']['filter_key']} = json_encode(array($dateFrom, $dateTo));
|
||||
}
|
||||
|
||||
$this->redirect_after = $this->context->link->getAdminLink('AdminCarts');
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
public function getOrderColumn($idsOrder, $tr)
|
||||
{
|
||||
$smartyVars = array();
|
||||
@@ -129,7 +147,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$smartyVars['type'] = 'orders';
|
||||
$smartyVars['ids_order'] = $idsOrder;
|
||||
} else {
|
||||
if ($tr['time_diff'] > 86400) {
|
||||
if ($tr['time_diff'] > _TIME_1_DAY_) {
|
||||
$smartyVars['type'] = 'abandoned';
|
||||
} else {
|
||||
$smartyVars['type'] = 'non_orderd';
|
||||
@@ -143,6 +161,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
public function getOnlineStatus($status)
|
||||
{
|
||||
return $status ? $this->l('Yes') : $this->l('No');
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (empty($this->display)) {
|
||||
@@ -184,7 +207,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$date_from = date(Context::getContext()->language->date_format_lite, strtotime('-2 day'));
|
||||
$date_to = date(Context::getContext()->language->date_format_lite, strtotime('-1 day'));
|
||||
$helper->subtitle = sprintf($this->l('From %s to %s', null, null, false), $date_from, $date_to);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts&date_from='.$date_from.'&date_to='.$date_to;
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart';
|
||||
$kpis[] = $helper;
|
||||
|
||||
@@ -333,6 +356,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
public function ajaxPreProcess()
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1') {
|
||||
// prevent cart creation when kpi visibility or kpi view is updated.
|
||||
// @todo: move the below cart creation process required function.
|
||||
if (in_array(Tools::getValue('action'), array('changeKpiVisibility', 'saveKpiView'))) {
|
||||
return;
|
||||
}
|
||||
$id_customer = (int)Tools::getValue('id_customer');
|
||||
$customer = new Customer((int)$id_customer);
|
||||
$this->context->customer = $customer;
|
||||
|
||||
@@ -121,13 +121,6 @@ class AdminCustomerPreferencesControllerCore extends AdminController
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_CUSTOMER_ADDRESS_CREATION' => array(
|
||||
'title' => $this->l('Address creation during checkout'),
|
||||
'hint' => $this->l('If disabled, Address form will not appear to user during checkout process. So by default hotel address, which rooms guest has in his cart will be considered as user address. Else user has to fill adress details.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_KPI_FREQUENT_CUSTOMER_NB_ORDERS' => array(
|
||||
'title' => $this->l('Number of orders to use to calculate frequent customers'),
|
||||
'hint' => $this->l('Set the number of orders to use to calculate frequent customers.'),
|
||||
|
||||
@@ -71,7 +71,14 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$titles_array[$gender->id_gender] = $gender->name;
|
||||
}
|
||||
|
||||
$groups_array = array();
|
||||
$groups = Group::getGroups(Context::getContext()->language->id);
|
||||
foreach ($groups as $group) {
|
||||
$groups_array[$group['id_group']] = $group['name'];
|
||||
}
|
||||
|
||||
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON (a.id_gender = gl.id_gender AND gl.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'group_lang grl ON (a.id_default_group = grl.id_group AND grl.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_use_found_rows = false;
|
||||
$this->fields_list = array(
|
||||
'id_customer' => array(
|
||||
@@ -107,9 +114,25 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->fields_list = array_merge($this->fields_list, array(
|
||||
'default_group_name' => array(
|
||||
'title' => $this->l('Default Group'),
|
||||
'optional' => true,
|
||||
'type' => 'select',
|
||||
'list' => $groups_array,
|
||||
'filter_key' => 'a!id_default_group',
|
||||
),
|
||||
'total_orders' => array(
|
||||
'title' => $this->l('Number of orders'),
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'havingFilter' => true,
|
||||
'order_key' => 'total_orders'
|
||||
),
|
||||
'total_spent' => array(
|
||||
'title' => $this->l('Sales'),
|
||||
'type' => 'price',
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'search' => false,
|
||||
'havingFilter' => true,
|
||||
'align' => 'text-right',
|
||||
@@ -155,13 +178,19 @@ class AdminCustomersControllerCore extends AdminController
|
||||
parent::__construct();
|
||||
|
||||
$this->_select = '
|
||||
a.date_add, gl.name as title, (
|
||||
a.date_add, gl.name as title, grl.name as default_group_name, (
|
||||
SELECT SUM(total_paid_real / conversion_rate)
|
||||
FROM '._DB_PREFIX_.'orders o
|
||||
WHERE o.id_customer = a.id_customer
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
AND o.valid = 1
|
||||
) as total_spent, (
|
||||
SELECT COUNT(o.`id_order`)
|
||||
FROM '._DB_PREFIX_.'orders o
|
||||
WHERE o.id_customer = a.id_customer
|
||||
'.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o').'
|
||||
AND o.valid = 1
|
||||
) as total_orders, (
|
||||
SELECT c.date_add FROM '._DB_PREFIX_.'guest g
|
||||
LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest
|
||||
WHERE g.id_customer = a.id_customer
|
||||
@@ -326,6 +355,8 @@ class AdminCustomersControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
@@ -601,7 +632,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$birthday = explode('-', $this->getFieldValue($obj, 'birthday'));
|
||||
|
||||
|
||||
$this->fields_value = array(
|
||||
'years' => Tools::getValue('years', $this->getFieldValue($obj, 'birthday') ? $birthday[0] : 0),
|
||||
'months' => Tools::getValue('months', $this->getFieldValue($obj, 'birthday') ? $birthday[1] : 0),
|
||||
@@ -1062,7 +1093,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$days = Tools::getValue('days');
|
||||
$months = Tools::getValue('months');
|
||||
$years = Tools::getValue('years');
|
||||
|
||||
|
||||
if ($days || $months || $years) {
|
||||
if (!$days) {
|
||||
$this->errors[] = Tools::displayError("Please select a valid date of birthday");
|
||||
@@ -1074,10 +1105,10 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError("Please select a valid month of birthday");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$customer = new Customer();
|
||||
$this->errors = array_merge($this->errors, $customer->validateFieldsRequiredDatabase());
|
||||
|
||||
|
||||
return parent::processSave();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class AdminDashboardControllerCore extends AdminController
|
||||
{
|
||||
|
||||
const DASHBOARD_RECOMMENDATION_CONTENT = '/cache/dashboard_recommendation.html';
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/dashboard_recommendation.html';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -502,15 +502,4 @@ class AdminDashboardControllerCore extends AdminController
|
||||
|
||||
die(json_encode($return));
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh(self::DASHBOARD_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
|
||||
@file_put_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT, Tools::addonsRequest('dashboard-recommendation'));
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT)) {
|
||||
return Tools::file_get_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
|
||||
if (($iso_localization_pack = Tools::getValue('iso_localization_pack')) && Validate::isFileName($iso_localization_pack)) {
|
||||
if (Tools::getValue('download_updated_pack') == '1' || defined('_PS_HOST_MODE_')) {
|
||||
$pack = @Tools::file_get_contents(_PS_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
|
||||
$pack = @Tools::file_get_contents(_QLO_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
|
||||
} else {
|
||||
$pack = false;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
$localizations_pack = false;
|
||||
$this->tpl_option_vars['options_content'] = $this->renderOptions();
|
||||
|
||||
$xml_localization = Tools::simplexml_load_file(_PS_API_URL_.'/rss/localization.xml');
|
||||
$xml_localization = Tools::simplexml_load_file(_QLO_API_URL_.'/xml/localization.xml');
|
||||
if (!$xml_localization) {
|
||||
$localization_file = _PS_ROOT_DIR_.'/localization/localization.xml';
|
||||
if (file_exists($localization_file)) {
|
||||
@@ -248,7 +248,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (!$localizations_pack) {
|
||||
return $this->displayWarning($this->l('Cannot connect to '._PS_API_URL_));
|
||||
return $this->displayWarning($this->l('Cannot connect to '._QLO_API_URL_));
|
||||
}
|
||||
|
||||
// Add local localization .xml files to the list if they are not already there
|
||||
|
||||
@@ -23,7 +23,7 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
|
||||
public $modules;
|
||||
|
||||
const CATALOG_RECOMMENDATION_CONTENT = '/cache/catalog_recommendation.html';
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/catalog_recommendation.html';
|
||||
|
||||
const ELEMENT_TYPE_MODULE = 1;
|
||||
const ELEMENT_TYPE_THEME = 2;
|
||||
@@ -240,17 +240,6 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh(self::CATALOG_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
|
||||
@file_put_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT, Tools::addonsRequest('catalog-recommendation'));
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT)) {
|
||||
return Tools::file_get_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function sortList(&$list, $type)
|
||||
{
|
||||
|
||||
|
||||
@@ -168,6 +168,15 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$join_category = true;
|
||||
}
|
||||
|
||||
$priceAdditionType = array(
|
||||
Product::PRICE_ADDITION_TYPE_WITH_ROOM => $this->l('Add price in room price'),
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT => $this->l('Convenience Fee')
|
||||
);
|
||||
$priceCalculationMethod = array(
|
||||
Product::PRICE_CALCULATION_METHOD_PER_BOOKING => $this->l('Add price once for the booking range'),
|
||||
Product::PRICE_CALCULATION_METHOD_PER_DAY => $this->l('Add price for each day of booking')
|
||||
);
|
||||
|
||||
$this->_join .= '
|
||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
|
||||
'.StockAvailable::addSqlShopRestriction(null, null, 'sav').') ';
|
||||
@@ -188,7 +197,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)';
|
||||
|
||||
$this->_select .= ' IF(a.`auto_add_to_cart`, "'.$this->l('Yes').'", "'.$this->l('No').'") as auto_added, IF(a.`auto_add_to_cart`, 1, 0) as badge_success, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
$this->_select .= ' IF(a.`auto_add_to_cart`, "'.$this->l('Yes').'", "'.$this->l('No').'") as auto_added, IF(a.`auto_add_to_cart`, 1, 0) as badge_success, IF(a.`show_at_front`, "'.$this->l('Yes').'", "'.$this->l('No').'") as show_at_front_txt, IF(a.`price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_PER_DAY.', "'.$this->l('Per Day').'", "'.$this->l('Per Booking').'") as price_calculation_method_txt, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
$this->_select .= ' COUNT(rsp.`id_product`) as products_associated, hrt.`adults`, hrt.`children`, hb.`id` as id_hotel, aa.`city`, hbl.`hotel_name`, ';
|
||||
$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
|
||||
$this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
|
||||
@@ -227,14 +236,62 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
'title' => $this->l('Associated Rooms types'),
|
||||
'class' => 'fixed-width-sm',
|
||||
'havingFilter' => true,
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
);
|
||||
$this->fields_list['auto_added'] = array(
|
||||
'title' => $this->l('Auto Added'),
|
||||
'filter_key' => 'a!auto_add_to_cart',
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'badge_success' => true
|
||||
);
|
||||
$this->fields_list['show_at_front_txt'] = array(
|
||||
'title' => $this->l('Show at Front'),
|
||||
'filter_key' => 'a!show_at_front',
|
||||
'align' => 'text-center',
|
||||
'type' => 'bool',
|
||||
'optional' => true,
|
||||
);
|
||||
$this->fields_list['available_for_order'] = array(
|
||||
'displayed' => false,
|
||||
'title' => $this->l('Available for order'),
|
||||
'filter_key' => 'a!available_for_order',
|
||||
'type' => 'bool',
|
||||
);
|
||||
$this->fields_list['price_addition_type'] = array(
|
||||
'displayed' => false,
|
||||
'title' => $this->l('Price display preference'),
|
||||
'filter_key' => 'a!price_addition_type',
|
||||
'type' => 'select',
|
||||
'list' => $priceAdditionType,
|
||||
);
|
||||
$this->fields_list['price_calculation_method_txt'] = array(
|
||||
'title' => $this->l('Price calculation method'),
|
||||
'filter_key' => 'a!price_calculation_method',
|
||||
'type' => 'select',
|
||||
'list' => $priceCalculationMethod,
|
||||
'visible_default' => true,
|
||||
'optional' => true,
|
||||
);
|
||||
$this->servicesCategory = array();
|
||||
$idServiceCategory = Configuration::get('PS_SERVICE_CATEGORY');
|
||||
$this->objLocationsCategory = new Category($idServiceCategory, $this->context->language->id);
|
||||
$nestedCategories = Category::getNestedCategories($idServiceCategory);
|
||||
if ($nestedCategories) {
|
||||
foreach ($nestedCategories[$idServiceCategory]['children'] as $childCategory) {
|
||||
$this->buildCategoryOptions($childCategory);
|
||||
}
|
||||
}
|
||||
$this->fields_list['name_category'] = array(
|
||||
'title' => $this->l('Default Category'),
|
||||
'type' => 'select',
|
||||
'list' => $this->servicesCategory,
|
||||
'filter_key' => 'a!id_category_default',
|
||||
'optional' => true,
|
||||
);
|
||||
// $serviceProductType = array(
|
||||
// Product::SERVICE_PRODUCT_WITH_ROOMTYPE => $this->l('Bought with room type'),
|
||||
// Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE => $this->l('Bought without room type')
|
||||
@@ -288,6 +345,18 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
private function buildCategoryOptions($category)
|
||||
{
|
||||
$space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1));
|
||||
$this->servicesCategory[$category['id_category']] = $space.$category['name'];
|
||||
|
||||
if (isset($category['children']) && count($category['children'])) {
|
||||
foreach ($category['children'] as $childCategory) {
|
||||
$this->buildCategoryOptions($childCategory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getBuyingOption($service_product_type, $row)
|
||||
{
|
||||
if ($service_product_type == Product::SERVICE_PRODUCT_WITH_ROOMTYPE) {
|
||||
@@ -2446,6 +2515,9 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('duplicate');
|
||||
$this->addRowAction('delete');
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
@@ -3007,7 +3079,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
} else {
|
||||
$address->id_country = (int)$address_infos['id_country'];
|
||||
$address->id_state = (int)$address_infos['id_state'];
|
||||
$address->zipcode = $address_infos['postcode'];
|
||||
$address->postcode = $address_infos['postcode'];
|
||||
}
|
||||
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);
|
||||
$tax_rates = array(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -259,7 +259,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
'list' => $this->hotelsArray,
|
||||
'optional' => true,
|
||||
'class' => 'chosen',
|
||||
'remove_onchange' => true,
|
||||
'visible_default' => true,
|
||||
);
|
||||
}
|
||||
@@ -308,7 +307,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')),
|
||||
'optional' => true,
|
||||
'visible_default' => true,
|
||||
'remove_onchange' => true,
|
||||
'orderby' => false
|
||||
);
|
||||
|
||||
@@ -412,7 +410,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
'type' => 'select',
|
||||
'list' => $this->locationsAndHotels,
|
||||
'filter_key' => 'a!id_category_default',
|
||||
'remove_onchange' => true,
|
||||
'displayed' => false,
|
||||
);
|
||||
|
||||
@@ -1092,16 +1089,18 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$id_product = Tools::getValue('id_product');
|
||||
|
||||
$id_adv_pmt = Tools::getValue('id_adv_pmt');
|
||||
if ($id_adv_pmt) {
|
||||
$obj_adv_pmt = new HotelAdvancedPayment($id_adv_pmt);
|
||||
} else {
|
||||
$obj_adv_pmt = new HotelAdvancedPayment();
|
||||
if ($adv_pmt_info = $obj_adv_pmt->getIdAdvPaymentByIdProduct($id_product)) {
|
||||
// To prevent duplication from two separate tabs
|
||||
$obj_adv_pmt = new HotelAdvancedPayment((int) $adv_pmt_info['id']);
|
||||
}
|
||||
}
|
||||
|
||||
$adv_payment_active = Tools::getValue('adv_payment_active');
|
||||
|
||||
$obj_adv_pmt->id_product = $id_product;
|
||||
$obj_adv_pmt->active = $adv_payment_active;
|
||||
|
||||
@@ -2552,6 +2551,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
$this->tpl_list_vars['title'] = $this->l('Room Types');
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
@@ -3179,12 +3180,8 @@ class AdminProductsControllerCore extends AdminController
|
||||
$objRoomTypeServiceProductPrice->id_element = $idProduct;
|
||||
$objRoomTypeServiceProductPrice->element_type = RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE;
|
||||
}
|
||||
|
||||
$objRoomTypeServiceProductPrice->price = $price;
|
||||
if ($idTaxRulesGroup) {
|
||||
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
|
||||
}
|
||||
|
||||
$objRoomTypeServiceProductPrice->id_tax_rules_group = $idTaxRulesGroup;
|
||||
$objRoomTypeServiceProductPrice->save();
|
||||
} else {
|
||||
// create new association
|
||||
@@ -3911,7 +3908,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
} else {
|
||||
$address->id_country = (int)$address_infos['id_country'];
|
||||
$address->id_state = (int)$address_infos['id_state'];
|
||||
$address->zipcode = $address_infos['postcode'];
|
||||
$address->postcode = $address_infos['postcode'];
|
||||
}
|
||||
|
||||
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);
|
||||
|
||||
@@ -237,18 +237,18 @@ class AdminSearchControllerCore extends AdminController
|
||||
&& ($this->_list['products'] = Product::searchByName($this->context->language->id, $this->query))
|
||||
) {
|
||||
$objRoomType = new HotelRoomType();
|
||||
$accessableHotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
|
||||
$accessibleHotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
foreach ($this->_list['products'] as $key => $product) {
|
||||
if ($roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product'])) {
|
||||
if (!in_array($roomInfo['id_hotel'], $accessableHotels)) {
|
||||
if (!in_array($roomInfo['id_hotel'], $accessibleHotels)) {
|
||||
unset($this->_list['products'][$key]);
|
||||
}
|
||||
} else if ($associatedData = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product['id_product'])) {
|
||||
$count = 0;
|
||||
foreach ($associatedData['room_types'] as $id_room_type) {
|
||||
$objRoomType = new HotelRoomType($id_room_type);
|
||||
if (in_array($objRoomType->id_hotel, $accessableHotels)) {
|
||||
if (in_array($objRoomType->id_hotel, $accessibleHotels)) {
|
||||
$count += 1;
|
||||
}
|
||||
}
|
||||
@@ -261,14 +261,14 @@ class AdminSearchControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->controllerAccess['AdminProducts'])
|
||||
&& $this->controllerAccess['AdminProducts']
|
||||
if (!isset($this->controllerAccess['AdminProducts'])
|
||||
|| !$this->controllerAccess['AdminProducts']
|
||||
) {
|
||||
unset($this->_list['products']);
|
||||
}
|
||||
|
||||
if (isset($this->controllerAccess['AdminNormalProducts'])
|
||||
&& $this->controllerAccess['AdminNormalProducts']
|
||||
if (!isset($this->controllerAccess['AdminNormalProducts'])
|
||||
|| !$this->controllerAccess['AdminNormalProducts']
|
||||
) {
|
||||
unset($this->_list['service_products']);
|
||||
}
|
||||
|
||||
@@ -78,13 +78,15 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
return $visits;
|
||||
}
|
||||
|
||||
public static function getAbandonedCarts($date_from, $date_to)
|
||||
|
||||
public static function getAbandonedCarts($date_from, $date_to, $timeDiff = false)
|
||||
{
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('
|
||||
SELECT COUNT(DISTINCT id_guest)
|
||||
FROM `'._DB_PREFIX_.'cart`
|
||||
WHERE `date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"
|
||||
AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'orders` WHERE `'._DB_PREFIX_.'orders`.id_cart = `'._DB_PREFIX_.'cart`.id_cart)
|
||||
SELECT COUNT(`id_cart`)
|
||||
FROM `'._DB_PREFIX_.'cart` c
|
||||
WHERE `date_add` BETWEEN "'.pSQL($date_from).'" AND "'.pSQL($date_to).'"'.
|
||||
(($timeDiff) ? 'AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', `date_add`)) > '.$timeDiff : ' ').'
|
||||
AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'orders` o WHERE o.`id_cart` = c.`id_cart`)
|
||||
'.Shop::addSqlRestriction());
|
||||
}
|
||||
|
||||
@@ -638,7 +640,11 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
break;
|
||||
|
||||
case 'abandoned_cart':
|
||||
$value = AdminStatsController::getAbandonedCarts(date('Y-m-d H:i:s', strtotime('-2 day')), date('Y-m-d H:i:s', strtotime('-1 day')));
|
||||
$value = AdminStatsController::getAbandonedCarts(
|
||||
date('Y-m-d', strtotime('-2 day')).' 0:0:0',
|
||||
date('Y-m-d', strtotime('-1 day')).' 23:59:59',
|
||||
_TIME_1_DAY_
|
||||
);
|
||||
break;
|
||||
|
||||
case 'installed_modules':
|
||||
|
||||
@@ -438,6 +438,12 @@ class AuthControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('You must register at least one phone number.');
|
||||
}
|
||||
|
||||
if (!Tools::getValue('is_new_customer', 1)) {
|
||||
if ($idCustomer = Customer::customerExists(Tools::getValue('email'), true, false)) {
|
||||
$customer = new Customer($idCustomer);
|
||||
}
|
||||
}
|
||||
|
||||
$this->errors = array_unique(array_merge($this->errors, $customer->validateController()));
|
||||
|
||||
// Check the requires fields which are settings in the BO
|
||||
@@ -601,13 +607,7 @@ class AuthControllerCore extends FrontController
|
||||
$customer->active = 1;
|
||||
// New Guest customer
|
||||
if (Tools::isSubmit('is_new_customer')) {
|
||||
if (isset($idCustomer) && $idCustomer) {
|
||||
// update guest customer details
|
||||
$customer = new Customer($idCustomer);
|
||||
$customer->firstname = Tools::getValue('firstname');
|
||||
$customer->lastname = Tools::getValue('lastname');
|
||||
}
|
||||
$customer->is_guest = 1;
|
||||
$customer->is_guest = !Tools::getValue('is_new_customer', 1);
|
||||
} else {
|
||||
$customer->is_guest = 0;
|
||||
}
|
||||
|
||||
@@ -181,22 +181,6 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
$booking_data = $objBookingDetail->dataForFrontSearch($bookingParams);
|
||||
|
||||
// set default occupancies in required format
|
||||
if (isset($booking_data['rm_data']) && $booking_data['rm_data']) {
|
||||
foreach ($booking_data['rm_data'] as &$roomTypeData) {
|
||||
$occupancy = array(
|
||||
array(
|
||||
'adults' => $roomTypeData['adults'],
|
||||
'children' => 0,
|
||||
'child_ages' => array(),
|
||||
),
|
||||
);
|
||||
|
||||
$roomTypeData['occupancies'] = $occupancy;
|
||||
$roomTypeData['occupancy_adults'] = $roomTypeData['adults']; // only one room by default
|
||||
}
|
||||
}
|
||||
|
||||
$obj_booking_detail = new HotelBookingDetail();
|
||||
$num_days = $obj_booking_detail->getNumberOfDays($date_from, $date_to);
|
||||
|
||||
|
||||
@@ -92,10 +92,11 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
if (!Validate::isLoadedObject($customer)) {
|
||||
$this->errors[] = Tools::displayError('Invalid customer');
|
||||
} elseif (!Tools::getValue('password')) {
|
||||
} elseif (!Tools::getValue('password')
|
||||
|| !Validate::isPasswd(Tools::getValue('password')
|
||||
)) {
|
||||
$this->errors[] = Tools::displayError('Invalid password.');
|
||||
} elseif (!$customer->transformToCustomer($this->context->language->id, Tools::getValue('password'))) {
|
||||
// @todo clarify error message
|
||||
$this->errors[] = Tools::displayError('An error occurred while transforming a guest into a registered customer.');
|
||||
} else {
|
||||
$this->context->smarty->assign('transformSuccess', true);
|
||||
@@ -105,6 +106,63 @@ class GuestTrackingControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
public function displayAjaxGetRoomTypeBookingDemands()
|
||||
{
|
||||
$response = array('extra_demands' => false);
|
||||
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objHotelBookingDemands = new HotelBookingDemands();
|
||||
$useTax = 0;
|
||||
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
));
|
||||
}
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$idOrder,
|
||||
0,
|
||||
0,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
0,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'additionalServices' => $additionalServices,
|
||||
));
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'objOrder' => new Order($idOrder),
|
||||
));
|
||||
|
||||
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign template vars related to page content
|
||||
* @see FrontController::initContent()
|
||||
@@ -113,60 +171,6 @@ class GuestTrackingControllerCore extends FrontController
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$method = Tools::getValue('method');
|
||||
if ($method == 'getRoomTypeBookingDemands') {
|
||||
$response = array('reload' => false);
|
||||
$extraDemandsTpl = '';
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
$useTax = 0;
|
||||
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
)
|
||||
);
|
||||
}
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$idOrder,
|
||||
0,
|
||||
0,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
0,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'additionalServices' => $additionalServices,
|
||||
));
|
||||
}
|
||||
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
/* Handle brute force attacks */
|
||||
if (count($this->errors)) {
|
||||
sleep(1);
|
||||
@@ -216,6 +220,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$order->id_order_state = (int)$order->getCurrentState();
|
||||
$order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number);
|
||||
$order->order_history = $order->getHistory((int)$this->context->language->id, false, true);
|
||||
$order->overbooking_order_states = OrderState::getOverBookingStates();
|
||||
$order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
|
||||
$order->address_invoice = new Address((int)$order->id_address_invoice);
|
||||
$order->address_delivery = new Address((int)$order->id_address_delivery);
|
||||
@@ -554,6 +559,13 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail);
|
||||
}
|
||||
|
||||
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
|
||||
|
||||
$objHotelBranchRefundRules = new HotelBranchRefundRules();
|
||||
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
|
||||
|
||||
// set order specific values
|
||||
$order->total_convenience_fee_ti = $total_convenience_fee_ti;
|
||||
$order->total_convenience_fee_te = $total_convenience_fee_te;
|
||||
@@ -564,11 +576,14 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$order->back_ord_msg = Configuration::get('WK_BO_MESSAGE');
|
||||
$order->order_has_invoice = $order->hasInvoice();
|
||||
$order->cart_htl_data = $cartHotelData;
|
||||
$order->non_requested_rooms = $nonRequestedRooms;
|
||||
$order->customerGuestDetail = $customerGuestDetail;
|
||||
$order->obj_hotel_branch_information = $objHotelBranchInformation;
|
||||
$order->hotel_address_info = $hotelAddressInfo;
|
||||
$order->hotel_refund_rules = $hotelRefundRules;
|
||||
//end
|
||||
|
||||
Hook::exec('actionOrderDetail', array('carrier' => $order->carrier, 'order' => $order));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,9 +611,48 @@ class GuestTrackingControllerCore extends FrontController
|
||||
)
|
||||
);
|
||||
|
||||
$this->addJS(_THEME_JS_DIR_.'history.js');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
if (Tools::getValue('ajax') != 'true') {
|
||||
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
|
||||
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'order-detail.js',
|
||||
_THEME_JS_DIR_.'tools.js',
|
||||
));
|
||||
|
||||
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
|
||||
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
|
||||
|
||||
// load Google Maps library if configured
|
||||
if (!count($this->errors)) {
|
||||
$ordersCollection = Order::getByReference(Tools::getValue('order_reference'));
|
||||
if ($objOrder = $ordersCollection->getFirst()) {
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($objOrder->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
if ($apiKey = Configuration::get('PS_API_KEY')) {
|
||||
if (floatval($objHotelBranchInformation->latitude) != 0
|
||||
&& floatval($objHotelBranchInformation->longitude) != 0
|
||||
) {
|
||||
Media::addJsDef(array(
|
||||
'hotel_location' => array(
|
||||
'latitude' => $objHotelBranchInformation->latitude,
|
||||
'longitude' => $objHotelBranchInformation->longitude,
|
||||
'map_input_text' => $objHotelBranchInformation->map_input_text,
|
||||
),
|
||||
'hotel_name' => $objHotelBranchInformation->hotel_name,
|
||||
));
|
||||
|
||||
$this->addJS(
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
|
||||
$this->context->language->iso_code.'®ion='.$this->context->country->iso_code
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function processAddressFormat(Address $delivery, Address $invoice)
|
||||
|
||||
@@ -36,15 +36,9 @@ class HistoryControllerCore extends FrontController
|
||||
parent::setMedia();
|
||||
$this->addCSS(array(
|
||||
_THEME_CSS_DIR_.'history.css',
|
||||
_THEME_CSS_DIR_.'addresses.css'
|
||||
));
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'history.js',
|
||||
_THEME_JS_DIR_.'tools.js' // retro compat themes 1.5
|
||||
));
|
||||
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme
|
||||
$this->addJqueryPlugin(array('scrollTo', 'footable', 'footable-sort'));
|
||||
$this->addJqueryUI('ui.tooltip', 'base', true);
|
||||
|
||||
$this->addJqueryPlugin(array('footable', 'footable-sort'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,6 +154,9 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
if (!empty($orderProducts)) {
|
||||
foreach ($orderProducts as $type_key => $type_value) {
|
||||
if (in_array($type_value['product_id'], $processed_product)) {
|
||||
continue;
|
||||
}
|
||||
$processed_product[] = $type_value['product_id'];
|
||||
|
||||
$product = new Product($type_value['product_id'], false, $this->context->language->id);
|
||||
@@ -362,6 +365,13 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($cart_htl_data)) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cart_htl_data);
|
||||
}
|
||||
if (!empty($cart_service_products)) {
|
||||
$this->context->smarty->assign('cart_service_products', $cart_service_products);
|
||||
}
|
||||
}
|
||||
if (!$objCartOrder->hasInvoice()) {
|
||||
$orders_has_invoice = 0;
|
||||
@@ -385,13 +395,6 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($cart_htl_data)) {
|
||||
$this->context->smarty->assign('cart_htl_data', $cart_htl_data);
|
||||
}
|
||||
if (!empty($cart_service_products)) {
|
||||
$this->context->smarty->assign('cart_service_products', $cart_service_products);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
|
||||
$this->context->smarty->assign('orders_has_invoice', $orders_has_invoice);
|
||||
}
|
||||
|
||||
@@ -43,283 +43,19 @@ class OrderDetailControllerCore extends FrontController
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
||||
}
|
||||
|
||||
/**
|
||||
* Start forms process
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitMessage')) {
|
||||
$idOrder = (int)Tools::getValue('id_order');
|
||||
$msgText = Tools::getValue('msgText');
|
||||
|
||||
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
|
||||
$this->errors[] = Tools::displayError('The order is no longer valid.');
|
||||
} elseif (empty($msgText)) {
|
||||
$this->errors[] = Tools::displayError('The message cannot be blank.');
|
||||
} elseif (!Validate::isMessage($msgText)) {
|
||||
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
|
||||
}
|
||||
if (!count($this->errors)) {
|
||||
$order = new Order($idOrder);
|
||||
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
|
||||
//check if a thread already exist
|
||||
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
|
||||
$id_product = (int)Tools::getValue('id_product');
|
||||
$cm = new CustomerMessage();
|
||||
if (!$id_customer_thread) {
|
||||
$ct = new CustomerThread();
|
||||
$ct->id_contact = 0;
|
||||
$ct->id_customer = (int)$order->id_customer;
|
||||
$ct->id_shop = (int)$this->context->shop->id;
|
||||
if ($id_product && $order->orderContainProduct($id_product)) {
|
||||
$ct->id_product = $id_product;
|
||||
}
|
||||
$ct->id_order = (int)$order->id;
|
||||
$ct->id_lang = (int)$this->context->language->id;
|
||||
$ct->email = $this->context->customer->email;
|
||||
$ct->status = 'open';
|
||||
$ct->token = Tools::passwdGen(12);
|
||||
$ct->add();
|
||||
} else {
|
||||
$ct = new CustomerThread((int)$id_customer_thread);
|
||||
$ct->status = 'open';
|
||||
$ct->update();
|
||||
}
|
||||
|
||||
$cm->id_customer_thread = $ct->id;
|
||||
$cm->message = $msgText;
|
||||
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
|
||||
$cm->add();
|
||||
|
||||
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
|
||||
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
|
||||
} else {
|
||||
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
|
||||
$to = strval($to->email);
|
||||
}
|
||||
$toName = strval(Configuration::get('PS_SHOP_NAME'));
|
||||
$customer = $this->context->customer;
|
||||
|
||||
$product = new Product($id_product);
|
||||
$product_name = '';
|
||||
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
|
||||
$product_name = $product->name[(int)$this->context->language->id];
|
||||
}
|
||||
|
||||
if (Validate::isLoadedObject($customer)) {
|
||||
Mail::Send(
|
||||
$this->context->language->id,
|
||||
'order_customer_comment',
|
||||
Mail::l('Message from a customer'),
|
||||
array(
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{email}' => $customer->email,
|
||||
'{id_order}' => (int)$order->id,
|
||||
'{order_name}' => $order->getUniqReference(),
|
||||
'{message}' => Tools::nl2br($msgText),
|
||||
'{product_name}' => $product_name
|
||||
),
|
||||
$to,
|
||||
$toName,
|
||||
strval(Configuration::get('PS_SHOP_EMAIL')),
|
||||
$customer->firstname.' '.$customer->lastname,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$customer->email
|
||||
);
|
||||
}
|
||||
|
||||
if (Tools::getValue('ajax') != 'true') {
|
||||
Tools::redirect('index.php?controller=order-detail&id_order='.(int)$idOrder);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('message_confirmation', true);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Order not found');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function displayAjax()
|
||||
{
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign template vars related to page content
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
$this->show_breadcrump = true;
|
||||
|
||||
parent::initContent();
|
||||
if (!($id_order = (int) Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order)) {
|
||||
$this->errors[] = Tools::displayError('Order ID required');
|
||||
Tools::redirect($this->context->link->getPageLink('history'));
|
||||
} else {
|
||||
$order = new Order($id_order);
|
||||
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
|
||||
// Here handle request from the ajax on order details page i.e refund, additional qty etc
|
||||
$method = Tools::getValue('method');
|
||||
// extra demands popup ajax
|
||||
if ($method == 'getRoomTypeBookingDemands') {
|
||||
$response = array('reload' => false);
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
$useTax = 0;
|
||||
$customer = Context::getContext()->customer;
|
||||
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
)
|
||||
);
|
||||
}
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$idOrder,
|
||||
0,
|
||||
0,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
0,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'additionalServices' => $additionalServices,
|
||||
));
|
||||
}
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'objOrder' => new Order($idOrder)
|
||||
)
|
||||
);
|
||||
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
|
||||
}
|
||||
|
||||
die(json_encode($response));
|
||||
} elseif ($method == 'submitRefundRequest') { // room cancellation ajax
|
||||
$hasError = 0;
|
||||
if (!$refundReason = Tools::getValue('cancellation_reason')) {
|
||||
$hasError = 1;
|
||||
} elseif (!Validate::isCleanHtml($refundReason)) {
|
||||
$hasError = 1;
|
||||
}
|
||||
if ($bookingRefunds = Tools::getValue('bookings_to_refund')) {
|
||||
if (!count($bookingRefunds = json_decode($bookingRefunds, true))) {
|
||||
$hasError = 1;
|
||||
} else {
|
||||
foreach ($bookingRefunds as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
if ($objHotelBookingDetail->id_customer != $order->id_customer
|
||||
|| OrderReturn::getOrdersReturnDetail($order->id, 0, $idHtlBooking)
|
||||
) {
|
||||
$hasError = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hasError = 1;
|
||||
}
|
||||
$res = true;
|
||||
if (!$hasError) {
|
||||
$hasCancelled = 0;
|
||||
// if amount paid is > 0 then create refund request else cancel the booking directly
|
||||
if ($order->getTotalPaid() > 0) {
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$objOrderReturn->id_customer = $order->id_customer;
|
||||
$objOrderReturn->id_order = $order->id;
|
||||
$objOrderReturn->state = 0;
|
||||
$objOrderReturn->by_admin = 0;
|
||||
$objOrderReturn->question = $refundReason;
|
||||
$objOrderReturn->save();
|
||||
if ($objOrderReturn->id) {
|
||||
foreach ($bookingRefunds as $idHtlBooking) {
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$numDays = $objHtlBooking->getNumberOfDays(
|
||||
$objHtlBooking->date_from,
|
||||
$objHtlBooking->date_to
|
||||
);
|
||||
|
||||
$objOrderReturnDetail = new OrderReturnDetail();
|
||||
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
|
||||
$objOrderReturnDetail->id_order_detail = $objHtlBooking->id_order_detail;
|
||||
$objOrderReturnDetail->product_quantity = $numDays;
|
||||
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
}
|
||||
// Emails to customer, admin on refund request state change
|
||||
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
|
||||
} else {
|
||||
$hasCancelled = 1;
|
||||
// cancel the booking directly
|
||||
foreach ($bookingRefunds as $idHtlBooking) {
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
if (!$objHtlBooking->processRefundInBookingTables()) {
|
||||
die(json_encode(array('status' => 0)));
|
||||
} else {
|
||||
// set the message for the cancellation
|
||||
$message = Tools::displayError('1 Room from').' '.', '.$objHtlBooking->room_type_name.' '.Tools::displayError('has been cancelled by the hotel.');
|
||||
$message .= PHP_EOL.Tools::displayError('Reason').': '.$refundReason;
|
||||
|
||||
$objHtlBooking->setBookingCancellationMessage($refundReason);
|
||||
}
|
||||
}
|
||||
|
||||
// if all bookings are getting cancelled then cancel the order also
|
||||
if ($order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)) {
|
||||
$objOrderHistory = new OrderHistory();
|
||||
$objOrderHistory->id_order = (int)$order->id;
|
||||
|
||||
$idOrderState = Configuration::get('PS_OS_CANCELED');
|
||||
|
||||
$useExistingPayment = false;
|
||||
if (!$order->hasInvoice()) {
|
||||
$useExistingPayment = true;
|
||||
}
|
||||
|
||||
$objOrderHistory->changeIdOrderState($idOrderState, $order, $useExistingPayment);
|
||||
$objOrderHistory->addWithemail();
|
||||
}
|
||||
}
|
||||
|
||||
die(json_encode(array('status' => 1, 'has_cancelled' => $hasCancelled)));
|
||||
}
|
||||
|
||||
die(json_encode(array('status' => 0)));
|
||||
}
|
||||
} else {
|
||||
die(json_encode(array('status' => 0)));
|
||||
}
|
||||
// END ajax request handle
|
||||
|
||||
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
|
||||
$id_order_state = (int)$order->getCurrentState();
|
||||
$carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
|
||||
@@ -376,9 +112,9 @@ class OrderDetailControllerCore extends FrontController
|
||||
$cover_image_arr = $product->getCover($type_value['product_id']);
|
||||
|
||||
if (!empty($cover_image_arr)) {
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'home_default');
|
||||
} else {
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
|
||||
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'home_default');
|
||||
}
|
||||
|
||||
if (isset($customer->id)) {
|
||||
@@ -459,9 +195,18 @@ class OrderDetailControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_htl_booking'] = $data_v['id'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_room'] = $data_v['id_room'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['adults'] = $data_v['adults'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['children'] = $data_v['children'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['child_ages'] = $data_v['child_ages'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_refunded'] = $data_v['is_refunded'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_cancelled'] = $data_v['is_cancelled'];
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_rooms'][] = $data_v['id_room'];
|
||||
|
||||
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
|
||||
$id_order,
|
||||
@@ -637,6 +382,13 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
|
||||
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
|
||||
|
||||
$objHotelBranchRefundRules = new HotelBranchRefundRules();
|
||||
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
|
||||
@@ -651,6 +403,9 @@ class OrderDetailControllerCore extends FrontController
|
||||
'order_has_invoice' => $order->hasInvoice(),
|
||||
'cart_htl_data' => $cartHotelData,
|
||||
'cart_service_products' => $cartServiceProducts,
|
||||
'obj_hotel_branch_information' => $objHotelBranchInformation,
|
||||
'hotel_address_info' => $hotelAddressInfo,
|
||||
'hotel_refund_rules' => $hotelRefundRules,
|
||||
)
|
||||
);
|
||||
// }
|
||||
@@ -660,6 +415,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) {
|
||||
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'hasOrderPaid' => $order->hasBeenPaid(),
|
||||
@@ -710,7 +466,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
unset($carrier, $addressInvoice, $addressDelivery);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('This order cannot be found.');
|
||||
$this->errors[] = Tools::displayError('The booking cannot be found.');
|
||||
}
|
||||
unset($order);
|
||||
}
|
||||
@@ -718,12 +474,335 @@ class OrderDetailControllerCore extends FrontController
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-detail.tpl');
|
||||
}
|
||||
|
||||
public function displayAjaxGetRoomTypeBookingDemands()
|
||||
{
|
||||
$response = array('extra_demands' => false);
|
||||
|
||||
if (($idProduct = Tools::getValue('id_product'))
|
||||
&& ($idOrder = Tools::getValue('id_order'))
|
||||
&& ($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
) {
|
||||
$objHotelBookingDemands = new HotelBookingDemands();
|
||||
$useTax = 0;
|
||||
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
|
||||
$useTax = 1;
|
||||
}
|
||||
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$idProduct,
|
||||
0,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
1,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'extraDemands' => $extraDemands,
|
||||
));
|
||||
}
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$idOrder,
|
||||
0,
|
||||
0,
|
||||
$idProduct,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
0,
|
||||
0,
|
||||
$useTax
|
||||
)) {
|
||||
$this->context->smarty->assign(array(
|
||||
'useTax' => $useTax,
|
||||
'additionalServices' => $additionalServices,
|
||||
));
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'objOrder' => new Order($idOrder),
|
||||
));
|
||||
|
||||
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function displayAjaxSubmitRefundRequest()
|
||||
{
|
||||
$response = array('has_errors' => false);
|
||||
|
||||
$idOrder = Tools::getValue('id_order');
|
||||
$idsHtlBooking = Tools::getValue('bookings_to_refund');
|
||||
$cancellationReason = trim(Tools::getValue('cancellation_reason'));
|
||||
|
||||
if (!$idsHtlBooking) {
|
||||
$this->errors[] = Tools::displayError('Please select at least on room for cancellation.');
|
||||
}
|
||||
|
||||
if (!$cancellationReason) {
|
||||
$this->errors[] = Tools::displayError('Please mention a reason for cancellation.');
|
||||
} elseif ($cancellationReason && !Validate::isCleanHtml($cancellationReason)) {
|
||||
$this->errors[] = Tools::displayError('Reason of cancellation is invalid. Please enter valid data.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$objOrder = new Order($idOrder);
|
||||
if (!(Validate::isLoadedObject($objOrder) && $objOrder->id_customer == $this->context->customer->id)) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
} elseif ($idsHtlBooking) {
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
if ($objHotelBookingDetail->id_customer != $objOrder->id_customer) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
break;
|
||||
}
|
||||
|
||||
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, $idHtlBooking)) {
|
||||
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
if ((int) $objOrder->total_paid_real == 0) {
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
|
||||
$objHtlBooking->save();
|
||||
}
|
||||
}
|
||||
|
||||
// if amount paid is > 0 then create refund request else cancel the booking directly
|
||||
if ($objOrder->getTotalPaid() > 0) {
|
||||
$objOrderReturn = new OrderReturn();
|
||||
$objOrderReturn->id_customer = $objOrder->id_customer;
|
||||
$objOrderReturn->id_order = $objOrder->id;
|
||||
$objOrderReturn->state = 0;
|
||||
$objOrderReturn->by_admin = 0;
|
||||
$objOrderReturn->question = $cancellationReason;
|
||||
$objOrderReturn->save();
|
||||
if ($objOrderReturn->id) {
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
$numDays = $objHotelBookingDetail->getNumberOfDays(
|
||||
$objHotelBookingDetail->date_from,
|
||||
$objHotelBookingDetail->date_to
|
||||
);
|
||||
|
||||
$objOrderReturnDetail = new OrderReturnDetail();
|
||||
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
|
||||
$objOrderReturnDetail->id_order_detail = $objHotelBookingDetail->id_order_detail;
|
||||
$objOrderReturnDetail->product_quantity = $numDays;
|
||||
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
|
||||
$objOrderReturnDetail->save();
|
||||
}
|
||||
}
|
||||
|
||||
// Emails to customer, superadmin and employees on refund request state change
|
||||
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
|
||||
} else {
|
||||
// cancel the booking directly
|
||||
foreach ($idsHtlBooking as $idHtlBooking) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
|
||||
if (!$objHotelBookingDetail->processRefundInBookingTables()) {
|
||||
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
|
||||
} else {
|
||||
// set the message for the cancellation
|
||||
$message = Tools::displayError(sprintf(
|
||||
"1 room from %s has been cancelled by hotel.\nReason: %s",
|
||||
$objHotelBookingDetail->room_type_name,
|
||||
$cancellationReason
|
||||
));
|
||||
|
||||
$objHotelBookingDetail->setBookingCancellationMessage($message);
|
||||
}
|
||||
}
|
||||
|
||||
// if all bookings are getting cancelled then cancel the order also
|
||||
if ($objOrder->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)) {
|
||||
$objOrderHistory = new OrderHistory();
|
||||
$objOrderHistory->id_order = (int)$objOrder->id;
|
||||
|
||||
$idOrderState = Configuration::get('PS_OS_CANCELED');
|
||||
|
||||
$useExistingPayment = false;
|
||||
if (!$objOrder->hasInvoice()) {
|
||||
$useExistingPayment = true;
|
||||
}
|
||||
|
||||
$objOrderHistory->changeIdOrderState($idOrderState, $objOrder, $useExistingPayment);
|
||||
$objOrderHistory->addWithemail();
|
||||
|
||||
$response['order_cancelled'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->context->smarty->assign(array('errors' => $this->errors));
|
||||
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
|
||||
}
|
||||
|
||||
$response['has_errors'] = (bool) count($this->errors);
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function displayAjaxSubmitMessage()
|
||||
{
|
||||
$response = array('status' => false);
|
||||
|
||||
$idOrder = (int) Tools::getValue('id_order');
|
||||
$msgText = Tools::getValue('msgText');
|
||||
|
||||
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
|
||||
$this->errors[] = Tools::displayError('The order is no longer valid.');
|
||||
} elseif (empty($msgText)) {
|
||||
$this->errors[] = Tools::displayError('The message cannot be blank.');
|
||||
} elseif (!Validate::isMessage($msgText)) {
|
||||
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
|
||||
}
|
||||
if (!count($this->errors)) {
|
||||
$order = new Order($idOrder);
|
||||
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
|
||||
//check if a thread already exist
|
||||
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
|
||||
$id_product = (int)Tools::getValue('id_product');
|
||||
$cm = new CustomerMessage();
|
||||
if (!$id_customer_thread) {
|
||||
$ct = new CustomerThread();
|
||||
$ct->id_contact = 0;
|
||||
$ct->id_customer = (int)$order->id_customer;
|
||||
$ct->id_shop = (int)$this->context->shop->id;
|
||||
if ($id_product && $order->orderContainProduct($id_product)) {
|
||||
$ct->id_product = $id_product;
|
||||
}
|
||||
$ct->id_order = (int)$order->id;
|
||||
$ct->id_lang = (int)$this->context->language->id;
|
||||
$ct->email = $this->context->customer->email;
|
||||
$ct->status = 'open';
|
||||
$ct->token = Tools::passwdGen(12);
|
||||
$ct->add();
|
||||
} else {
|
||||
$ct = new CustomerThread((int)$id_customer_thread);
|
||||
$ct->status = 'open';
|
||||
$ct->update();
|
||||
}
|
||||
|
||||
$cm->id_customer_thread = $ct->id;
|
||||
$cm->message = $msgText;
|
||||
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
|
||||
$cm->add();
|
||||
|
||||
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
|
||||
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
|
||||
} else {
|
||||
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
|
||||
$to = strval($to->email);
|
||||
}
|
||||
$toName = strval(Configuration::get('PS_SHOP_NAME'));
|
||||
$customer = $this->context->customer;
|
||||
|
||||
$product = new Product($id_product);
|
||||
$product_name = '';
|
||||
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
|
||||
$product_name = $product->name[(int)$this->context->language->id];
|
||||
}
|
||||
|
||||
if (Validate::isLoadedObject($customer)) {
|
||||
Mail::Send(
|
||||
$this->context->language->id,
|
||||
'order_customer_comment',
|
||||
Mail::l('Message from a customer'),
|
||||
array(
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{email}' => $customer->email,
|
||||
'{id_order}' => (int)$order->id,
|
||||
'{order_name}' => $order->getUniqReference(),
|
||||
'{message}' => Tools::nl2br($msgText),
|
||||
'{product_name}' => $product_name
|
||||
),
|
||||
$to,
|
||||
$toName,
|
||||
strval(Configuration::get('PS_SHOP_EMAIL')),
|
||||
$customer->firstname.' '.$customer->lastname,
|
||||
null,
|
||||
null,
|
||||
_PS_MAIL_DIR_,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
$customer->email
|
||||
);
|
||||
}
|
||||
|
||||
// send message html in json
|
||||
$response['status'] = true;
|
||||
|
||||
$message = CustomerMessage::getMessagesByOrderId($order->id, false)[0];
|
||||
$this->context->smarty->assign(array('message' => $message));
|
||||
$response['message_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-message.tpl');
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Order not found');
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->context->smarty->assign(array('errors' => $this->errors));
|
||||
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
|
||||
}
|
||||
|
||||
$response['has_errors'] = (bool) count($this->errors);
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
if (Tools::getValue('ajax') != 'true') {
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
|
||||
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
|
||||
|
||||
$this->addJS(array(
|
||||
_THEME_JS_DIR_.'order-detail.js',
|
||||
_THEME_JS_DIR_.'tools.js',
|
||||
));
|
||||
|
||||
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
|
||||
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
|
||||
|
||||
// load Google Maps library if configured
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder(Tools::getValue('id_order'))) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
if (Validate::isLoadedObject($objHotelBranchInformation)) {
|
||||
if ($apiKey = Configuration::get('PS_API_KEY')) {
|
||||
if (floatval($objHotelBranchInformation->latitude) != 0
|
||||
&& floatval($objHotelBranchInformation->longitude) != 0
|
||||
) {
|
||||
Media::addJsDef(array(
|
||||
'hotel_location' => array(
|
||||
'latitude' => $objHotelBranchInformation->latitude,
|
||||
'longitude' => $objHotelBranchInformation->longitude,
|
||||
'map_input_text' => $objHotelBranchInformation->map_input_text,
|
||||
),
|
||||
'hotel_name' => $objHotelBranchInformation->hotel_name,
|
||||
));
|
||||
|
||||
$this->addJS(
|
||||
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
|
||||
$this->context->language->iso_code.'®ion='.$this->context->country->iso_code
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,9 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$customer = new Customer($this->context->customer->id);
|
||||
if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
|
||||
if (!$customer->isGuest()) {
|
||||
$this->errors[] = Tools::displayError('This account is already registered as a customer.');
|
||||
} else if ($customer->transformToCustomer($this->context->language->id, $passwd)) {
|
||||
$this->context->updateCustomer($customer);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.');
|
||||
@@ -424,7 +426,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
public function initContent()
|
||||
{
|
||||
// validate room types before payment by customer
|
||||
$orderRestrictErr = HotelCartBookingData::validateCartBookings();
|
||||
$this->errors = HotelCartBookingData::validateCartBookings();
|
||||
|
||||
parent::initContent();
|
||||
|
||||
@@ -492,7 +494,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
// $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'orderRestrictErr' => $orderRestrictErr,
|
||||
'orderRestrictErr' => count($this->errors) ? 1 : 0,
|
||||
// 'allDemands' => $allDemands,
|
||||
// 'defaultcurrencySign' => $objCurrency->sign,
|
||||
'THEME_DIR' => _THEME_DIR_,
|
||||
|
||||
@@ -427,14 +427,27 @@ class ProductControllerCore extends FrontController
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY) {
|
||||
$occupancy_value = 1;
|
||||
} else {
|
||||
$occupancy_value = array(
|
||||
array(
|
||||
'adults' => $room_info_by_product_id['adults'],
|
||||
'children' => 0,
|
||||
'child_ages' => array(),
|
||||
),
|
||||
);
|
||||
$useDefaultOccupancy = true;
|
||||
// if coming from hotel page do not set occupancy, otherwise set base adult occupancy
|
||||
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == Tools::secureReferrer($_SERVER['HTTP_REFERER'])) { // Assure us the previous page was one of the site
|
||||
$idCategoryHotel = $hotel_branch_obj->id_category;
|
||||
$categoryPageLink = $this->context->link->getCategoryLink($idCategoryHotel);
|
||||
if (Tools::strpos($_SERVER['HTTP_REFERER'], $categoryPageLink) === 0) {
|
||||
$useDefaultOccupancy = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($useDefaultOccupancy) {
|
||||
$occupancy_value = array(
|
||||
array(
|
||||
'adults' => $room_info_by_product_id['adults'],
|
||||
'children' => 0,
|
||||
'child_ages' => array(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->assignBookingFormVars($this->product->id, $date_from, $date_to, $occupancy_value);
|
||||
$this->assignServiceProductVars();
|
||||
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
<page>history</page>
|
||||
<configurable>1</configurable>
|
||||
</meta>
|
||||
<meta id="order-detail">
|
||||
<page>order-detail</page>
|
||||
<configurable>1</configurable>
|
||||
</meta>
|
||||
<meta id="identity">
|
||||
<page>identity</page>
|
||||
<configurable>1</configurable>
|
||||
|
||||
@@ -15,31 +15,32 @@
|
||||
<theme_meta id="theme_meta_6" id_theme="1" id_meta="6" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_7" id_theme="1" id_meta="7" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_8" id_theme="1" id_meta="8" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_10" id_theme="1" id_meta="9" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_11" id_theme="1" id_meta="10" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_12" id_theme="1" id_meta="11" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_13" id_theme="1" id_meta="12" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_14" id_theme="1" id_meta="13" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_15" id_theme="1" id_meta="14" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_16" id_theme="1" id_meta="15" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_17" id_theme="1" id_meta="16" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_18" id_theme="1" id_meta="17" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_19" id_theme="1" id_meta="18" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_20" id_theme="1" id_meta="19" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_21" id_theme="1" id_meta="20" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_22" id_theme="1" id_meta="21" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_23" id_theme="1" id_meta="22" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_24" id_theme="1" id_meta="23" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_25" id_theme="1" id_meta="24" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_26" id_theme="1" id_meta="25" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_27" id_theme="1" id_meta="26" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_28" id_theme="1" id_meta="28" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_29" id_theme="1" id_meta="29" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_30" id_theme="1" id_meta="27" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_31" id_theme="1" id_meta="30" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_32" id_theme="1" id_meta="31" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_33" id_theme="1" id_meta="32" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_34" id_theme="1" id_meta="33" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_35" id_theme="1" id_meta="34" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_9" id_theme="1" id_meta="9" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_10" id_theme="1" id_meta="10" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_11" id_theme="1" id_meta="11" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_12" id_theme="1" id_meta="12" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_13" id_theme="1" id_meta="13" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_14" id_theme="1" id_meta="14" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_15" id_theme="1" id_meta="15" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_16" id_theme="1" id_meta="16" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_17" id_theme="1" id_meta="17" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_18" id_theme="1" id_meta="18" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_19" id_theme="1" id_meta="19" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_20" id_theme="1" id_meta="20" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_21" id_theme="1" id_meta="21" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_22" id_theme="1" id_meta="22" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_23" id_theme="1" id_meta="23" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_24" id_theme="1" id_meta="24" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_25" id_theme="1" id_meta="25" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_26" id_theme="1" id_meta="26" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_27" id_theme="1" id_meta="27" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_28" id_theme="1" id_meta="28" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_29" id_theme="1" id_meta="29" left_column="1" right_column="0"/>
|
||||
<theme_meta id="theme_meta_30" id_theme="1" id_meta="30" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_31" id_theme="1" id_meta="31" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_32" id_theme="1" id_meta="32" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_33" id_theme="1" id_meta="33" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_34" id_theme="1" id_meta="34" left_column="0" right_column="0"/>
|
||||
<theme_meta id="theme_meta_35" id_theme="1" id_meta="35" left_column="0" right_column="0"/>
|
||||
</entities>
|
||||
</entity_theme_meta>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>order-history</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Детайл за резервацията</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>detal-za-rezervaciata</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>Identity</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Получено частично плащане</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>order-history</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>বুকিং বিবরণ</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>booking-biborn</url_rewrite>
|
||||
</meta>
|
||||
<meta id='identity' id_shop='1'>
|
||||
<title>পরিচয় </title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>আংশিক পেমেন্ট প্রাপ্ত</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>histórico-de-pedidos</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Devezh bemdez</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>devezh-bemdez</url_rewrite>
|
||||
</meta>
|
||||
<meta id='identity' id_shop='1'>
|
||||
<title>Identificação</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Pagamento parcial recebido</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>historie-objednavek</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Detail rezervace</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>detail-rezervace</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>Identity</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Částečná platba přijata</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>bestellungsverlauf</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Buchungsdetails</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>buchungsdetails</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>Kennung</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Teilzahlung erhalten</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>order-history</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Booking details</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>order-detail</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>Identity</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Partial payment received</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>historial-compra</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Detalle de reserva</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>detalle-de-reserva</url_rewrite>
|
||||
</meta>
|
||||
<meta id='identity' id_shop='1'>
|
||||
<title>Datos personales</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Pago parcial recibido</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>order-history</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>جزئیات رزرو</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>jazayiat-rezrv</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>مشخصات</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>پرداخت جزئی دریافت شد</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>historique-commandes</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Détails de réservation</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>details-de-reservation</url_rewrite>
|
||||
</meta>
|
||||
<meta id='identity' id_shop='1'>
|
||||
<title>Identité</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Paiement partiel reçu</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>הסטוריית-הזמנות</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>פרטי ההזמנה</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>partei-hahazmana</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>זהות</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>תשלום חלקי התקבל</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -96,6 +96,12 @@
|
||||
<keywords/>
|
||||
<url_rewrite>order-history</url_rewrite>
|
||||
</meta>
|
||||
<meta id="order-detail" id_shop="1">
|
||||
<title>Detalji rezervacije</title>
|
||||
<description/>
|
||||
<keywords/>
|
||||
<url_rewrite>detalji-rezervacije</url_rewrite>
|
||||
</meta>
|
||||
<meta id="identity" id_shop="1">
|
||||
<title>Identity</title>
|
||||
<description/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
<name>Partial payment accepted</name>
|
||||
<template>payment_accepted</template>
|
||||
<name>Primljena djelomična uplata</name>
|
||||
<template>partial_payment_accepted</template>
|
||||
</order_state>
|
||||
</entity_order_state>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user