Merge branch 'develop' into edit-order-services

This commit is contained in:
vishalsingh.qlo325
2025-05-13 15:23:08 +05:30
67 changed files with 885 additions and 456 deletions

View File

@@ -16,7 +16,7 @@ body
@include float(left)
#content.bootstrap
padding: 90px 10px 0
padding: 100px 10px 0
@include transition-property(margin)
@include transition-duration(0.4s)
@include transition-timing-function(ease-out)

View File

@@ -24,6 +24,10 @@
#header_shopname
@extend .navbar-brand
text-decoration: none
.bootstrap
#header_shopname
@media (max-width: $screen-tablet)
@include padding(9px, 5px, 9px, 40px)
#header_notifs_icon_wrapper
@extend .nav

View File

@@ -1,6 +1,5 @@
.page-head
width: 100%
height: 78px
padding: 0
margin: 0
position: fixed
@@ -18,14 +17,22 @@
font-weight: bold
color: #363A41
white-space: nowrap
@include padding(31px, 0, 0, ($widthSidebarNav+20px))
@media (max-width: $screen-tablet)
@include padding(26px, 0, 0, 70px)
@include padding(31px, 0, 20px, ($widthSidebarNav+20px))
@media (max-width: $screen-phone)
@include padding(26px, 0, 55px, 70px)
@media (min-width: $screen-phone) and (max-width: $screen-tablet)
@include padding(26px, 0, 25px, 70px)
a
border-bottom: dotted 1px white
&:hover
color: black
border-color: black
h2.page-title.configure
@include padding(31px, 0, 35px, ($widthSidebarNav+20px))
@media (max-width: $screen-phone)
@include padding(26px, 0, 60px, 70px)
@media (min-width: $screen-phone) and (max-width: $screen-tablet)
@include padding(26px, 0, 40px, 70px)
a
color: white
text-decoration: none
@@ -42,6 +49,8 @@
background-color: transparent!important
@include right(0)
top: 18px
@media (max-width: $screen-tablet)
top: 25px
@media (max-width: $screen-sm)
#toolbar-nav
border: none

View File

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

View File

@@ -17,7 +17,9 @@
* @license https://store.webkul.com/license.html
*}
{if !isset($ajax) || !$ajax}
<div class="panel form-horizontal" id="customer_cart_details">
{/if}
<div class="panel-heading">
<i class="icon-shopping-cart"></i>
{l s='Cart Details'}
@@ -51,7 +53,7 @@
<td>
<p>{$data.room_type|escape:'html':'UTF-8'}</p>
</td>
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
<td>{dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date}</td>
{if $occupancy_required_for_booking}
<td>
@@ -187,6 +189,7 @@
</table>
</div>
</div>
{if !isset($ajax) || !$ajax}
</div>
{* Modal for extra demands *}
@@ -220,3 +223,4 @@
#add_new_room_services_block {
display: none;}
</style>
{/if}

View File

@@ -1701,67 +1701,67 @@
$('#back_to_service_btn').hide();
});
// Add new custom service: Show hide new custom service form
$(document).on('click', '#btn_new_room_service', function() {
$('#add_new_room_services_block').show();
$('#back_to_service_btn').show();
$('#room_type_services_desc').hide();
});
// Add new custom service: Show hide new custom service form
$(document).on('click', '#btn_new_room_service', function() {
$('#add_new_room_services_block').show();
$('#back_to_service_btn').show();
$('#room_type_services_desc').hide();
});
// Add new custom service: change auto added option
$(document).on('change', '#add_new_room_services_form input[name="new_service_auto_added"]', function() {
var room_type_tax_rule_group_exist = $("#room_type_tax_rule_group_exist").val();
if ($(this).val() == 1) {
$("#new_service_price_tax_rule_container").hide();
$("#new_service_price_addition_type_container").show();
$("#new_service_qty_container").hide();
} else {
$("#new_service_price_addition_type_container").hide();
$("#new_service_qty_container").show();
$("#new_service_price_tax_rule_container").show();
}
});
// Add new custom service: change auto added option
$(document).on('change', '#add_new_room_services_form input[name="new_service_auto_added"]', function() {
var room_type_tax_rule_group_exist = $("#room_type_tax_rule_group_exist").val();
if ($(this).val() == 1) {
$("#new_service_price_tax_rule_container").hide();
$("#new_service_price_addition_type_container").show();
$("#new_service_qty_container").hide();
} else {
$("#new_service_price_addition_type_container").hide();
$("#new_service_qty_container").show();
$("#new_service_price_tax_rule_container").show();
}
});
// Add new custom service to the room
$(document).on('submit', '#add_new_room_services_form', function(e) {
e.preventDefault();
var form_data = new FormData(this);
form_data.append('ajax', true);
form_data.append('action', 'addNewRoomServices');
// Add new custom service to the room
$(document).on('submit', '#add_new_room_services_form', function(e) {
e.preventDefault();
var form_data = new FormData(this);
form_data.append('ajax', true);
form_data.append('action', 'addNewRoomServices');
$(".loading_overlay").show();
$.ajax({
type: 'POST',
headers: {
"cache-control": "no-cache"
},
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
dataType: 'JSON',
cache: false,
data: form_data,
processData: false,
contentType: false,
success: function(jsonData) {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
}
showSuccessMessage(txtExtraDemandSucc);
} else {
var errorHtml = error_found_txt + ':<br>';
errorHtml += '<ol>';
$.each(jsonData.errors, function(key, errorMsg) {
errorHtml += '<li>' + errorMsg + '</li>';
});
errorHtml += '</ol>';
showErrorMessage(errorHtml);
}
},
complete: function() {
$(".loading_overlay").hide();
}
});
});
$(".loading_overlay").show();
$.ajax({
type: 'POST',
headers: {
"cache-control": "no-cache"
},
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
dataType: 'JSON',
cache: false,
data: form_data,
processData: false,
contentType: false,
success: function(jsonData) {
if (!jsonData.hasError) {
if (jsonData.service_panel) {
$('#room_type_service_product_desc').replaceWith(jsonData.service_panel);
}
showSuccessMessage(txtExtraDemandSucc);
} else {
var errorHtml = error_found_txt + ':<br>';
errorHtml += '<ol>';
$.each(jsonData.errors, function(key, errorMsg) {
errorHtml += '<li>' + errorMsg + '</li>';
});
errorHtml += '</ol>';
showErrorMessage(errorHtml);
}
},
complete: function() {
$(".loading_overlay").hide();
}
});
});
$(document).on('click', '.change_room_type_service_product', function() {
if ($(this).prop('checked')) {
@@ -1770,6 +1770,7 @@
$("#selected_service_product_"+$(this).val()).val(0);
}
});
$(document).on('submit', '#update_selected_room_services_form', function(e) {
e.preventDefault();
var form_data = new FormData(this);
@@ -1815,7 +1816,6 @@
</script>
<div class="leadin">{block name="leadin"}{/block}</div>
{include file='controllers/orders/_current_cart_details_data.tpl'}
{* If cart has errors the do not allow to proceed with this cart *}
<div class="panel form-horizontal" id="customer_part" {if isset($is_order_created) && $is_order_created}style="display:none;"{/if}>
<div class="panel-heading">
@@ -1905,6 +1905,7 @@
</div>
</div> -->*}<!-- by webkul to hide unnessesary content -->
</div>
{include file='controllers/orders/_current_cart_details_data.tpl'}
<form class="form-horizontal" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&amp;addorder=1&amp;cart_id={$cart->id}" method="post" style="display:none" id="cart_detail_form">
<div class="panel" id="products_part" style="display:none;">
@@ -2282,6 +2283,19 @@
{else}
{assign var=is_full_payment value=true}
{/if}
<div class="form-group">
<label class="control-label col-lg-3">{l s="Send mails"}</label>
<div class="col-lg-9">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="send_mails" id="send_mails_on" value="1" checked="checked">
<label for="send_mails_on">{l s="Yes"}</label>
<input type="radio" name="send_mails" id="send_mails_off" value="0">
<label for="send_mails_off">{l s="No"}</label>
<a class="slide-button btn"></a>
</span>
<p class="help-block">{l s='If disabled, no mail related to this order will be sent during order creation.'}</p>
</div>
</div>
<div class="form-group" {if $order_total <= 0}style="display: none;"{/if}>
<label class="control-label col-lg-3">{l s="Full payment"}</label>
<div class="col-lg-9">

View File

@@ -458,7 +458,7 @@
<tr>
<td>{dateFormat date=$payment['date_add'] full=true}</td>
<td>{$payment['payment_method']|escape:'html':'UTF-8'}</td>
<td>{$payment_types[$payment['payment_type']]['name']|escape:'html':'UTF-8'}</td>
<td>{$payment_types[$payment['payment_type']]['name']|escape:'UTF-8'}</td>
<td>{$payment['transaction_id']|escape:'html':'UTF-8'}</td>
<td>{displayPrice price=$payment['real_paid_amount'] currency=$payment['id_currency']}</td>
<td>{if isset($payment['invoice_number'])}{$payment['invoice_number']}{else}--{/if}</td>

View File

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

View File

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

View File

@@ -101,8 +101,8 @@
</td>
<td class="col-sm-1 center">
{if isset($room_info['id'])}
{if $room_info['booked_dates']}
<input type="hidden" class="booked-dates" name="{$var_name_room_info|cat:'[booked_dates]'}" value='{$room_info['booked_dates']|json_encode|escape:'html':'UTF-8'}'>
{if isset($room_info['booked_dates']) && $room_info['booked_dates']}
<input type="hidden" class="booked-dates" name="{$var_name_room_info|cat:'[booked_dates]'}" value='{$room_info['booked_dates']|escape:'html':'UTF-8'}'>
<a href="#" class="view_htl_room btn btn-default" data-toggle="modal" data-target="#room-dates-modal" data-id-room="{$room_info['id']}"><i class="icon-info"></i></a>
{/if}
<a href="#" class="rm_htl_room btn btn-default" data-id-htl-info="{$room_info['id']}"><i class="icon-trash"></i></a>
@@ -409,7 +409,7 @@
html += '</select>';
html += '</td>';
html += '<td class="col-sm-3 center">';
html += '<input class="form-control" type="text" name="'+prefix+'[floor]">';
html += '<input class="form-control" type="text" name="'+prefix+'[comment]">';
html += '</td>';
html += '<td class="center col-sm-2">';
html += '<a class="btn btn-default deactiveDatesModal disabled" data-toggle="modal" data-target="#deactiveDatesModal">';

View File

@@ -413,13 +413,6 @@ $(document).ready(function () {
<td>
{$featurePlan['feature_price_name']}
</td>
<td>
{if $featurePlan['impact_type'] == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE}
{l s='Percentage'}
{else}
{l s='Fixed Amount'}
{/if}
</td>
<td>
{if $featurePlan['impact_way'] == HotelRoomTypeFeaturePricing::IMPACT_WAY_DECREASE}
{l s='Decrease'}
@@ -427,6 +420,13 @@ $(document).ready(function () {
{l s='Increase'}
{/if}
</td>
<td>
{if $featurePlan['impact_type'] == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE}
{l s='Percentage'}
{else}
{l s='Fixed Amount'}
{/if}
</td>
<td>
{if $featurePlan['impact_type'] == HotelRoomTypeFeaturePricing::IMPACT_TYPE_PERCENTAGE}
{$featurePlan['impact_value']|round:2}%

View File

@@ -124,17 +124,21 @@
</div>
</td>
<td>
<div class="fixed-width-xl">
<select class="service_product_id_tax_rules_group" name="{$inputs_prefix}id_tax_rules_group">
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if isset($smarty.post["{$inputs_prefix}id_tax_rules_group"])}{if $tax_rules_group.id_tax_rules_group == $smarty.post["{$inputs_prefix}id_tax_rules_group"]}{/if}{elseif $tax_rules_group.id_tax_rules_group == $service_product.id_tax_rules_group}selected{/if}>
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
{/foreach}
</select>
</div>
<div class="help-block">{l s='Default tax rule: %s' sprintf=$service_product.tax_rules_group_name}</div>
{if $service_product.auto_add_to_cart&& $service_product.price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
{l s='-'}
{else}
<div class="fixed-width-xl">
<select class="service_product_id_tax_rules_group" name="{$inputs_prefix}id_tax_rules_group">
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if isset($smarty.post["{$inputs_prefix}id_tax_rules_group"])}{if $tax_rules_group.id_tax_rules_group == $smarty.post["{$inputs_prefix}id_tax_rules_group"]}{/if}{elseif $tax_rules_group.id_tax_rules_group == $service_product.id_tax_rules_group}selected{/if}>
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
{/foreach}
</select>
</div>
<div class="help-block">{l s='Default tax rule: %s' sprintf=$service_product.tax_rules_group_name}</div>
{/if}
</td>
</tr>
{/foreach}

View File

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

View File

@@ -83,7 +83,7 @@
<li>
<a id="page-header-desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass|escape}{else}{$k}{/if}" class="toolbar_btn {if isset($btn.target) && $btn.target} _blank{/if} pointer"{if isset($btn.href)} href="{$btn.href|escape}"{/if} title="{if isset($btn.help)}{$btn.help}{else}{$btn.desc|escape}{/if}"{if isset($btn.js) && $btn.js} onclick="{$btn.js}"{/if}{if isset($btn.modal_target) && $btn.modal_target} data-target="{$btn.modal_target}" data-toggle="modal"{/if}{if isset($btn.help)} data-toggle="tooltip" data-placement="bottom"{/if}>
<i class="{if isset($btn.icon)}{$btn.icon|escape}{else}process-icon-{if isset($btn.imgclass)}{$btn.imgclass|escape}{else}{$k}{/if}{/if}{if isset($btn.class)} {$btn.class|escape}{/if}"></i>
<span{if isset($btn.force_desc) && $btn.force_desc == true } class="locked"{/if}>{$btn.desc|escape}</span>
<span{if isset($btn.force_desc) && $btn.force_desc == true } class="locked"{/if}>{$btn.desc}</span>
</a>
</li>
{/if}

View File

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

View File

@@ -296,7 +296,10 @@ class MailCore extends ObjectModel
}
/* Create mail and attach differents parts */
$subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject;
if (Configuration::get('PS_MAIL_SUBJECT_PREFIX')) {
$subject = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] ' . $subject;
}
$message->setSubject($subject);
$message->setCharset('utf-8');

View File

@@ -3043,7 +3043,7 @@ class ProductCore extends ObjectModel
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null,
$only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null,
$id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null,
$use_customer_price = true, $id_product_roomtype = false)
$use_customer_price = true, $id_product_roomtype = false, $id_group = null)
{
if (!$context) {
$context = Context::getContext();
@@ -3060,14 +3060,16 @@ class ProductCore extends ObjectModel
}
// Initializations
$id_group = null;
if ($id_customer) {
$id_group = Customer::getDefaultGroupId((int)$id_customer);
}
if (!$id_group) {
$id_group = (int)Group::getCurrent()->id;
if ($id_customer) {
$id_group = Customer::getDefaultGroupId((int)$id_customer);
}
}
if (!$id_group || !Validate::isLoadedObject(new Group((int) $id_group))) {
$id_group = (int)Group::getCurrent()->id;
}
// If there is cart in context or if the specified id_cart is different from the context cart id
if (!is_object($cur_cart) || (Validate::isUnsignedInt($id_cart) && $id_cart && $cur_cart->id != $id_cart)) {
/*

View File

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

View File

@@ -666,7 +666,7 @@ class AdminControllerCore extends Controller
));
/* BEGIN - Backward compatibility < 1.6.0.3 */
$this->breadcrumbs[] = $tabs[0]['name'];
$this->breadcrumbs[] = isset($tabs[0]['name']) ? $tabs[0]['name'] : '' ;
$navigation_pipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$this->context->smarty->assign('navigationPipe', $navigation_pipe);
/* END - Backward compatibility < 1.6.0.3 */
@@ -1155,6 +1155,7 @@ class AdminControllerCore extends Controller
header('Cache-Control: no-store, no-cache');
header('Content-disposition: attachment; filename="'.$this->table.'_'.date('Y-m-d_His').'.csv"');
$fd = fopen('php://output', 'wb');
$headers = array();
foreach ($this->fields_list as $key => $datas) {
if ('PDF' === $datas['title']) {
@@ -1167,9 +1168,10 @@ class AdminControllerCore extends Controller
}
}
}
$content = array();
fputcsv($fd, $headers, ';', $text_delimiter);
foreach ($this->_list as $i => $row) {
$content[$i] = array();
$content = array();
$path_to_image = false;
foreach ($this->fields_list as $key => $params) {
$field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8(Tools::nl2br($row[$key])) : '';
@@ -1189,21 +1191,16 @@ class AdminControllerCore extends Controller
$field_value = call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row));
}
}
$content[$i][] = $field_value;
$content[] = $field_value;
}
fputcsv($fd, $content, ';', $text_delimiter);
}
$this->context->smarty->assign(array(
'export_precontent' => "",
'export_headers' => $headers,
'export_content' => $content,
'text_delimiter' => $text_delimiter
)
);
$this->layout = 'layout-export.tpl';
@fclose($fd);
die;
}
/**
* Object Delete
*

View File

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

View File

@@ -1269,7 +1269,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$this->bookingCustomer = $objCustomer;
} else {
$objCustomer = new Customer();
$this->bookingCustomer = $objCustomer->getByEmail($guestDetails['email']);
$this->bookingCustomer = $objCustomer->getByEmail($guestDetails['email'], null, false);
}
if (isset($this->bookingCustomer->id)
@@ -3146,14 +3146,14 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$totalPriceTaxExcl = $unitPriceTaxExcl * $quantity;
$totalPriceTaxIncl = $unitPriceTaxIncl * $quantity;
if (isset($service['unit_price_without_tax'])) {
$unitPriceTaxExcl = $service['unit_price_without_tax'];
if (isset($services[$product['id_product']]['unit_price_without_tax'])) {
$unitPriceTaxExcl = $services[$product['id_product']]['unit_price_without_tax'];
$unitPriceTaxIncl = $unitPriceTaxExcl * $oldTaxMultiplier;
$totalPriceTaxExcl = $unitPriceTaxExcl * $quantity;
$totalPriceTaxIncl = $unitPriceTaxIncl * $quantity;
} else if (isset($service['total_price_without_tax'])) {
$totalPriceTaxExcl = $service['total_price_without_tax'];
} else if (isset($services[$product['id_product']]['total_price_without_tax'])) {
$totalPriceTaxExcl = $services[$product['id_product']]['total_price_without_tax'];
$totalPriceTaxIncl = $totalPriceTaxExcl * $oldTaxMultiplier;
$unitPriceTaxExcl = $totalPriceTaxExcl / $quantity;

View File

@@ -612,10 +612,24 @@ class AdminCartsControllerCore extends AdminController
$cart_detail_data = array();
$cart_detail_data_obj = new HotelCartBookingData();
$cart_detail_data_obj->updateIdCurrencyByIdCart($id_cart, $currency->id);
$cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart);
if ($cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart)) {
$objRoomType = new HotelRoomType();
foreach ($cart_detail_data as $key => $cart_data) {
$cart_detail_data[$key]['room_type_info'] = $objRoomType->getRoomTypeInfoByIdProduct($cart_data['id_product']);
}
}
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
$this->context->smarty->assign(array(
'cart_detail_data' => $cart_detail_data,
'currency' => new Currency((int)$this->context->cart->id_currency),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'ajax' => true
));
$tpl_path = 'default/template/controllers/orders/_current_cart_details_data.tpl';
@@ -1171,19 +1185,80 @@ class AdminCartsControllerCore extends AdminController
// Process when admin changes extra demands of any room while order creation process form.tpl
public function ajaxProcessChangeRoomDemands()
{
$response = array('status' => false);
if ($idCartBooking = Tools::getValue('id_cart_booking')) {
if (Validate::isLoadedObject($objCartbookingCata = new HotelCartBookingData($idCartBooking))) {
$roomDemands = Tools::getValue('room_demands');
$roomDemands = json_decode($roomDemands, true);
$roomDemands = json_encode($roomDemands);
$objCartbookingCata->extra_demands = $roomDemands;
if ($objCartbookingCata->save()) {
$response['status'] = true;
if ($this->tabAccess['edit'] === '1') {
$response = array('status' => false);
if ($idCartBooking = Tools::getValue('id_cart_booking')) {
if (Validate::isLoadedObject($objCartbookingCata = new HotelCartBookingData($idCartBooking))) {
$roomDemands = Tools::getValue('room_demands');
$roomDemands = json_decode($roomDemands, true);
$roomDemands = json_encode($roomDemands);
$objCartbookingCata->extra_demands = $roomDemands;
if ($objCartbookingCata->save()) {
$response['status'] = true;
}
}
}
$this->ajaxDie(json_encode($response));
}
}
public function ajaxProcessUpdateServiceProduct()
{
if ($this->tabAccess['edit'] === '1') {
$operator = Tools::getValue('operator', 'up');
$idServiceProduct = Tools::getValue('id_product');
$idCartBooking = Tools::getValue('id_cart_booking');
$qty = Tools::getValue('qty');
if (Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData($idCartBooking))) {
$objRoomTypeServiceProductCartDetail = new RoomTypeServiceProductCartDetail();
if ($operator == 'up') {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($objRoomTypeServiceProduct->isRoomTypeLinkedWithProduct($objHotelCartBookingData->id_product, $idServiceProduct)) {
// validate quanitity
if (Validate::isLoadedObject($objProduct = new Product($idServiceProduct))) {
if ($objProduct->allow_multiple_quantity) {
if (!Validate::isUnsignedInt($qty)) {
$this->errors[] = Tools::displayError('The quantity code you\'ve entered is invalid.');
// } elseif ($objProduct->max_quantity && $qty > $objProduct->max_quantity) {
// $this->errors[] = Tools::displayError(sprintf('cannot add more than %d quantity.', $objProduct->max_quantity));
}
} else {
$qty = 1;
}
} else {
$this->errors[] = Tools::displayError('This Service is not available.');
}
} else {
$this->errors[] = Tools::displayError('This Service is not available with selected room.');
}
}
if (empty($this->errors)) {
if ($objRoomTypeServiceProductCartDetail->updateCartServiceProduct(
$idCartBooking,
$idServiceProduct,
$qty,
$objHotelCartBookingData->id_cart,
$operator
)) {
$this->ajaxDie(json_encode(array(
'hasError' => false
)));
} else {
$this->errors[] = Tools::displayError('Unable to update services. Please try reloading the page.');
}
}
} else {
$this->errors[] = Tools::displayError('Room not found. Please try reloading the page.');
}
$this->ajaxDie(json_encode(array(
'hasError' => true,
'errors' => $this->errors
)));
}
$this->ajaxDie(json_encode($response));
}
public static function getOrderTotalUsingTaxCalculationMethod($id_cart)

View File

@@ -109,6 +109,12 @@ class AdminEmailsControllerCore extends AdminController
2 => $this->l('Set my own SMTP parameters (for advanced users ONLY)')
)
),
'PS_MAIL_SUBJECT_PREFIX' => array(
'title' => $this->l('Enable the website name as a prefix in the email\'s subject'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool',
),
'PS_MAIL_TYPE' => array(
'title' => '',
'validation' => 'isGenericName',
@@ -125,7 +131,7 @@ class AdminEmailsControllerCore extends AdminController
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
)
),
'submit' => array('title' => $this->l('Save'))
),
@@ -218,7 +224,7 @@ class AdminEmailsControllerCore extends AdminController
if (!defined('_PS_HOST_MODE_')) {
$this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices'][1] =
$this->l('Use PHP\'s mail() function (recommended; works in most cases)');
$this->l('Use PHP\'s mail() function');
}
ksort($this->fields_options['email']['fields']['PS_MAIL_METHOD']['choices']);

View File

@@ -859,6 +859,7 @@ class AdminOrdersControllerCore extends AdminController
$this->context->smarty->assign(
array(
'order' => $objOrder,
'invoices_collection' => $objOrder->getInvoicesCollection(),
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
)
@@ -899,112 +900,114 @@ class AdminOrdersControllerCore extends AdminController
&& ($productLineData = Tools::getValue('product_line_data'))
) {
$productLineData = json_decode($productLineData, true);
if (Validate::isLoadedObject($objOrderDetail = new OrderDetail($productLineData['id_order_detail']))) {
$productLineData['id_order_invoice'] = $objOrderDetail->id_order_invoice;
$smartyVars = array(
'order' => $objOrder,
'data' => $productLineData,
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'orderEdit' => 1,
);
$smartyVars = array(
'order' => $objOrder,
'data' => $productLineData,
'currency' => new Currency($objOrder->id_currency),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'orderEdit' => 1,
);
$objCurrency = new Currency($objOrder->id_currency);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$objCurrency = new Currency($objOrder->id_currency);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['currencySign'] = $objCurrency->sign;
$smartyVars['link'] = $this->context->link;
$smartyVars['id_booking_detail'] = $productLineData['id'];
$smartyVars['id_booking_detail'] = $productLineData['id'];
$objBookingDemand = new HotelBookingDemands();
$objBookingDemand = new HotelBookingDemands();
// set context currency So that we can get prices in the order currency
$this->context->currency = $objCurrency;
// set context currency So that we can get prices in the order currency
$this->context->currency = $objCurrency;
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
0,
0,
0,
0,
1,
0,
1,
$productLineData['id']
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
// get room type additional demands
$objRoomDemands = new HotelRoomTypeDemand();
if ($roomTypeDemands = $objRoomDemands->getRoomTypeDemands($idProduct)) {
foreach ($roomTypeDemands as &$demand) {
// if demand has advance options then set demand price as first advance option price.
if (isset($demand['adv_option']) && $demand['adv_option']) {
$demand['price'] = current($demand['adv_option'])['price'];
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
0,
0,
0,
0,
1,
0,
1,
$productLineData['id']
)) {
$smartyVars['extraDemands'] = $extraDemands;
}
$smartyVars['roomTypeDemands'] = $roomTypeDemands;
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$productLineData['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
if (Configuration::get('PS_ALLOW_ADD_ALL_SERVICES_IN_BOOKING')) {
// get all services
$objProduct = new Product();
$serviceProducts = $objProduct->getServiceProducts(true);
} else {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$serviceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null);
}
if ($serviceProducts) {
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if ($additionalServices
&& (in_array($servProduct['id_product'], array_column($additionalServices['additional_services'], 'id_product')))
) {
unset($serviceProducts[$key]);
// get room type additional demands
$objRoomDemands = new HotelRoomTypeDemand();
if ($roomTypeDemands = $objRoomDemands->getRoomTypeDemands($idProduct)) {
foreach ($roomTypeDemands as &$demand) {
// if demand has advance options then set demand price as first advance option price.
if (isset($demand['adv_option']) && $demand['adv_option']) {
$demand['price'] = current($demand['adv_option'])['price'];
}
}
$smartyVars['roomTypeDemands'] = $roomTypeDemands;
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
$productLineData['id']
)) {
$smartyVars['additionalServices'] = $additionalServices;
}
if (Configuration::get('PS_ALLOW_ADD_ALL_SERVICES_IN_BOOKING')) {
// get all services
$objProduct = new Product();
$serviceProducts = $objProduct->getServiceProducts(true);
} else {
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$serviceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null);
}
if ($serviceProducts) {
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if ($additionalServices
&& (in_array($servProduct['id_product'], array_column($additionalServices['additional_services'], 'id_product')))
) {
unset($serviceProducts[$key]);
}
}
$smartyVars['serviceProducts'] = $serviceProducts;
}
$objOrderReturn = new OrderReturn();
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrder->id, 0, 1);
$smartyVars['refundReqBookings'] = $refundReqBookings;
// check if booking room type tax rule is still exist
$objHotelBookingDetail = new HotelBookingDetail((int) $productLineData['id']);
$objOrderDetail = new OrderDetail($objHotelBookingDetail->id_order_detail);
if (Validate::isLoadedObject($objTaxRuleGroup = new TaxRulesGroup($objOrderDetail->id_tax_rules_group))) {
$smartyVars['roomTypeTaxRuleGroupExist'] = 1;
} else {
$smartyVars['roomTypeTaxRuleGroupExist'] = 0;
}
$taxRulesGroups = TaxRulesGroup::getTaxRulesGroups(true);
$smartyVars['taxRulesGroups'] = $taxRulesGroups;
$smartyVars['invoices_collection'] = $objOrder->getInvoicesCollection();
$smartyVars['customServiceAllowed'] = Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$this->context->smarty->assign($smartyVars);
$modal = array(
'modal_id' => 'edit-room-booking-modal',
'modal_class' => 'modal-lg order_detail_modal',
'modal_title' => '<i class="icon icon-bed"></i> &nbsp'.$this->l('Edit Room'),
'modal_content' => $this->context->smarty->fetch('controllers/orders/modals/_edit_room_booking.tpl'),
);
$this->context->smarty->assign($modal);
$response['hasError'] = 0;
$response['modalHtml'] = $this->context->smarty->fetch('modal.tpl');
}
$smartyVars['serviceProducts'] = $serviceProducts;
$objOrderReturn = new OrderReturn();
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrder->id, 0, 1);
$smartyVars['refundReqBookings'] = $refundReqBookings;
// check if booking room type tax rule is still exist
$objHotelBookingDetail = new HotelBookingDetail($idHtlBookingDetail);
$objOrderDetail = new OrderDetail($objHotelBookingDetail->id_order_detail);
if (Validate::isLoadedObject($objTaxRuleGroup = new TaxRulesGroup($objOrderDetail->id_tax_rules_group))) {
$smartyVars['roomTypeTaxRuleGroupExist'] = 1;
} else {
$smartyVars['roomTypeTaxRuleGroupExist'] = 0;
}
$taxRulesGroups = TaxRulesGroup::getTaxRulesGroups(true);
$smartyVars['taxRulesGroups'] = $taxRulesGroups;
$smartyVars['customServiceAllowed'] = Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$this->context->smarty->assign($smartyVars);
$modal = array(
'modal_id' => 'edit-room-booking-modal',
'modal_class' => 'modal-lg order_detail_modal',
'modal_title' => '<i class="icon icon-bed"></i> &nbsp'.$this->l('Edit Room'),
'modal_content' => $this->context->smarty->fetch('controllers/orders/modals/_edit_room_booking.tpl'),
);
$this->context->smarty->assign($modal);
$response['hasError'] = 0;
$response['modalHtml'] = $this->context->smarty->fetch('modal.tpl');
}
die(Tools::jsonEncode($response));
@@ -1697,7 +1700,7 @@ class AdminOrdersControllerCore extends AdminController
$this->errors[] = Tools::displayError('The invoice for edit note was unable to load. ');
}
} elseif (Tools::isSubmit('submitAddOrder') && ($id_cart = Tools::getValue('id_cart'))) {
if ($this->tabAccess['edit'] === '1') {
if ($this->tabAccess['add'] === '1') {
$objCart = new Cart($id_cart);
if (Validate::isLoadedObject($objCart)) {
$this->context->cart = $objCart;
@@ -1799,6 +1802,7 @@ class AdminOrdersControllerCore extends AdminController
$amountPaid = Tools::ps_round($amountPaid, 6);
$objEmployee = new Employee($this->context->cookie->id_employee);
$sendMails = Tools::getValue('send_mails', true);
$objPaymentModule->validateOrder(
$objCart->id,
@@ -1809,7 +1813,9 @@ class AdminOrdersControllerCore extends AdminController
$extraVars,
null,
false,
$objCart->secure_key
$objCart->secure_key,
null,
$sendMails
);
if (isset($this->context->cookie->id_cart)) {
@@ -2612,11 +2618,11 @@ class AdminOrdersControllerCore extends AdminController
$helper->id = 'box-today-stay-over';
$helper->icon = 'icon-user';
$helper->color = 'color4';
$helper->title = $this->l('Stay Overs', null, null, false);
$helper->title = $this->l('Occupied Rooms', null, null, false);
$helper->subtitle = $this->l('Today', null, null, false);
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitResetorder&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d', strtotime('+ 1 days'))).'&orderFilter_hbd!date_to[]=';
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=today_stay_over';
$helper->tooltip = $this->l('Total number of stay overs for today.', null, null, false);
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=occupied_rooms';
$helper->tooltip = $this->l('The count of rooms that are currently occupied by guests.', null, null, false);
$this->kpis[] = $helper;
$helper = new HelperKpi();
@@ -4435,14 +4441,15 @@ class AdminOrdersControllerCore extends AdminController
}
}
// Create Order detail information
$order_detail = new OrderDetail();
$order_detail->createList($order, $cart, $order->getCurrentOrderState(), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
// update totals amount of order
$order->total_products += (float)$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS);
$order->total_products_wt += (float)$cart->getOrderTotal($use_taxes, Cart::ONLY_PRODUCTS);
// Create Order detail information
$order_detail = new OrderDetail();
// In case there is no room in the order the the create list will not add taxes as total_products is zero.
$order_detail->createList($order, $cart, $order->getCurrentOrderState(), $cart->getProducts(), (isset($order_invoice) ? $order_invoice->id : 0), $use_taxes, (int)Tools::getValue('add_product_warehouse'));
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
@@ -4898,8 +4905,6 @@ class AdminOrdersControllerCore extends AdminController
if (isset($order_invoice)) {
// Apply changes on OrderInvoice
$order_invoice->total_products += (float)$diff_price_tax_excl;
$order_invoice->total_products_wt += (float)$diff_price_tax_incl;
$order_invoice->total_paid_tax_excl += (float)$diff_price_tax_excl;
$order_invoice->total_paid_tax_incl += (float)$diff_price_tax_incl;
}
@@ -4911,10 +4916,6 @@ class AdminOrdersControllerCore extends AdminController
$order->total_products_wt += (float)$diff_price_tax_incl;
$order->total_products_wt = $order->total_products_wt > 0 ? $order->total_products_wt : 0;
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$res &= $order->update();
}
@@ -4939,10 +4940,6 @@ class AdminOrdersControllerCore extends AdminController
}
}
// Save order invoice
if (isset($order_invoice)) {
$res &= $order_invoice->update();
}
if ($qty_diff != 0) {
$cartQty = $qty_diff;
@@ -5068,7 +5065,6 @@ class AdminOrdersControllerCore extends AdminController
)) {
// update extra demands total prices if dates are changes (price calc method for each day)
if ($extraDemands) {
$order = new Order($id_order);
foreach ($extraDemands as $demand) {
if (isset($demand['extra_demands']) && $demand['extra_demands']) {
foreach ($demand['extra_demands'] as $rDemand) {
@@ -5093,23 +5089,23 @@ class AdminOrdersControllerCore extends AdminController
$objBookingDemand->total_price_tax_incl = $demandPriceTI;
$objBookingDemand->save();
$order_invoice->total_paid_tax_excl -= $rDemand['total_price_tax_excl'];
$order_invoice->total_paid_tax_incl -= $rDemand['total_price_tax_incl'];
$order_invoice->total_paid_tax_excl += (float)$objBookingDemand->total_price_tax_excl;
$order_invoice->total_paid_tax_incl += (float)$objBookingDemand->total_price_tax_incl;
}
}
}
}
// change order total save
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
}
if (isset($orderServiceProducts)
&& is_array($orderServiceProducts)
&& count($orderServiceProducts)
) {
$order = new Order((int) $id_order);
foreach ($orderServiceProducts as $orderServiceProduct) {
if (isset($orderServiceProduct['additional_services'])
&& is_array($orderServiceProduct['additional_services'])
@@ -5155,6 +5151,12 @@ class AdminOrdersControllerCore extends AdminController
$objOrderDetail->product_quantity += ($newProductQuantity - $oldProductQuantity);
$objOrderDetail->save();
$order_invoice->total_paid_tax_excl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_excl;
$order_invoice->total_paid_tax_incl -= $objRoomTypeServiceProductOrderDetail->total_price_tax_incl;
$order_invoice->total_paid_tax_excl += (float)$newTotalPriceTaxExcl;
$order_invoice->total_paid_tax_incl += (float)$newTotalPriceTaxIncl;
$objRoomTypeServiceProductOrderDetail->unit_price_tax_excl = $unitPriceTaxExcl;
$objRoomTypeServiceProductOrderDetail->unit_price_tax_incl = $unitPriceTaxIncl;
$objRoomTypeServiceProductOrderDetail->total_price_tax_excl = $newTotalPriceTaxExcl;
@@ -5164,14 +5166,21 @@ class AdminOrdersControllerCore extends AdminController
}
}
}
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
}
}
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->save();
// Save order invoice
if (isset($order_invoice)) {
$order_invoice->total_products = $order_invoice->total_paid_tax_excl;
$order_invoice->total_products_wt = $order_invoice->total_paid_tax_incl;
$res &= $order_invoice->update();
}
if (is_array(Tools::getValue('product_quantity'))) {
$view = $this->createTemplate('_customized_data.tpl')->fetch();
} else {
@@ -5551,8 +5560,8 @@ class AdminOrdersControllerCore extends AdminController
// Update Order
// values changes as values are calculated accoding to the quantity of the product by webkul
$order->total_paid = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal(), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false), _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_incl = Tools::ps_round($order->getOrderTotal() - $roomExtraDemandTI, _PS_PRICE_COMPUTE_PRECISION_);
$order->total_paid_tax_excl = Tools::ps_round($order->getOrderTotal(false) - $roomExtraDemandTE, _PS_PRICE_COMPUTE_PRECISION_);
$order->total_products -= ($diff_products_tax_excl + $additionlServicesTE);
$order->total_products = $order->total_products > 0 ? $order->total_products : 0;
@@ -5621,15 +5630,15 @@ class AdminOrdersControllerCore extends AdminController
$objOrderCartRule->delete();
}
// If no rooms left in the order, Update Order total and discounts to 0
$order->total_discounts = 0;
$order->total_discounts_tax_incl = 0;
$order->total_discounts_tax_excl = 0;
$order->total_paid = 0;
$order->total_paid_tax_incl = 0;
$order->total_paid_tax_excl = 0;
$order->update();
}
// If no rooms left in the order, Update Order total and discounts to 0
$order->total_discounts = 0;
$order->total_discounts_tax_incl = 0;
$order->total_discounts_tax_excl = 0;
$order->total_paid = 0;
$order->total_paid_tax_incl = 0;
$order->total_paid_tax_excl = 0;
$order->update();
}
// Assign to smarty informations in order to show the new product line
@@ -6163,7 +6172,7 @@ class AdminOrdersControllerCore extends AdminController
$del_id = Tools::getValue('del_id');
$room_id = Tools::getValue('id_room');
$obj_hotel_cart_detail = new HotelCartBookingData();
$deleted = $obj_hotel_cart_detail->deleteRowById($del_id);
$deleted = $obj_hotel_cart_detail->deleteCartBookingData($cart_id, $id_product, $room_id, $dt_frm, $dt_to);
if ($deleted) {
HotelRoomTypeFeaturePricing::deleteByIdCart($cart_id, $id_product, $room_id, $dt_frm, $dt_to );
$obj_product_process = new HotelCartBookingData();

View File

@@ -90,6 +90,7 @@ class AdminPPreferencesControllerCore extends AdminController
'type' => 'text',
'suffix' => $this->l('characters'),
'class' => 'fixed-width-xl',
'desc' => $this->l('If set to 0, the maximum limit will be 400 characters.')
),
/*'PS_QTY_DISCOUNT_ON_COMBINATION' => array(
'title' => $this->l('Quantity discounts based on'),

View File

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

View File

@@ -791,6 +791,9 @@
<configuration id="PS_MAIL_METHOD" name="PS_MAIL_METHOD">
<value>1</value>
</configuration>
<configuration id="PS_MAIL_SUBJECT_PREFIX" name="PS_MAIL_SUBJECT_PREFIX">
<value>1</value>
</configuration>
<configuration id="PS_SHOP_ACTIVITY" name="PS_SHOP_ACTIVITY">
<value>Animaux</value>
</configuration>

View File

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

View File

@@ -20,6 +20,10 @@
(function($) {
var dateRangePickerOrg = $.fn.dateRangePicker;
Object.assign($.dateRangePickerLanguages, {
zh: $.dateRangePickerLanguages.cn,
tw: $.dateRangePickerLanguages.tc
});
$.fn.dateRangePicker = function(opt) {
if(typeof opt === "object") {
let container = $(this).parent();
@@ -77,11 +81,13 @@
const inputElementHeight = dateRangePickerInput.outerHeight();
const spaceTop = dateRangePickerInput.offset().top - $(window).scrollTop();
const spaceBottom = $(window).height() - inputElementHeight - spaceTop;
const maxHeightNeeded = $(calendarDom).get(0).scrollHeight;
// 20 added for padding
const maxHeightNeeded = $(calendarDom).get(0).scrollHeight + 20;
let positionClass = 'bottom';
// determine position class
if (spaceBottom < maxHeightNeeded && spaceTop > spaceBottom) {
if (spaceBottom < maxHeightNeeded && spaceTop > maxHeightNeeded && spaceTop > spaceBottom) {
positionClass = 'top';
}

View File

@@ -80,4 +80,10 @@ class BankwirePaymentModuleFrontController extends ModuleFrontController
$this->setTemplate('payment_execution.tpl');
}
public function setMedia()
{
parent::setMedia();
$this->addJS($this->module->getLocalPath().'views/js/front/payment.js');
}
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,30 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
$(document).ready(function () {
$(document).on('click', '.confirm_order', function(e){
e.preventDefault();
$(this).attr('disabled', 'disabled');
$(this).closest('form').get(0).submit();
});
});

View File

@@ -0,0 +1,32 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -85,12 +85,12 @@
</p>
</div><!-- .cheque-box -->
<p class="cart_navigation clearfix" id="cart_navigation">
<a class="btn" href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
<i class="icon-chevron-left"></i>&nbsp;{l s='Other payment methods' mod='bankwire'}
</a>
<a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}" class="button-exclusive btn btn-default">
<i class="icon-chevron-left"></i>{l s='Other payment methods' mod='bankwire'}
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='bankwire'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}

View File

@@ -83,4 +83,10 @@ class ChequePaymentModuleFrontController extends ModuleFrontController
$this->setTemplate('payment_execution.tpl');
}
public function setMedia()
{
parent::setMedia();
$this->addJS($this->module->getLocalPath().'views/js/front/payment.js');
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,29 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
$(document).ready(function () {
$(document).on('click', '.confirm_order', function(e){
e.preventDefault();
$(this).attr('disabled', 'disabled');
$(this).closest('form').get(0).submit();
});
});

View File

@@ -0,0 +1,32 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -81,11 +81,11 @@
<i class="icon-chevron-left"></i>{l s='Other payment methods' mod='cheque'}
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right" type="submit">
<span>{l s='I confirm my order' mod='bankwire'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}
{if !$restrict_order}
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='cheque'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}
</p>
</form>
{/if}

View File

@@ -79,7 +79,7 @@ class DashGuestCycle extends Module
$dataValue['dgc_total_departures'] = sprintf('%02d', rand(100, 1000));
$dataValue['dgc_departed'] = sprintf('%02d', rand(0, $dataValue['dgc_total_departures']));
$dataValue['dgc_new_bookings'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_stay_overs'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_occupied'] = sprintf('%02d', rand(10, 500));
$dataValue['dgc_new_messages'] = sprintf('%02d', rand(0, 20));
$dataValue['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20));
$dataValue['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000));
@@ -94,7 +94,12 @@ class DashGuestCycle extends Module
$dataValue['dgc_departed'] = sprintf('%02d', $departuresData['departed']);
$dataValue['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']);
$dataValue['dgc_new_bookings'] = sprintf('%02d', count(AdminStatsController::getNewBookingsInfoByDate($dateToday, $params['id_hotel'])));
$dataValue['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel']));
$dataValue['dgc_occupied'] = sprintf('%02d', AdminStatsController::getDistinctRoomBookingsCount(
date('Y-m-d', strtotime('-1 day')),
$dateToday,
$params['id_hotel'],
HotelBookingDetail::STATUS_CHECKED_IN
));
$dataValue['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday));
$dataValue['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel']));
$dataValue['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']);

View File

@@ -68,15 +68,15 @@
</div>
</div>
<div class="badge-wrapper">
<div class="badge-item label-tooltip" data-toggle="tooltip" data-original-title="{l s='The number of stay overs scheduled for today.' mod='dashguestcycle'}">
<div class="badge-item label-tooltip" data-toggle="tooltip" data-original-title="{l s='The count of rooms that are currently occupied by guests.' mod='dashguestcycle'}">
<div class="badge-strip" style="background-color: #FFC148;"></div>
<div class="badge-content-wrapper">
<div class="title-wrapper">
<p class="text-center">{l s="Stay Overs" mod='dashguestcycle'}</p>
<p class="text-center">{l s='Occupied Rooms' mod='dashguestcycle'}</p>
</div>
<div class="value-wrapper">
<p class="text-center">
<span id="dgc_stay_overs"></span>
<span id="dgc_occupied"></span>
</p>
</div>
</div>

View File

@@ -204,7 +204,7 @@ class HotelBookingDemands extends ObjectModel
}
// Rounding as per configurations
$totalAmount += Tools::processPriceRounding($amount, $quantity);
$totalAmount = Tools::processPriceRounding($amount, $quantity);
$values .= '('.(int)$this->id.','.(int)$idTax.','.(float)$amount.','.
(float)$totalAmount.'),';

View File

@@ -62,6 +62,7 @@ class HotelBookingDetail extends ObjectModel
public $adults;
public $children;
public $child_ages;
public $planned_check_out;
public $date_add;
public $date_upd;
@@ -124,6 +125,7 @@ class HotelBookingDetail extends ObjectModel
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 255, 'required' => true),
'check_in_time' => array('type' => self::TYPE_STRING, 'required' => true),
'check_out_time' => array('type' => self::TYPE_STRING, 'required' => true),
'planned_check_out' => array('type' => self::TYPE_STRING, 'required' => true),
'adults' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'children' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'child_ages' => array('type' => self::TYPE_STRING),
@@ -1872,6 +1874,7 @@ class HotelBookingDetail extends ObjectModel
$reallocatedBookingId = 0;
// get the cart booking data for the given booking
if (Validate::isLoadedObject($objOldHotelBooking = new HotelBookingDetail($idHotelBooking))) {
$objectHotelBookingFrom = clone $objOldHotelBooking;
$objHotelRoomInfo = new HotelRoomInformation($idRoom);
$idNewRoomType = $objHotelRoomInfo->id_product;
if ($objOldHotelBooking->id_product != $idNewRoomType) {
@@ -2098,6 +2101,7 @@ class HotelBookingDetail extends ObjectModel
if ($result &= $objBookingDetail->save()) {
$reallocatedBookingId = $objBookingDetail->id;
$objectHotelBookingTo = $objBookingDetail;
// Get Booking Demands of the old booking to add in the new booking creation
$objBookingDemand = new HotelBookingDemands();
if ($oldBookingDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
@@ -2278,6 +2282,7 @@ class HotelBookingDetail extends ObjectModel
$result &= $objOldHotelBooking->save();
$reallocatedBookingId = $objOldHotelBooking->id;
$objectHotelBookingTo = $objOldHotelBooking;
}
if ($result && $reallocatedBookingId) {
@@ -2286,6 +2291,8 @@ class HotelBookingDetail extends ObjectModel
array(
'id_htl_booking_from' => $idHotelBooking,
'id_htl_booking_to' => $reallocatedBookingId,
'objectHotelBookingFrom' => $objectHotelBookingFrom,
'objectHotelBookingTo' => $objectHotelBookingTo,
)
);
@@ -3660,4 +3667,18 @@ class HotelBookingDetail extends ObjectModel
return $result;
}
public function add($auto_date = true, $null_values = false)
{
if (!$this->planned_check_out) {
$objHotelBranchInfo = new HotelBranchInformation((int) $this->id_hotel);
$dateTo = new DateTime($this->date_to);
$timeParts = explode(':', $objHotelBranchInfo->check_out);
$dateTo->setTime($timeParts[0], $timeParts[1]);
$this->planned_check_out = $dateTo->format('Y-m-d H:i:s');
}
return parent::add($auto_date, $null_values);
}
}

View File

@@ -24,17 +24,17 @@ class HotelHelper
{
$objModule = new HotelreservationSystem();
$jsVars = array(
'display_name' => $objModule->l('Display', 'HotelHelper', false, true),
'records_name' => $objModule->l('records per page', 'HotelHelper', false, true),
'no_product' => $objModule->l('No records found', 'HotelHelper', false, true),
'show_page' => $objModule->l('Showing page', 'HotelHelper', false, true),
'show_of' => $objModule->l('of', 'HotelHelper', false, true),
'no_record' => $objModule->l('No records available', 'HotelHelper', false, true),
'filter_from' => $objModule->l('filtered from', 'HotelHelper', false, true),
't_record' => $objModule->l('total records', 'HotelHelper', false, true),
'search_item' => $objModule->l('Search', 'HotelHelper', false, true),
'p_page' => $objModule->l('Previous', 'HotelHelper', false, true),
'n_page' => $objModule->l('Next', 'HotelHelper', false, true),
'display_name' => $objModule->l('Display', 'HotelHelper', true),
'records_name' => $objModule->l('records per page', 'HotelHelper', true),
'no_product' => $objModule->l('No records found', 'HotelHelper', true),
'show_page' => $objModule->l('Showing page', 'HotelHelper', true),
'show_of' => $objModule->l('of', 'HotelHelper', true),
'no_record' => $objModule->l('No records available', 'HotelHelper',true),
'filter_from' => $objModule->l('filtered from', 'HotelHelper', true),
't_record' => $objModule->l('total records', 'HotelHelper', true),
'search_item' => $objModule->l('Search', 'HotelHelper', true),
'p_page' => $objModule->l('Previous', 'HotelHelper', true),
'n_page' => $objModule->l('Next', 'HotelHelper', true),
);
Media::addJsDef($jsVars);
@@ -2231,6 +2231,10 @@ class HotelHelper
$objProduct->price_calculation_method = $serviceProduct['price_calculation_method'];
$objProduct->is_virtual = 1;
$objProduct->indexed = 1;
if ($objProduct->auto_add_to_cart && $objProduct->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM) {
$objProduct->id_tax_rules_group = 0;
}
$objProduct->save();
$idProduct = $objProduct->id;

View File

@@ -153,6 +153,7 @@ class HotelReservationSystemDb
`comment` text NOT NULL,
`check_in` datetime NOT NULL,
`check_out` datetime NOT NULL,
`planned_check_out` datetime NOT NULL,
`date_from` datetime NOT NULL,
`date_to` datetime NOT NULL,
`total_price_tax_excl` decimal(20,6) NOT NULL,

View File

@@ -651,8 +651,8 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
$totalPrice['total_price_tax_excl'] = 0;
$featureImpactPriceTE = 0;
$featureImpactPriceTI = 0;
$productPriceTI = Product::getPriceStatic((int) $id_product, true, false, 6, null, false, $use_reduc);
$productPriceTE = Product::getPriceStatic((int) $id_product, false, false, 6, null, false, $use_reduc);
$productPriceTI = Product::getPriceStatic((int) $id_product, 1, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, $id_group);
$productPriceTE = Product::getPriceStatic((int) $id_product, 0, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, $id_group);
if ($productPriceTE) {
$taxRate = (($productPriceTI-$productPriceTE)/$productPriceTE)*100;
} else {

View File

@@ -239,6 +239,13 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
$totalPrice += $product['total_price_tax_excl'];
}
} else {
$taxes = OrderDetailCore::getTaxListStatic($product['id_order_detail']);
$tax_temp = array();
foreach ($taxes as $tax) {
$obj = new Tax($tax['id_tax']);
$tax_temp[] = sprintf('%1$s%2$s%%', ($obj->rate + 0), '&nbsp;');
}
$product_tax_label = implode(', ', $tax_temp);
if (isset($selectedAdditionalServices['additional_services'])) {
$selectedAdditionalServices['total_price_tax_excl'] += $product['total_price_tax_excl'];
$selectedAdditionalServices['total_price_tax_incl'] += $product['total_price_tax_incl'];
@@ -257,6 +264,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'total_price_tax_excl' => $product['total_price_tax_excl'],
'total_price_tax_incl' => $product['total_price_tax_incl'],
'product_tax_label' => $product_tax_label,
);
} else {
$selectedAdditionalServices['id_order'] = $product['id_order'];
@@ -282,6 +290,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'total_price_tax_excl' => $product['total_price_tax_excl'],
'total_price_tax_incl' => $product['total_price_tax_incl'],
'product_tax_label' => $product_tax_label,
),
);
}

View File

@@ -110,7 +110,8 @@ class RoomTypeServiceProductPrice extends ObjectModel
$useTax = null,
$id_cart = false,
$id_address = null,
$use_reduc= 1
$use_reduc= 1,
$idGroup = null
) {
if ($useTax === null)
$useTax = Product::$_taxCalculationMethod == PS_TAX_EXC ? false : true;
@@ -135,7 +136,8 @@ class RoomTypeServiceProductPrice extends ObjectModel
true,
null,
true,
(int)$idProductRoomType
(int)$idProductRoomType,
$idGroup
);
Hook::exec('actionServicePriceModifier',

View File

@@ -222,6 +222,7 @@ class AdminAddHotelController extends ModuleAdminController
$smartyVars['ps_img_dir'] = _PS_IMG_.'l/';
$smartyVars['MAX_GLOBAL_BOOKING_DATE'] = (Configuration::get('MAX_GLOBAL_BOOKING_DATE'));
$smartyVars['GLOBAL_PREPARATION_TIME'] = Configuration::get('GLOBAL_PREPARATION_TIME');
$smartyVars['WK_ORDER_REFUND_ALLOWED'] = Configuration::get('WK_ORDER_REFUND_ALLOWED');
$this->context->smarty->assign($smartyVars);
@@ -322,6 +323,10 @@ class AdminAddHotelController extends ModuleAdminController
}
}
if ($activeRefund && !Configuration::get('WK_ORDER_REFUND_ALLOWED')) {
$this->errors[] = $this->l('Enable order refunds to allow hotel-wise refunds.');
}
// validate Friendly URL values
if (!trim(Tools::getValue('link_rewrite_'.$defaultLangId))) {
$this->errors[] = $this->l('Friendly URL is required at least in ').

View File

@@ -747,13 +747,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
}
} else {
// remove room from cart
$objHotelCartBookingData = new HotelCartBookingData($id_cart_book_data);
if ($objHotelCartBookingData->deleteCartBookingData(
$obj_booking_dtl->id_cart,
$objHotelCartBookingData->id_product,
$objHotelCartBookingData->id_room,
$objHotelCartBookingData->date_from,
$objHotelCartBookingData->date_to
if ((Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData((int) $id_cart_book_data)))
&& $objHotelCartBookingData->deleteCartBookingData(
$objHotelCartBookingData->id_cart,
$objHotelCartBookingData->id_product,
$objHotelCartBookingData->id_room,
$objHotelCartBookingData->date_from,
$objHotelCartBookingData->date_to
)) {
$response['success'] = true;
if ($ajax_delete) {
@@ -994,7 +994,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', null, true),
'PS_BACKDATE_ORDER_ALLOW' => $PS_BACKDATE_ORDER_ALLOW,
// 'check_calender_var' => $check_calender_var,
'txtSomeErr' => $this->l('Some error occurred. Please try again.'),
'txtSomeErr' => $this->l('Some error occurred. Please try again.', null, true),
'no_rm_avail_txt' => $this->l('No room available.', null, true),
'no_realloc_rm_avail_txt' => $this->l('No room available for reallocation.', null, true),
'no_realloc_rm_type_avail_txt' => $this->l('No room type available for reallocation.', null, true),

View File

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

View File

@@ -506,16 +506,14 @@ $(document).ready(function() {
opt: 0,
},
success: function(result) {
if (result) {
if (!(result.success)) {
$(".cart_booking_btn").attr('disabled', 'true');
}
if (!result.success) {
$(".cart_booking_btn").attr('disabled', 'true');
} else {
$("#htl_rooms_list").empty().append(result.data.room_tpl);
refreshCartData();
refreshStatsData();
calendar.refetchEvents();
initBookingList();
var panel_btn = $(".tab-pane tr td button[data-id-cart-book-data='" + id_cart_book_data + "']");
panel_btn.attr('data-id-cart', '');
@@ -527,7 +525,6 @@ $(document).ready(function() {
panel_btn.removeClass('part_delete_cart_data').addClass('par_add_cart');
panel_btn.removeClass('btn-danger').addClass('btn-primary').html(add_to_cart);
}
}
});

View File

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

View File

@@ -264,6 +264,21 @@ class WkRoomSearchHelper
));
}
$totalColumns = 9;// min value
if ($locationEnabled) {
$totalColumns += 4;
}
if (!(count($hotelsInfo) <= 1 && !$smartyVars['show_hotel_name'])) {
$totalColumns += 5;
}
if (Configuration::get('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$totalColumns += 4;
}
$smartyVars['total_columns'] = $totalColumns;
Context::getContext()->smarty->assign($smartyVars);
}
}

View File

@@ -337,23 +337,6 @@ const BookingSearchManager = {
return true;
},
}
function updateGridColumns() {
const gridContainer = $('#search_hotel_block_form > .grid');
$(gridContainer).each(function() {
const gridItems = $(this).find('div.grid-item');
let totalColumns = 0;
Array.from(gridItems).forEach(item => {
totalColumns += parseInt(getComputedStyle(item).getPropertyValue('--col-span'));
});
$(this).css('grid-template-columns', `repeat(${totalColumns}, 1fr)`);
Array.from(gridItems).forEach(item => {
item.style.gridColumn = `span ${getComputedStyle(item).getPropertyValue('--col-span')}`;
});
})
}
$(document).ready(function() {
// initialize booking search fields

View File

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

View File

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

View File

@@ -81,8 +81,7 @@
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="10">
<td colspan="12">
{$HOOK_DISPLAY_PDF}
</td>
</tr>

View File

@@ -294,8 +294,7 @@
<div style="line-height: 1pt">&nbsp;</div>
<table style="width: 100%">
<tr>
<td style="width: 15%"></td>
<td style="width: 85%">{$HOOK_DISPLAY_PDF}</td>
<td style="width: 100%">{$HOOK_DISPLAY_PDF}</td>
</tr>
</table>
{/if}

View File

@@ -131,8 +131,7 @@
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="10">
<td colspan="12">
{$HOOK_DISPLAY_PDF}
</td>
</tr>

View File

@@ -81,8 +81,7 @@
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="10">
<td colspan="12">
{$HOOK_DISPLAY_PDF}
</td>
</tr>

View File

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

View File

@@ -103,8 +103,7 @@
</tr>
<tr>
<td colspan="2">&nbsp;</td>
<td colspan="10">
<td colspan="12">
{$HOOK_DISPLAY_PDF}
</td>
</tr>

View File

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

View File

@@ -90,7 +90,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='bankwire'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}

View File

@@ -31,8 +31,8 @@
</button>
<ul class="dropdown-menu" aria-labelledby="user_info_acc">
<li><a href="{$link->getPageLink('my-account', true)|escape:'html'}" title="{l s='View my customer account' mod='blockuserinfo'}">{l s='Accounts' mod='blockuserinfo'}</a></li>
<li><a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='View my orders' mod='blockuserinfo'}">{l s='Orders'}</a></li>
<li><a href="{$link->getPageLink('index', true, NULL, "mylogout")|escape:'html'}" title="{l s='Log me out' mod='blockuserinfo'}">{l s='Logout'}</a></li>
<li><a href="{$link->getPageLink('history', true)|escape:'html'}" title="{l s='View my orders' mod='blockuserinfo'}">{l s='Orders' mod='blockuserinfo'}</a></li>
<li><a href="{$link->getPageLink('index', true, NULL, "mylogout")|escape:'html'}" title="{l s='Log me out' mod='blockuserinfo'}">{l s='Logout' mod='blockuserinfo'}</a></li>
{block name='displayUserNavigationList'}
{hook h='displayUserNavigationList'}
{/block}

View File

@@ -82,7 +82,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='cheque'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}