Merge branch 'origin/develop' into qlo-update-order-status

This commit is contained in:
Shreesh Arora
2023-01-20 18:11:22 +05:30
191 changed files with 12956 additions and 4183 deletions

View File

@@ -50,6 +50,14 @@
}
}
// buttons text align
.btn-left {
text-align: left;
}
.btn-right {
text-align: right;
}
// Alternate buttons
// --------------------------------------------------
@@ -140,8 +148,6 @@
.btn-block {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
// Vertically space out multiple block buttons

View File

@@ -23,7 +23,7 @@
{l s='Cart Details'}
</div>
<div class="row">
<div class="col-lg-12">
<div class="col-lg-12 table-responsive">
<table class="table" id="customer_cart_details_table">
<thead>
<tr>
@@ -31,6 +31,9 @@
<th><span class="title_box">{l s='Room Image'}</th>
<th><span class="title_box">{l s='Room Type'}</span></th>
<th><span class="title_box">{l s='Duration'}</span></th>
{if $occupancy_required_for_booking}
<th><span class="fixed-width-lg title_box">{l s='Occupancy'}</span></th>
{/if}
<th><span class="title_box">{l s='Unit Price (tax excl)'}</span></th>
<th><span class="title_box">{l s='Additinal Facilities (tax excl)'}</span></th>
<th><span class="title_box">{l s='Total Rooms Price (tax excl)'}</span></th>
@@ -42,7 +45,7 @@
{if isset($cart_detail_data) && $cart_detail_data}
{assign var=curr_id value=$cart->id_currency|intval}
{foreach from=$cart_detail_data item=data}
<tr>
<tr data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" >
<td>{$data.room_num|escape:'html':'UTF-8'}</td>
<td><img src="{$data.image_link|escape:'html':'UTF-8'}" title="Room image" /></td>
<td>
@@ -58,13 +61,71 @@
{/if}
</td>
<td>{dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}</td>
{if $occupancy_required_for_booking}
<td>
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
<span>
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl">
<div class="booking_occupancy_inner">
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
<div class="occupancy_info_block selected" occ_block_index="0">
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
<div class="row">
<div class="col-xs-6 occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Adults'}</label>
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
</div>
</div>
<div class="col-xs-6 occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
</div>
</div>
</div>
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
<div class="col-sm-12">
<label class="col-sm-12">{l s='All Children'}</label>
<div class="col-sm-12">
<div class="row children_ages">
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
{for $age=1 to ($max_child_age-1)}
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
{/for}
</select>
</p>
{/foreach}
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
{/if}
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
{if $data.feature_price_diff != 0}
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
{else}
{assign var=shown_room_type_price value=$data.product_price_tax_excl}
{/if}
<input type="text" class="room_unit_price" data-id-booking-data="{$data.id}" data-id-product="{$data.id_product}" data-id-room="{$data.id_room}" data-date-from="{$data.date_from}" data-date-to="{$data.date_to}" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
<input type="text" class="room_unit_price" value="{$shown_room_type_price|escape:'html':'UTF-8'}">
</td>
<td>
{if isset($data.extra_demands) && $data.extra_demands}

View File

@@ -64,7 +64,7 @@
</div>
</center>
</td>
<td style="display:none;" class="text-center" colspan="2">
<td style="display:none;" class="text-center">
<center>
<div class="row">
<div class="input-group fixed-width-xl">
@@ -83,17 +83,66 @@
</div>
</center>
</td>
<td style="display:none;" class="productQuantity text-center">
<center>
<input type="number" class="form-control fixed-width-sm" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" min="1"/>
</center>
<td style="display:none;" class="productQuantity text-center" colspan="2">
{if $order->with_occupancy}
<div class="booking_occupancy">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy disabled" type="button">
<span>{l s='Select occupancy'}</span>
</button>
<input type="hidden" class="max_avail_type_qty" value="">
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
<div class="booking_occupancy_inner">
<input type="hidden" class="max_adults" value="">
<input type="hidden" class="max_children" value="">
<input type="hidden" class="max_guests" value="">
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1'}</label></div>
<div class="col-sm-12">
<div class="row">
<div class="form-group col-xs-6 occupancy_count_block">
<label>{l s='Adults'}</label>
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1">
</div>
<div class="form-group col-xs-6 occupancy_count_block">
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0" {if $max_child_in_room}max="{$max_child_in_room}"{/if}>
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
</div>
</div>
<div class="row children_age_info_block" style="display:none">
<div class="form-group col-sm-12">
<label class="">{l s='All Children'}</label>
<div class="">
<div class="row children_ages">
</div>
</div>
</div>
</div>
</div>
</div>
<hr class="occupancy-info-separator col-sm-12">
</div>
<div class="add_occupancy_block">
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room'}</span></a>
</div>
</div>
</div>
</div>
{else}
<center>
<input type="number" class="form-control fixed-width-sm" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" min="1"/>
</center>
{/if}
</td>
{*{if ($order->hasBeenPaid())}<td style="display:none;" class="productQuantity"></td>{/if}
{if $display_warehouse}<td></td>{/if}
{if ($order->hasBeenDelivered())}<td style="display:none;" class="productQuantity"></td>{/if}
<td style="display:none;" class="productQuantity" id="add_product_product_stock">0</td>*}
<td style="display:none;" id="add_product_product_total" class="text-center">{displayPrice price=0 currency=$currency->id}</td>
<td style="display:none;" colspan="2" class="text-center">
<td style="display:none;" class="text-center">
{if sizeof($invoices_collection)}
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
<optgroup class="existing" label="{l s='Existing'}">

View File

@@ -62,7 +62,7 @@
<div class="fixed-width-xl room_check_in_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check In'}</div>
<input type="text" class="form-control add_product_date_from" name="add_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" readonly/>
<input type="text" class="form-control edit_product_date_from" name="edit_product[date_from]" value="{$data.date_from|date_format:"%d-%m-%Y"}" readonly/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
@@ -70,7 +70,7 @@
<div class="fixed-width-xl room_check_out_div">
<div class="input-group">
<div class="input-group-addon">{l s='Check Out'}</div>
<input type="text" class="form-control add_product_date_to" name="add_product[date_to]" value="{$data.date_to|date_format:"%d-%m-%Y"}" readonly/>
<input type="text" class="form-control edit_product_date_to" name="edit_product[date_to]" value="{$data.date_to|date_format:"%d-%m-%Y"}" readonly/>
<div class="input-group-addon"><i class="icon-calendar"></i></div>
</div>
</div>
@@ -78,6 +78,87 @@
</div>
{/if}
</td>
<td class="text-center">
{if $order->with_occupancy && $data['children']}
<div class="dropdown booking_occupancy_show">
<button class="btn btn-default btn-left btn-block" data-toggle="dropdown" type="button">
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
</button>
<div class="dropdown-menu well well-sm">
<label>{l s='Children Ages'}</label>
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="">
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
</p>
{/foreach}
{/if}
</div>
</div>
{else}
<span class="booking_occupancy_show">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
{/if}
{if $order->with_occupancy}
<div class="booking_occupancy_edit" style="display:none;">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
<span>
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</span>
</button>
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
<div class="booking_occupancy_inner">
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
<div class="occupancy_info_block" occ_block_index="0">
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
<div class="row">
<div class="col-xs-6 occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Adults'}</label>
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
</div>
</div>
<div class="col-xs-6 occupancy_count_block">
<div class="col-sm-12">
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
</div>
</div>
</div>
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
<div class="col-sm-12">
<label class="col-sm-12">{l s='All Children'}</label>
<div class="col-sm-12">
<div class="row children_ages">
{if isset($data['child_ages']) && $data['child_ages']}
{foreach $data['child_ages'] as $childAge}
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
{for $age=1 to ($max_child_age-1)}
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
{/for}
</select>
</p>
{/foreach}
{/if}
</div>
</div>
</div>
</div>
<hr class="occupancy-info-separator">
</div>
</div>
</div>
</div>
</div>
{else}
<span class="booking_occupancy_edit" style="display:none;">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
{/if}
</td>
<td class="text-center">
<span class="room_unit_price_show">

View File

@@ -241,12 +241,13 @@
e.preventDefault();
var cart_row = $(this).closest('tr');
var params = {
id_booking_data: parseInt($(this).attr('data-id-booking-data')),
id_product: parseInt($(this).attr('data-id-product')),
id_room: parseInt($(this).attr('data-id-room')),
date_from: $(this).attr('data-date-from'),
date_to: $(this).attr('data-date-to'),
price: $(this).val(),
id_booking_data: parseInt($(cart_row).attr('data-id-booking-data')),
id_product: parseInt($(cart_row).attr('data-id-product')),
id_room: parseInt($(cart_row).attr('data-id-room')),
date_from: $(cart_row).attr('data-date-from'),
date_to: $(cart_row).attr('data-date-to'),
price: new Number($(this).val().replace(",",".")).toFixed(4).toString(),
id_cart: id_cart
};
updateProductPrice(params, cart_row);
})
@@ -272,6 +273,7 @@
}
});
});
resetBind();
$('#customer').focus();
@@ -332,6 +334,205 @@
$('#search-customer-form-group').show();
$(this).blur();
});
{literal}
$(document).on('click', '.booking_occupancy_wrapper .remove-room-link', function(e) {
e.preventDefault();
booking_occupancy_inner = $(this).closest('.booking_occupancy_inner');
$(this).closest('.occupancy_info_block').remove();
$(booking_occupancy_inner).find('.room_num_wrapper').each(function(key, val) {
$(this).text(room_txt + ' - '+ (key+1) );
});
setRoomTypeGuestOccupancy($(booking_occupancy_inner).closest('.booking_occupancy_wrapper'));
});
$(document).on('change', '.num_occupancy', function(e) {
let current_room_occupancy = 0;
$(this).closest('.occupancy_info_block').find('.num_occupancy').each(function(){
current_room_occupancy += parseInt($(this).val());
});
let max_guests_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_guests').val();
let max_allowed_for_current = (max_guests_in_room - current_room_occupancy) + parseInt($(this).val());
if ($(this).val() > $(this).attr('max')) {
$(this).val($(this).attr('max'));
}
if ($(this).val() > max_allowed_for_current) {
$(this).val(max_allowed_for_current);
}
if ($(this).hasClass('num_children')) {
var totalChilds = $(this).closest('.occupancy_info_block').find('.guest_child_age').length;
if (totalChilds < $(this).val()) {
if (totalChilds < max_child_in_room) {
$(this).closest('.occupancy_info_block').find('.children_age_info_block').show();
while ($(this).closest('.occupancy_info_block').find('.guest_child_age').length < $(this).val()) {
var roomBlockIndex = parseInt($(this).closest('.occupancy_info_block').attr('occ_block_index'));
var childAgeSelect = '<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">';
childAgeSelect += '<select class="guest_child_age room_occupancies" name="occupancy[' +roomBlockIndex+ '][child_ages][]">';
childAgeSelect += '<option value="-1">' + select_age_txt + '</option>';
childAgeSelect += '<option value="0">' + under_1_age + '</option>';
for (let age = 1; age < max_child_age; age++) {
childAgeSelect += '<option value="'+age+'">'+age+'</option>';
}
childAgeSelect += '</select>';
childAgeSelect += '</p>';
$(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect);
}
}
} else {
let child = $(this).val();
$(this).closest('.occupancy_info_block').find('.guest_child_age').each(function(ind, element) {
if (child <= ind) {
$(element).parent().remove();
}
});
if (child == 0) {
$(this).closest('.occupancy_info_block').find('.children_age_info_block').hide();
}
}
}
setRoomTypeGuestOccupancy($(this).closest('.booking_occupancy_wrapper'));
});
$(document).on('click', '.booking_guest_occupancy', function(e) {
$(this).parent().toggleClass('open');
});
$(document).on('click', function(e) {
if ($('.booking_occupancy_wrapper:visible').length) {
var occupancy_wrapper = $('.booking_occupancy_wrapper:visible');
$(occupancy_wrapper).find(".occupancy_info_block").addClass('selected');
if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length)) {
let hasErrors = 0;
let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get();
let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get();
let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get();
// start validating above values
if (!adults.length || (adults.length != children.length)) {
hasErrors = 1;
showErrorMessage(invalid_occupancy_txt);
} else {
$(occupancy_wrapper).find('.occupancy_count').removeClass('error_border');
// validate values of adults and children
adults.forEach(function (item, index) {
if (isNaN(item) || parseInt(item) < 1) {
hasErrors = 1;
$(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border');
}
if (isNaN(children[index])) {
hasErrors = 1;
$(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border');
}
});
// validate values of selected child ages
$(occupancy_wrapper).find('.guest_child_age').parent().removeClass('has-error');
child_ages.forEach(function (age, index) {
age = parseInt(age);
if (isNaN(age) || (age < 0) || (age >= parseInt(max_child_age))) {
hasErrors = 1;
$(occupancy_wrapper).find(".guest_child_age").eq(index).parent().addClass('has-error');
}
});
}
if (hasErrors == 0) {
$(occupancy_wrapper).parent().removeClass('open');
$(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]);
}
}
}
});
$(document).on('QloApps:updateRoomOccupancy', function (e, occupancy_wrapper) {
e.preventDefault();
let cart_row = $(occupancy_wrapper).closest('tr');
let occupancy = getBookingOccupancyDetails(cart_row);
let params = {
id_cart: id_cart,
id_booking_data: parseInt($(cart_row).attr('data-id-booking-data')),
occupancy : occupancy.shift(),
};
updateRoomOccupancy(params, cart_row);
});
function getBookingOccupancyDetails(bookingform)
{
let occupancy = [];
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
if (selected_occupancy.length) {
$(selected_occupancy).each(function(ind, element) {
if (parseInt($(element).find('.num_adults').val())) {
let child_ages = [];
$(element).find('.guest_child_age').each(function(index) {
if ($(this).val() > -1) {
child_ages.push($(this).val());
}
});
if ($(element).find('.num_children').val()) {
if (child_ages.length != $(element).find('.num_children').val()) {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open');
}
}
occupancy.push({
'adults': $(element).find('.num_adults').val(),
'children': $(element).find('.num_children').val(),
'child_ages': child_ages
});
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open');
}
});
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open');
}
return occupancy;
}
function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
{
var adults = 0;
var children = 0;
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
adults += parseInt($(this).val());
});
$(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) {
children += parseInt($(this).val());
});
var guestButtonVal = parseInt(adults) + ' ';
if (parseInt(adults) > 1) {
guestButtonVal += adults_txt;
} else {
guestButtonVal += adult_txt;
}
if (parseInt(children) > 0) {
if (parseInt(children) > 1) {
guestButtonVal += ', ' + parseInt(children) + ' ' + children_txt;
} else {
guestButtonVal += ', ' + parseInt(children) + ' ' + child_txt;
}
}
// if (parseInt(rooms) > 1) {
// guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
// } else {
// guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt;
// }
// console.log($(booking_occupancy_wrapper).siblings('.booking_guest_occupancy > span'));
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
}
{/literal}
});
function resetBind()
@@ -389,12 +590,8 @@
});
}
function updateProductPrice(params, cart_row) {
$.extend(params, {
id_cart: id_cart,
price: new Number(params.price.replace(",",".")).toFixed(4).toString(),
});
function updateProductPrice(params, cart_row)
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
@@ -414,6 +611,29 @@
});
}
function updateRoomOccupancy(params, cart_row)
{
debugger;
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "JSON",
data: {
ajax: "1",
token: "{getAdminToken tab='AdminCarts'}",
tab: "AdminCarts",
action: "updateRoomOccupancy",
params: params,
},
success : function(response) {
updateCartLine(response.curr_booking_info, cart_row);
updateCartSummaryData(response.cart_info);
}
});
}
function updateCartLine(data, cart_row) {
$(cart_row).find('.cart_line_total_rooms_price').html(data.amt_with_qty);
$(cart_row).find('.cart_line_total_price').html(data.total_price);
@@ -1807,6 +2027,23 @@
</div>
</div>
</form>
{strip}
{addJsDef max_child_age=$max_child_age}
{addJsDef max_child_in_room=$max_child_in_room}
{addJsDefL name='select_age_txt'}{l s='Select age' js=1}{/addJsDefL}
{addJsDefL name='under_1_age'}{l s='Under 1' js=1}{/addJsDefL}
{addJsDefL name='room_txt'}{l s='Room' js=1}{/addJsDefL}
{addJsDefL name='rooms_txt'}{l s='Rooms' js=1}{/addJsDefL}
{addJsDefL name='remove_txt'}{l s='Remove' js=1}{/addJsDefL}
{addJsDefL name='adult_txt'}{l s='Adult' js=1}{/addJsDefL}
{addJsDefL name='adults_txt'}{l s='Adults' js=1}{/addJsDefL}
{addJsDefL name='child_txt'}{l s='Child' js=1}{/addJsDefL}
{addJsDefL name='children_txt'}{l s='Children' js=1}{/addJsDefL}
{addJsDefL name='below_txt'}{l s='Below' js=1}{/addJsDefL}
{addJsDefL name='years_txt'}{l s='years' js=1}{/addJsDefL}
{addJsDefL name='all_children_txt'}{l s='All Children' js=1}{/addJsDefL}
{addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' js=1}{/addJsDefL}
{/strip}
<div id="loader_container">
<div id="loader"></div>

View File

@@ -1058,6 +1058,64 @@
</form>
</div>
</div>
{if is_array($returns) && count($returns)}
<div class="panel">
<div class="panel-heading">
<i class="icon-undo"></i> {l s='Refunds'}
</div>
<table class="table table-striped">
<thead>
<tr>
<th class="text-left">{l s='Refund ID'}</th>
<th class="text-left">{l s='Status'}</th>
</tr>
</thead>
<tbody>
{foreach from=$returns item=return_info}
<tr>
<td class="text-left">
<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$return_info.id_order_return}" target="_blank">#{$return_info.id_order_return}</a>
</td>
<td class="text-left">
{capture name=refund_status}
{if isset($return_info.payment_mode) && $return_info.payment_mode != ''}{l s='Payment Mode: '}{$return_info.payment_mode}<br/>{/if}
{if isset($return_info.id_transaction) && $return_info.id_transaction != ''}{l s='Transaction ID: '}{$return_info.id_transaction}<br/>{/if}
{if isset($return_info.id_return_type) && isset($return_info.return_type) && $return_info.id_return_type && $return_info.return_type}
{if $return_info.return_type == OrderReturn::RETURN_TYPE_CART_RULE}
{l s='Voucher ID: '}
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$return_info.id_return_type}" target="_blank">
#{$return_info.id_return_type}
</a>
{elseif $return_info.return_type == OrderReturn::RETURN_TYPE_ORDER_SLIP}
{l s='Credit Slip ID: '}
#{$return_info.id_return_type}
<a href="{$link->getAdminLink('AdminPdf')}&submitAction=generateOrderSlipPDF&id_order_slip={$return_info.id_return_type}" title="#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{$return_info.id_return_type|string_format:'%06d'}">
{l s='Download' mod='hotelreservationsystem'}
</a>
{/if}
<br/>
{/if}
{if isset($return_info.id_cart_rule) && $return_info.id_cart_rule}
{l s='Voucher ID: '}
<a href="{$link->getAdminLink('AdminCartRules')}&updatecart_rule&id_cart_rule={$return_info.id_cart_rule}" target="_blank">
#{$return_info.id_cart_rule}
</a>
<br/>
{/if}
{/capture}
{if $smarty.capture.refund_status|trim != ''}
{$smarty.capture.refund_status}
{else}
{$return_info.state_name}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{hook h="displayAdminOrderRight" id_order=$order->id}
</div>
</div>
@@ -1070,7 +1128,7 @@
<input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
</div>
<div class="panel">
<div class="panel" id="refundForm">
<div class="panel-heading">
<i class="icon-shopping-cart"></i>
{l s='Rooms In This Order'} <span class="badge">{$order_detail_data|@count}</span>
@@ -1090,6 +1148,7 @@
<th class="text-center"><span class="title_box">{l s='Room Type'}</span></th>
<th class="text-center"><span class="title_box">{l s='Hotel Name'}</span></th>
<th class="text-center"><span class="title_box">{l s='Duration'}</span></th>
<th class="text-center fixed-width-lg"><span class="title_box">{l s='Occupancy'}</span></th>
<th class="text-center"><span class="title_box">{l s='Unit Price (Tax excl.)'}</span></th>
<th class="text-center"><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
{if isset($refundReqBookings) && $refundReqBookings}
@@ -1149,9 +1208,14 @@
</button>
{if $refund_allowed && !$hasCompletelyRefunded}
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-success standard_refund_fields pull-right" id="initiateRefund">
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Cancel bookings'}{/if}
</button>
<div class="pull-right">
<button style="display: none;" type="button" class="btn btn-default standard_refund_fields" id="cancelRefund">
{l s='Cancel'}
</button>
<button style="display: none;" type="submit" name="initiateRefund" class="btn btn-success standard_refund_fields" id="initiateRefund">
{if $order->hasBeenPaid()}<i class="icon-undo"></i> {l s='Initiate Refund'}{else}{l s='Submit'}{/if}
</button>
</div>
{/if}
</div>
{/if}
@@ -1521,6 +1585,21 @@
{addJsDefL name=txtSomeErr}{l s='Some error occurred. Please try again.' js=1}{/addJsDefL}
{addJsDefL name=txtDeleteSucc}{l s='Deleted successfully' js=1}{/addJsDefL}
{addJsDefL name=txtInvalidDemandVal}{l s='Invalid demand value found' js=1}{/addJsDefL}
{addJsDefL name='select_age_txt'}{l s='Select age' js=1}{/addJsDefL}
{addJsDefL name='under_1_age'}{l s='Under 1' js=1}{/addJsDefL}
{addJsDefL name='room_txt'}{l s='Room' js=1}{/addJsDefL}
{addJsDefL name='rooms_txt'}{l s='Rooms' js=1}{/addJsDefL}
{addJsDefL name='remove_txt'}{l s='Remove' js=1}{/addJsDefL}
{addJsDefL name='adult_txt'}{l s='Adult' js=1}{/addJsDefL}
{addJsDefL name='adults_txt'}{l s='Adults' js=1}{/addJsDefL}
{addJsDefL name='child_txt'}{l s='Child' js=1}{/addJsDefL}
{addJsDefL name='children_txt'}{l s='Children' js=1}{/addJsDefL}
{addJsDefL name='below_txt'}{l s='Below' js=1}{/addJsDefL}
{addJsDefL name='years_txt'}{l s='years' js=1}{/addJsDefL}
{addJsDefL name='all_children_txt'}{l s='All Children' js=1}{/addJsDefL}
{addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' js=1}{/addJsDefL}
{addJsDef max_child_age=$max_child_age|escape:'quotes':'UTF-8'}
{addJsDef max_child_in_room=$max_child_in_room|escape:'quotes':'UTF-8'}
{/strip}
{* Apply javascript for the page *}

View File

@@ -0,0 +1,115 @@
{**
* 2010-2022 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}
{if isset($product->id) && $product->id}
<input type="hidden" name="submitted_tabs[]" value="AdditionalFacilities" />
<div class="panel">
<div class="panel-heading">
<i class="icon-user"></i> {l s='Room Type Additional Facilities'}
</div>
<div class="alert alert-info">
{l s='To create new Additiona facilities '} <a target="_blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')}">{l s='click here.'}</a>
</div>
{if isset($allDemands) && $allDemands}
<div class="panel-group">
{foreach $allDemands as $key => $demand}
<div class="panel panel-sm">
<input class="selected_demand" type="checkbox" name="selected_demand[]" value="{$demand['id_global_demand']|escape:'html':'UTF-8'}" {if isset($roomDemandPrices[$demand['id_global_demand']])}checked{/if} />
<a href="#" onclick="$('#panel-demands-{$key|escape:'html':'UTF-8'}').slideToggle(250); return false;">
{$demand['name']|escape:'html':'UTF-8'}
</a>
<div class="panel-body collapse" id="panel-demands-{$key|escape:'html':'UTF-8'}">
{if isset($demand['adv_option']) && count($demand['adv_option'])}
<input type="hidden" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
value="{if isset($roomDemandPrices[$demand['id_global_demand']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
{else}
<div class="form-group">
<label class="col-sm-3 control-label required" >
{l s='Price'}({l s='tax excl.'})
</label>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<input type="text" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
value="{if isset($roomDemandPrices[$demand['id_global_demand']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
</div>
</div>
</div>
{/if}
{if isset($demand['adv_option']) && $demand['adv_option']}
<div class="adv_options_dtl form-group">
<label class="col-sm-3 control-label">
{l s='Advance options'}
</label>
<div class="col-sm-9">
<div class="table-responsive-row clearfix">
<table class="table table-bordered adv_option_table">
<thead>
<tr>
<th>
<span>{l s='Option Name'}</span>
</th>
<th>
<span>{l s='Price'}</span>
</th>
</tr>
</thead>
{foreach from=$demand['adv_option'] key=key item=info}
<tr>
<td>
{$info['name']|escape:'html':'UTF-8'}
</td>
<td>
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<input type="text" name="option_price_{$info['id']|escape:'html':'UTF-8'}" value="{if isset($roomDemandPrices[$demand['id_global_demand']]['adv_option'][$info['id']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['adv_option'][$info['id']]['price']|escape:'html':'UTF-8'}{else}{$info['price']|escape:'html':'UTF-8'}{/if}"/>
</div>
</td>
</tr>
{/foreach}
</table>
</div>
</div>
</div>
{/if}
</div>
</div>
{/foreach}
</div>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&amp;submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">
<i class="process-icon-cancel"></i>
{l s='Cancel'}
</a>
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right" disabled="disabled">
<i class="process-icon-loading"></i>
{l s='Save'}
</button>
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled">
<i class="process-icon-loading"></i>
{l s='Save and stay'}
</button>
</div>
{else}
<div class="alert alert-warning">
{l s='No additional facilities created yet. To create please visit'} <a target="_blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')}">{l s='Additional facilities'}</a> {l s='page'}.
</div>
{/if}
</div>
{/if}

View File

@@ -24,27 +24,25 @@
<h3 class="tab"> <i class="icon-users"></i> {l s='Occupancy'}</h3>
<div class="alert alert-info">
{l s='Set the occupancy of this room type. Enter how much adults and children this room type can accomodate.'}
<br /><br />
<b>{l s='Note'} : {l s='These occupancy settings will not affect "ROOM TYPE ADDITIONAL FACILITIES" any way. It will work separately.'}</b>
{l s='Below, enter the base occupancy of this room type.'}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="base_adults">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s=''}">
{l s='Adults'}
{l s='Base adults'}
</span>
</label>
<div class="col-sm-3">
<input id="base_adults" type="text" name="base_adults" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['adult']|escape:'htmlall':'UTF-8'}"{/if}>
<input id="base_adults" type="text" name="base_adults" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['adults']|escape:'htmlall':'UTF-8'}"{/if}>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="base_children">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s=''}">
{l s='Children'}
{l s='Base children'}
</span>
</label>
<div class="col-sm-3">
@@ -53,6 +51,46 @@
</div>
<input id="is_occupancy_submit" type="hidden" name="is_occupancy_submit" class="form-control" value="0">
<hr>
<div class="alert alert-info">
{l s='Below, enter the maximum of adults or children which can be accommodated in a room of this room type. Also, enter maximum number of guests for this room type.'}
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="max_adults">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Enter maximum number of adults can be accommodated in a room of this room type.'}">
{l s='Maximum adults'}
</span>
</label>
<div class="col-sm-3">
<input id="max_adults" type="text" name="max_adults" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_adults']|escape:'htmlall':'UTF-8'}"{/if}>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="max_children">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Enter maximum number of children can be accommodated in a room of this room type.'}">
{l s='Maximum children'}
</span>
</label>
<div class="col-sm-3">
<input id="max_children" type="text" name="max_children" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_children']|escape:'htmlall':'UTF-8'}"{/if}>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="max_guests">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Enter maximum number of guests can be accommodated in a room of this room type.'}">
{l s='Maximum room occupancy'}
</span>
</label>
<div class="col-sm-3">
<input id="max_guests" type="text" name="max_guests" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_guests']|escape:'htmlall':'UTF-8'}"{/if}>
</div>
</div>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&amp;submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">
<i class="process-icon-cancel"></i>

View File

@@ -0,0 +1,22 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}
<a class="btn btn-link" href="{$link->getAdminLink('AdminCartRules')|escape:'html':'UTF-8'}&updatecart_rule&id_cart_rule={$id_cart_rule}" target="_blank">
#{$id_cart_rule}
</a>

View File

@@ -0,0 +1,24 @@
{**
* 2010-2022 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}
{if $redeem_status == OrderSlip::REDEEM_STATUS_REDEEMED}
<span class="badge badge-danger">{l s='Redeemed'}</span>
{else}
<span class="badge badge-success">{l s='Active'}</span>
{/if}

View File

@@ -0,0 +1,23 @@
{**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*}
<a href="{$status_change_link|escape:'html':'UTF-8'}" title="{l s='Change Status'}">
<i class="icon-refresh"></i>
{l s='Change Status'}
</a>

View File

@@ -26,6 +26,7 @@
{if $refresh}
<div class="kpi-refresh"><button class="close refresh" type="button" onclick="refresh_kpis();"><i class="process-icon-refresh" style="font-size:1em"></i></button></div>
{/if}
{if ($kpis|count) > 0}
<div class="row">
{assign var='col' value=(int)(12 / $kpis|count)}
{foreach from=$kpis item=i name=kpi}
@@ -36,4 +37,5 @@
<div class="col-sm-6 col-lg-{$col}">{$i}</div>
{/foreach}
</div>
{/if}
</div>

View File

@@ -1731,6 +1731,7 @@ class CartCore extends ObjectModel
$order_total_discount = 0;
$order_shipping_discount = 0;
$advance_payment_products_discount = 0;
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS, Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS)) && CartRule::isFeatureActive()) {
// First, retrieve the cart rules associated to this "getOrderTotal"
if ($with_shipping || $type == Cart::ONLY_DISCOUNTS) {
@@ -1787,10 +1788,28 @@ class CartCore extends ObjectModel
// If the cart rule offers a reduction, the amount is prorated (with the products in the package)
if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0) {
$order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache), $compute_precision);
if ($type == Cart::ADVANCE_PAYMENT) {
$advance_payment_products_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache, true), $compute_precision);
}
}
}
$order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount;
$order_total -= $order_total_discount;
if ($type == Cart::ADVANCE_PAYMENT) {
// get order total without discount
$total_without_discount = $this->getOrderTotal() + $order_total_discount;
// to find due amount substract advance payment without discuount from order total without discount
// Due Amount = order total - advance payment (without discount)
$due_amount = $total_without_discount - $order_total;
// if discount for advance payment products is greater than due amount then only decrease the price of advance payment amount
// otherwise discount will be applied on due amount not advance payment amount
if ($advance_payment_products_discount > $due_amount) {
$order_total -= ($advance_payment_products_discount - $due_amount);
}
$order_total -= $order_total_discount - $advance_payment_products_discount;
} else {
$order_total -= $order_total_discount;
}
}
if ($type == Cart::BOTH || $type == Cart::ADVANCE_PAYMENT) {
@@ -4370,7 +4389,7 @@ class CartCore extends ObjectModel
// lets validate the cart booking data first
if (isset($bookingRows) && count($bookingRows)) {
$objRoomType = new HotelRoomType();
$objBookingDtl = new HotelBookingDetail();
$objBookingDetail = new HotelBookingDetail();
$errors = array();
$idCustomer = $objCart->id_customer;
$idCurrency = $objCart->id_currency;
@@ -4412,24 +4431,20 @@ class CartCore extends ObjectModel
}
if (!count($errors)) {
$numDays = $objBookingDtl->getNumberOfDays($dateFrom, $dateTo);
$numDays = $objBookingDetail->getNumberOfDays($dateFrom, $dateTo);
$prodQty = $prodQty * (int) $numDays;
$reqRooms = 1;
if ($hotelRoomData = $objBookingDtl->DataForFrontSearch(
$dateFrom,
$dateTo,
$idHotel,
$idProduct,
1,
0,
0,
-1,
0,
0,
$idCart,
$idGuest
)) {
$bookingParams = array(
'date_from' => $dateFrom,
'date_to' => $dateTo,
'hotel_id' => $idHotel,
'id_room_type' => $idProduct,
'only_search_data' => 1,
'id_cart' => $idCart,
'id_guest' => $idGuest,
);
if ($hotelRoomData = $objBookingDetail->dataForFrontSearch($bookingParams)) {
if (isset($hotelRoomData['stats']['num_avail'])) {
$totalAvailRooms = $hotelRoomData['stats']['num_avail'];
if ($totalAvailRooms < $reqRooms) {
@@ -4470,7 +4485,7 @@ class CartCore extends ObjectModel
if (!$hasErrors) {
$update_quantity = $objCart->updateQty($prodQty, $idProduct, 0, 0, Tools::getValue('op', 'up'), $this->id_address_delivery);
$chkQty = 0;
if ($hotelAvailRomms = $hotelRoomData['rm_data'][0]['data']['available']) {
if ($hotelAvailRomms = $hotelRoomData['rm_data'][$idProduct]['data']['available']) {
foreach ($hotelAvailRomms as $key_hotel_room_info => $val_hotel_room_info) {
if ($chkQty < $reqRooms) {
$objCartBooking = new HotelCartBookingData();

View File

@@ -875,9 +875,10 @@ class CartRuleCore extends ObjectModel
* @param bool $use_tax
* @param Context $context
* @param bool $use_cache Allow using cache to avoid multiple free gift using multishipping
* @param bool $only_advance_payment_products to calculate discount applied only on products that have advance payment
* @return float|int|string
*/
public function getContextualValue($use_tax, Context $context = null, $filter = null, $package = null, $use_cache = true)
public function getContextualValue($use_tax, Context $context = null, $filter = null, $package = null, $use_cache = true, $only_advance_payment_products = false)
{
if (!CartRule::isFeatureActive()) {
return 0;
@@ -890,15 +891,34 @@ class CartRuleCore extends ObjectModel
}
$all_products = $context->cart->getProducts();
$package_products = (is_null($package) ? $all_products : $package['products']);
if (is_null($package)) {
$package = array(
'products' => $all_products,
'id_carrier' => null,
'id_address' => 0
);
}
$reduction_value = 0;
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter;
foreach ($package_products as $product) {
$objHotelAdvancePayment = new HotelAdvancedPayment();
$cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter.'_'.(int)$only_advance_payment_products;
foreach ($package['products'] as $key => $product) {
if ($only_advance_payment_products) {
if ($advancePaymentInfo = $objHotelAdvancePayment->getIdAdvPaymentByIdProduct($product['id_product'])) {
if (!$advancePaymentInfo['active']) {
unset($package['products'][$key]);
continue;
}
} else {
unset($package['products'][$key]);
continue;
}
}
$cache_id .= '_'.(int)$product['id_product'].'_'.(int)$product['id_product_attribute'].(isset($product['in_stock']) ? '_'.(int)$product['in_stock'] : '');
}
$package_products = $package['products'];
if (Cache::isStored($cache_id)) {
return Cache::retrieve($cache_id);
}
@@ -1001,7 +1021,7 @@ class CartRuleCore extends ObjectModel
$reduction_value += $selected_products_reduction * $this->reduction_percent / 100;
}
// Discount (¤)
// Discount (by amount)
if ((float)$this->reduction_amount > 0) {
$prorata = 1;
if (!is_null($package) && count($all_products)) {
@@ -1011,7 +1031,31 @@ class CartRuleCore extends ObjectModel
}
}
$restricted_product = null;
$reduction_amount = $this->reduction_amount;
// If the cart rule is restricted to one room type it can't exceed this room type price
if ($this->reduction_product > 0) {
foreach ($package_products as $product) {
if ($product['id_product'] == $this->reduction_product) {
$restricted_product = $product;
$prorata = 1; // do not split this cart rule
if ($this->reduction_tax) {
$max_reduction_amount = (int) $restricted_product['cart_quantity'] * (float) $restricted_product['price_wt'];
} else {
$max_reduction_amount = (int) $restricted_product['cart_quantity'] * (float) $restricted_product['price'];
}
$reduction_amount = min($reduction_amount, $max_reduction_amount);
break;
}
}
}
if (($this->reduction_product > 0) && !$restricted_product) {
$reduction_amount = 0;
}
// If we need to convert the voucher value to the cart currency
if (isset($context->currency) && $this->reduction_currency != $context->currency->id) {
$voucherCurrency = new Currency($this->reduction_currency);
@@ -1058,7 +1102,7 @@ class CartRuleCore extends ObjectModel
}
}
}
// Discount (¤) on the whole order
// Discount (by amount) on the whole order
elseif ($this->reduction_product == 0) {
$cart_amount_te = null;
$cart_amount_ti = null;

View File

@@ -26,6 +26,25 @@
class CookieCore
{
const SAMESITE_NONE = 'None';
const SAMESITE_LAX = 'Lax';
const SAMESITE_STRICT = 'Strict';
const SAMESITE_AVAILABLE_VALUES = array(
array(
"type" => self::SAMESITE_NONE,
"name" => self::SAMESITE_NONE
),
array(
"type" => self::SAMESITE_LAX,
"name" => self::SAMESITE_LAX
),
array(
"type" => self::SAMESITE_STRICT,
"name" => self::SAMESITE_STRICT
),
);
/** @var array Contain cookie content in a key => value format */
protected $_content;
@@ -73,6 +92,7 @@ class CookieCore
$this->_path = str_replace('%2F', '/', $this->_path);
$this->_path = str_replace('%7E', '~', $this->_path);
$this->_domain = $this->getDomain($shared_urls);
$this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE');
$this->_name = 'PrestaShop-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
$this->_allow_writing = true;
$this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
@@ -82,7 +102,7 @@ class CookieCore
} else {
$this->_cipherTool = new PhpEncryption(_NEW_COOKIE_KEY_);
}
$this->_secure = (bool)$secure;
$this->update();
@@ -342,11 +362,35 @@ class CookieCore
$content = 0;
$time = 1;
}
if (PHP_VERSION_ID <= 50200) { /* PHP version > 5.2.0 */
return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, $this->_secure);
} else {
return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, $this->_secure, true);
/*
* The alternative signature supporting an options array is only available since
* PHP 7.3.0, before there is no support for SameSite attribute.
*/
if (PHP_VERSION_ID < 70300) {
return setcookie(
$this->_name,
$content,
$time,
$this->_path,
$this->_domain . '; SameSite=' . $this->_sameSite,
$this->_secure,
true
);
}
return setcookie(
$this->_name,
$content,
[
'expires' => $time,
'path' => $this->_path,
'domain' => $this->_domain,
'secure' => $this->_secure,
'httponly' => true,
'samesite' => $this->_sameSite,
]
);
}
public function __destruct()

View File

@@ -356,6 +356,20 @@ abstract class PaymentModuleCore extends Module
PrestaShopLogger::addLog('PaymentModule::validateOrder - Order is about to be added', 1, null, 'Cart', (int)$id_cart, true);
}
if ($this->name == 'wsorder') {
$order->with_occupancy = 0;
} else {
if (defined('_PS_ADMIN_DIR_')) {
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$order->with_occupancy = 1;
}
} else {
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$order->with_occupancy = 1;
}
}
}
// advance payment information
$order->is_advance_payment = $this->context->cart->is_advance_payment;
if ($order->is_advance_payment) {
@@ -585,9 +599,11 @@ abstract class PaymentModuleCore extends Module
}
$cart_rules_list = array();
$total_reduction_value_ti = 0;
$total_reduction_value_tex = 0;
foreach ($cart_rules as $cart_rule) {
if ($cart_rule['obj']->reduction_product > 0 && !$order->orderContainProduct($cart_rule['obj']->reduction_product)) {
continue;
}
$package = array('id_carrier' => $order->id_carrier, 'id_address' => $order->id_address_delivery, 'products' => $order->product_list);
$values = array(
'tax_incl' => $cart_rule['obj']->getContextualValue(true, $this->context, CartRule::FILTER_ACTION_ALL_NOCAP, $package),
@@ -600,13 +616,25 @@ abstract class PaymentModuleCore extends Module
}
// IF
// This is not multi-shipping
// The value of the voucher is greater than the total of the order
// Partial use is allowed
// This is an "amount" reduction, not a reduction in % or a gift
// THEN
// The voucher is cloned with a new value corresponding to the remainder
if (count($order_list) == 1 && $values['tax_incl'] > ($order->total_products_wt - $total_reduction_value_ti) && $cart_rule['obj']->partial_use == 1 && $cart_rule['obj']->reduction_amount > 0) {
$reduction_amount_converted = $cart_rule['obj']->reduction_amount;
if ((int) $cart_rule['obj']->reduction_currency !== (int) $cart->id_currency) {
$reduction_amount_converted = Tools::convertPriceFull(
$cart_rule['obj']->reduction_amount,
new Currency($cart_rule['obj']->reduction_currency),
new Currency($cart->id_currency)
);
}
if ($cart_rule['obj']->reduction_tax) {
$remaining_amount = $reduction_amount_converted - $values['tax_incl'];
} else {
$remaining_amount = $reduction_amount_converted - $values['tax_excl'];
}
if ($remaining_amount > 0 && $cart_rule['obj']->partial_use == 1 && $reduction_amount_converted > 0) {
// Create a new voucher from the original
$voucher = new CartRule((int)$cart_rule['obj']->id); // We need to instantiate the CartRule without lang parameter to allow saving it
unset($voucher->id);
@@ -618,16 +646,13 @@ abstract class PaymentModuleCore extends Module
}
// Set the new voucher value
$voucher->reduction_amount = $remaining_amount;
if ($voucher->reduction_tax) {
$voucher->reduction_amount = ($total_reduction_value_ti + $values['tax_incl']) - $order->total_products_wt;
// Add total shipping amout only if reduction amount > total shipping
if ($voucher->free_shipping == 1 && $voucher->reduction_amount >= $order->total_shipping_tax_incl) {
$voucher->reduction_amount -= $order->total_shipping_tax_incl;
}
} else {
$voucher->reduction_amount = ($total_reduction_value_tex + $values['tax_excl']) - $order->total_products;
// Add total shipping amout only if reduction amount > total shipping
if ($voucher->free_shipping == 1 && $voucher->reduction_amount >= $order->total_shipping_tax_excl) {
$voucher->reduction_amount -= $order->total_shipping_tax_excl;
@@ -669,12 +694,7 @@ abstract class PaymentModuleCore extends Module
null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop
);
}
$values['tax_incl'] = $order->total_products_wt - $total_reduction_value_ti;
$values['tax_excl'] = $order->total_products - $total_reduction_value_tex;
}
$total_reduction_value_ti += $values['tax_incl'];
$total_reduction_value_tex += $values['tax_excl'];
$order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping);
@@ -781,6 +801,9 @@ abstract class PaymentModuleCore extends Module
$objBookingDetail->date_to = $objCartBookingData->date_to;
$objBookingDetail->total_price_tax_excl = Tools::ps_round($total_price['total_price_tax_excl'], 6);
$objBookingDetail->total_price_tax_incl = Tools::ps_round($total_price['total_price_tax_incl'], 6);
$objBookingDetail->adults = $objCartBookingData->adults;
$objBookingDetail->children = $objCartBookingData->children;
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
// Save hotel information/location/contact
if (Validate::isLoadedObject($objRoom = new HotelRoomInformation($objCartBookingData->id_room))) {
@@ -803,10 +826,6 @@ abstract class PaymentModuleCore extends Module
$objBookingDetail->phone = $hotelAddress['phone'];
}
}
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
$objBookingDetail->adult = $roomTypeInfo['adult'];
$objBookingDetail->children = $roomTypeInfo['children'];
}
/*for saving details of the advance payment product wise*/
$objBookingDetail->total_paid_amount = Tools::ps_round($total_price['total_price_tax_incl'], 5);
@@ -890,14 +909,6 @@ abstract class PaymentModuleCore extends Module
// delete cart feature prices after booking creation success
HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart);
if (isset($_COOKIE['wk_id_cart'])) {
setcookie('wk_id_cart', ' ', time() - 86400, '/');
setcookie('wk_id_guest', ' ', time() - 86400, '/');
unset($_COOKIE['wk_id_cart']);
unset($_COOKIE['wk_id_guest']);
}
if (self::DEBUG_MODE) {
PrestaShopLogger::addLog('PaymentModule::validateOrder - Hook validateOrder is about to be called', 1, null, 'Cart', (int)$id_cart, true);
}
@@ -1431,8 +1442,6 @@ abstract class PaymentModuleCore extends Module
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
$cart_htl_data[$type_key]['name'] = $product->name;
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
$cart_htl_data[$type_key]['adult'] = $rm_dtl['adult'];
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
foreach ($cart_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
@@ -1442,6 +1451,9 @@ abstract class PaymentModuleCore extends Module
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
$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_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
@@ -1481,6 +1493,8 @@ abstract class PaymentModuleCore extends Module
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$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_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];

View File

@@ -218,7 +218,8 @@ class PrestaShopBackupCore
$this->id = realpath($backupfile);
fwrite($fp, '/* Backup for '.Tools::getHttpHost(false, false).__PS_BASE_URI__."\n * at ".date($date)."\n */\n");
fwrite($fp, "\n".'SET NAMES \'utf8\';'."\n\n");
fwrite($fp, "\n".'SET NAMES \'utf8\';');
fwrite($fp, "\n".'SET SQL_MODE=\'ALLOW_INVALID_DATES\';'."\n\n");
// Find all tables
$tables = Db::getInstance()->executeS('SHOW TABLES');

View File

@@ -5623,7 +5623,7 @@ class ProductCore extends ObjectModel
WHERE `id_product` = '.(int)$this->id
);
// save room type info adult, child, hotel info
// save room type info adults, child, hotel info
$postData = trim(file_get_contents('php://input'));
libxml_use_internal_errors(true);
$xml = simplexml_load_string(utf8_decode($postData));
@@ -5631,7 +5631,7 @@ class ProductCore extends ObjectModel
$roomtypeData = json_decode(json_encode($xml), true);
// set room map info for the hotel from request
return Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'htl_room_type` (`id_product`, `id_hotel`, `adult`, `children`, `date_add`, `date_upd`) VALUES ('.(int)$this->id.', '.(int) $roomtypeData['room_type']['id_hotel'].', '.(int) $roomtypeData['room_type']['adults'].', '.(int) $roomtypeData['room_type']['children'].', \''.date('Y-m-d h:i:s').'\', \''.date('Y-m-d h:i:s').'\')');
return Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'htl_room_type` (`id_product`, `id_hotel`, `adults`, `children`, `date_add`, `date_upd`) VALUES ('.(int)$this->id.', '.(int) $roomtypeData['room_type']['id_hotel'].', '.(int) $roomtypeData['room_type']['adults'].', '.(int) $roomtypeData['room_type']['children'].', \''.date('Y-m-d h:i:s').'\', \''.date('Y-m-d h:i:s').'\')');
}
return true;
@@ -6060,7 +6060,7 @@ class ProductCore extends ObjectModel
public function getWsAdults()
{
return Db::getInstance()->getValue(
'SELECT `adult` FROM `'._DB_PREFIX_.'htl_room_type` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
'SELECT `adults` FROM `'._DB_PREFIX_.'htl_room_type` WHERE `id_product` = '.(int)$this->id.' ORDER BY `id` ASC'
);
}

View File

@@ -2147,7 +2147,7 @@ class AdminControllerCore extends Controller
$tab_modules_list = $this->filterTabModuleList($tab_modules_list);
if ((is_array($tab_modules_list['slider_list']) && count($tab_modules_list['slider_list']))
if (!empty($tab_modules_list) && (is_array($tab_modules_list['slider_list']) && count($tab_modules_list['slider_list']))
|| !Tab::isTabModuleListAvailable()
) {
$this->page_header_toolbar_btn['modules-list'] = array(

View File

@@ -435,6 +435,15 @@ class FrontControllerCore extends Controller
$compared_products = CompareProduct::getCompareProducts($this->context->cookie->id_compare);
}
$isOccupancyWiseSearch = false;
if (Configuration::get('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$isOccupancyWiseSearch = true;
}
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
$this->context->smarty->assign(array(
// Useful for layout.tpl
'mobile_device' => $this->context->getMobileDevice(),
@@ -482,6 +491,10 @@ class FrontControllerCore extends Controller
'currencySign' => $currency->sign, // backward compat, see global.tpl
'currencyFormat' => $currency->format, // backward compat
'currencyBlank' => $currency->blank, // backward compat
'is_occupancy_wise_search' => $isOccupancyWiseSearch,
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
));
// Add the tpl files directory for mobile
@@ -1059,6 +1072,12 @@ class FrontControllerCore extends Controller
}
}
$this->addJS(_PS_JS_DIR_.'daterangepicker/moment.min.js');
$this->addjqueryPlugin('daterangepicker.min', _PS_JS_DIR_.'daterangepicker/');
$this->addJS(_PS_JS_DIR_.'daterangepicker/qlodaterangepicker.js');
$this->addCSS(_THEME_CSS_DIR_.'daterangepicker.css');
if (Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) {
$this->addJqueryUI('ui.sortable');
$this->addjqueryPlugin('fancybox');

View File

@@ -193,6 +193,11 @@ class OrderCore extends ObjectModel
*/
public $advance_paid_amount;
/**
* @var int is occupancy provided in this order
*/
public $with_occupancy;
/**
* @see ObjectModel::$definition
*/
@@ -246,8 +251,9 @@ class OrderCore extends ObjectModel
'source' => array('type' => self::TYPE_STRING),
'valid' => array('type' => self::TYPE_BOOL),
'reference' => array('type' => self::TYPE_STRING),
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
'with_occupancy' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
),

View File

@@ -26,6 +26,9 @@
class OrderReturnCore extends ObjectModel
{
/** @var int */
public $id_order_return;
/** @var int */
public $id_customer;
@@ -48,12 +51,22 @@ class OrderReturnCore extends ObjectModel
/** @var int if request raised by the admin */
public $by_admin;
/** @var int id_cart_rule or id_order_slip */
public $id_return_type;
/** @var int whether $id_return_type is cart_rule or order_slip */
public $return_type;
/** @var string Object creation date */
public $date_add;
/** @var string Object last modification date */
public $date_upd;
/** possible values for $return_type */
const RETURN_TYPE_CART_RULE = 1;
const RETURN_TYPE_ORDER_SLIP = 2;
/**
* @see ObjectModel::$definition
*/
@@ -69,6 +82,8 @@ class OrderReturnCore extends ObjectModel
'refunded_amount' => array('type' => self::TYPE_FLOAT),
'state' => array('type' => self::TYPE_INT),
'by_admin' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
'id_return_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'return_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
),
@@ -232,14 +247,16 @@ class OrderReturnCore extends ObjectModel
if (!$context) {
$context = Context::getContext();
}
$data = Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'order_return`
WHERE `id_customer` = '.(int)$customer_id.
($only_customer ? ' AND `by_admin` = 0' : '').
($order_id ? ' AND `id_order` = '.(int)$order_id : '').
($no_denied ? ' AND `state` != 4' : '').'
ORDER BY `date_add` DESC');
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_slip` ors
ON (ors.`id_order_slip` = orr.`id_return_type` AND orr.`return_type` = '.(int) self::RETURN_TYPE_ORDER_SLIP.')
WHERE orr.`id_customer` = '.(int)$customer_id.
($only_customer ? ' AND orr.`by_admin` = 0' : '').
($order_id ? ' AND orr.`id_order` = '.(int)$order_id : '').
($no_denied ? ' AND orr.`state` != 4' : '').'
ORDER BY orr.`date_add` DESC';
$data = Db::getInstance()->executeS($sql);
foreach ($data as $k => $or) {
$state = new OrderReturnState($or['state']);
$data[$k]['state_name'] = $state->name[$context->language->id];
@@ -373,144 +390,112 @@ class OrderReturnCore extends ObjectModel
/**
* Sets the new order return state
* @param int $newOrderReturnState
* @param int/object $idOrderReturn
*/
public function changeIdOrderReturnState($newOrderReturnState, $idOrderReturn, $idLang = 0)
public function changeIdOrderReturnState($newOrderReturnState, $idLang = 0)
{
if (Validate::isLoadedObject($objOrderReturn = new OrderReturn((int)$idOrderReturn))) {
$objOrder = new Order($objOrderReturn->id_order);
$objOrder = new Order($this->id_order);
if (!$idLang) {
$idLang = $objOrder->id_lang;
}
if (Validate::isLoadedObject(
$objOrderReturnState = new OrderReturnState((int)$newOrderReturnState, $idLang)
)) {
if ($this->state != $newOrderReturnState) {
$this->state = $newOrderReturnState;
$this->save();
if (!$idLang) {
$idLang = $objOrder->id_lang;
}
if (Validate::isLoadedObject(
$objOrderReturnState = new OrderReturnState((int)$newOrderReturnState, $idLang)
)) {
if ($objOrderReturn->state != $newOrderReturnState) {
$objOrderReturn->state = $newOrderReturnState;
$objOrderReturn->save();
if ($objOrderReturnState->send_email_to_customer
|| $objOrderReturnState->send_email_to_superadmin
|| $objOrderReturnState->send_email_to_employee
|| $objOrderReturnState->send_email_to_hotelier
) {
// Lets create data for the email templates
$objMail = new Mail();
$idHotel = 0;
if ($objOrderReturnState->send_email_to_customer
|| $objOrderReturnState->send_email_to_superadmin
|| $objOrderReturnState->send_email_to_employee
|| $objOrderReturnState->send_email_to_hotelier
) {
// Lets create data for the email templates
$objMail = new Mail();
$idHotel = 0;
$data = array (
'{status_name}' => $objOrderReturnState->name,
'{status_color}' => $objOrderReturnState->color,
'{order_reference}' => $objOrder->reference,
'{order_date}' => date('Y-m-d h:i:s', strtotime($objOrder->date_add)),
'{refunded_amount}' => Tools::displayPrice($this->refunded_amount, new Currency($objOrder->id_currency)),
'{payment_mode}' => $this->payment_mode,
'{id_transaction}' => $this->id_transaction,
);
$data = array (
'{status_name}' => $objOrderReturnState->name,
'{status_color}' => $objOrderReturnState->color,
'{order_reference}' => $objOrder->reference,
'{order_date}' => date('Y-m-d h:i:s', strtotime($objOrder->date_add)),
'{refunded_amount}' => Tools::displayPrice($objOrderReturn->refunded_amount, new Currency($objOrder->id_currency)),
'{payment_mode}' => $objOrderReturn->payment_mode,
'{id_transaction}' => $objOrderReturn->id_transaction,
);
// if mail is true for the customer then send mail to customer with selected template
$objCustomer = new Customer($objOrderReturn->id_customer);
if ($objOrderReturnState->send_email_to_customer && $objOrderReturnState->customer_template) {
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings(
$objOrderReturn->id_order,
$objOrderReturn->id,
0,
1
)) {
$idHotel = reset($refundReqBookings)['id_hotel'];
}
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_HTML, $refundReqBookings);
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_TEXT, $refundReqBookings);
$data['{refundBookingHtml}'] = $refBookHtml;
$data['{refundBookingTxt}'] = $refBookTxt;
// send customer information
$link = new Link();
$data['{refund_reqests_url}'] = $link->getPageLink('order-follow');
$data['{firstname}'] = $objCustomer->firstname;
$data['{lastname}'] = $objCustomer->lastname;
Mail::Send(
(int)$idLang,
$objOrderReturnState->customer_template,
$objOrderReturnState->name,
$data,
$objCustomer->email,
$objCustomer->firstname.' '.$objCustomer->lastname,
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
// if mail is true for the customer then send mail to customer with selected template
$objCustomer = new Customer($this->id_customer);
if ($objOrderReturnState->send_email_to_customer && $objOrderReturnState->customer_template) {
if ($refundReqBookings = $this->getOrderRefundRequestedBookings(
$this->id_order,
$this->id,
0,
1
)) {
$idHotel = reset($refundReqBookings)['id_hotel'];
}
if ($objOrderReturnState->admin_template) {
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings(
$objOrderReturn->id_order,
$objOrderReturn->id
)) {
$idHotel = $refundReqBookings[0]['id_hotel'];
}
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_HTML, $refundReqBookings);
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_customer', Mail::TYPE_TEXT, $refundReqBookings);
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_HTML, $refundReqBookings);
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_TEXT, $refundReqBookings);
$data['{refundBookingHtml}'] = $refBookHtml;
$data['{refundBookingTxt}'] = $refBookTxt;
$data['{cancelation_reason}'] = $objOrderReturn->question;
$data['{refundBookingHtml}'] = $refBookHtml;
$data['{refundBookingTxt}'] = $refBookTxt;
// send customer information
$link = new Link();
$data['{refund_reqests_url}'] = $link->getPageLink('order-follow');
$data['{firstname}'] = $objCustomer->firstname;
$data['{lastname}'] = $objCustomer->lastname;
// send mail to the super admin
if ($objOrderReturnState->send_email_to_superadmin) {
// send superadmin information
if (Validate::isLoadedObject($superAdmin = new Employee(_PS_ADMIN_PROFILE_))) {
if (Validate::isEmail($superAdmin->email)) {
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
$data['{customer_email}'] = $objCustomer->email;
$data['{firstname}'] = $superAdmin->firstname;
$data['{lastname}'] = $superAdmin->lastname;
Mail::Send(
(int)$idLang,
$objOrderReturnState->customer_template,
$objOrderReturnState->name,
$data,
$objCustomer->email,
$objCustomer->firstname.' '.$objCustomer->lastname,
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
}
Mail::Send(
(int)$idLang,
$objOrderReturnState->admin_template,
$objOrderReturnState->name,
$data,
$superAdmin->email,
$superAdmin->firstname.' '.$superAdmin->lastname,
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
}
}
}
if ($idHotel
&& Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))
) {
// send mail to the hotelier
if ($objOrderReturnState->send_email_to_hotelier) {
if ($objOrderReturnState->admin_template) {
if ($refundReqBookings = $this->getOrderRefundRequestedBookings(
$this->id_order,
$this->id
)) {
$idHotel = $refundReqBookings[0]['id_hotel'];
}
$refBookHtml = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_HTML, $refundReqBookings);
$refBookTxt = $objMail->getEmailTemplateContent('refund_request_detail_admin', Mail::TYPE_TEXT, $refundReqBookings);
$data['{cancelation_reason}'] = $this->question;
$data['{refundBookingHtml}'] = $refBookHtml;
$data['{refundBookingTxt}'] = $refBookTxt;
// send mail to the super admin
if ($objOrderReturnState->send_email_to_superadmin) {
// send superadmin information
if (Validate::isLoadedObject($superAdmin = new Employee(_PS_ADMIN_PROFILE_))) {
if (Validate::isEmail($superAdmin->email)) {
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
$data['{customer_email}'] = $objCustomer->email;
$data['{firstname}'] = '';
$data['{lastname}'] = '';
$data['{email}'] = $objHotel->email;
$data['{firstname}'] = $superAdmin->firstname;
$data['{lastname}'] = $superAdmin->lastname;
Mail::Send(
(int)$idLang,
$objOrderReturnState->admin_template,
$objOrderReturnState->name,
$data,
$objHotel->email,
null,
$superAdmin->email,
$superAdmin->firstname.' '.$superAdmin->lastname,
null,
null,
null,
@@ -520,38 +505,66 @@ class OrderReturnCore extends ObjectModel
(int)$objOrder->id_shop
);
}
}
}
if ($idHotel
&& Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))
) {
// send mail to the hotelier
if ($objOrderReturnState->send_email_to_hotelier) {
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
$data['{customer_email}'] = $objCustomer->email;
$data['{firstname}'] = '';
$data['{lastname}'] = '';
$data['{email}'] = $objHotel->email;
// send mail to the employee
if ($objOrderReturnState->send_email_to_employee) {
if ($htlAccesses = $objHotel->getHotelAccess($idHotel)) {
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
$data['{customer_email}'] = $objCustomer->email;
foreach ($htlAccesses as $access) {
if ($access['id_profile'] != _PS_ADMIN_PROFILE_) {
if ($htlEmployees = Employee::getEmployeesByProfile($access['id_profile'])) {
foreach ($htlEmployees as $empl) {
if (Validate::isEmail($empl['email'])) {
// send hotel manager (employee) have permission for this hotel
$data['{firstname}'] = $empl['firstname'];
$data['{lastname}'] = $empl['lastname'];
$data['{email}'] = $empl['email'];
Mail::Send(
(int)$idLang,
$objOrderReturnState->admin_template,
$objOrderReturnState->name,
$data,
$objHotel->email,
null,
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
}
Mail::Send(
(int)$idLang,
$objOrderReturnState->admin_template,
$objOrderReturnState->name,
$data,
$empl['email'],
$empl['firstname'].' '.$empl['lastname'],
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
}
// send mail to the employee
if ($objOrderReturnState->send_email_to_employee) {
if ($htlAccesses = $objHotel->getHotelAccess($idHotel)) {
$data['{customer_name}'] = $objCustomer->firstname.' '.$objCustomer->lastname;
$data['{customer_email}'] = $objCustomer->email;
foreach ($htlAccesses as $access) {
if ($access['id_profile'] != _PS_ADMIN_PROFILE_) {
if ($htlEmployees = Employee::getEmployeesByProfile($access['id_profile'])) {
foreach ($htlEmployees as $empl) {
if (Validate::isEmail($empl['email'])) {
// send hotel manager (employee) have permission for this hotel
$data['{firstname}'] = $empl['firstname'];
$data['{lastname}'] = $empl['lastname'];
$data['{email}'] = $empl['email'];
Mail::Send(
(int)$idLang,
$objOrderReturnState->admin_template,
$objOrderReturnState->name,
$data,
$empl['email'],
$empl['firstname'].' '.$empl['lastname'],
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$objOrder->id_shop
);
}
}
}
@@ -561,18 +574,21 @@ class OrderReturnCore extends ObjectModel
}
}
}
// executes hook
Hook::exec(
'actionOrderReFundStatusPostUpdate',
array(
'new_order_return_status' => $newOrderReturnState,
'id_order_return' => (int)$idOrderReturn
)
);
}
// executes hook
Hook::exec(
'actionOrderReFundStatusPostUpdate',
array(
'new_order_return_status' => $newOrderReturnState,
'id_order_return' => (int) $this->id_order_return,
)
);
return true;
}
}
return false;
}

View File

@@ -27,7 +27,7 @@
class OrderSlipCore extends ObjectModel
{
/** @var int */
public $id;
public $id_order_slip;
/** @var int */
public $id_customer;
@@ -62,6 +62,12 @@ class OrderSlipCore extends ObjectModel
/** @var int */
public $partial;
/** @var int */
public $redeem_status = self::REDEEM_STATUS_ACTIVE;
/** @var int */
public $id_cart_rule;
/** @var string Object creation date */
public $date_add;
@@ -71,6 +77,9 @@ class OrderSlipCore extends ObjectModel
/** @var int */
public $order_slip_type = 0;
const REDEEM_STATUS_ACTIVE = 1;
const REDEEM_STATUS_REDEEMED = 2;
/**
* @see ObjectModel::$definition
*/
@@ -90,6 +99,8 @@ class OrderSlipCore extends ObjectModel
'shipping_cost_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
'amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
'partial' => array('type' => self::TYPE_INT),
'redeem_status' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'id_cart_rule' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'order_slip_type' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
@@ -336,6 +347,7 @@ class OrderSlipCore extends ObjectModel
$order_slip->{'total_products_tax_'.$inc_or_ex_1} = 0;
$order_slip->{'total_products_tax_'.$inc_or_ex_2} = 0;
$total_products = array();
foreach ($booking_list as &$booking) {
$objHtlBooking = new HotelBookingDetail($booking['id_htl_booking']);
$order_detail = new OrderDetail((int)$objHtlBooking->id_order_detail);
@@ -543,6 +555,95 @@ class OrderSlipCore extends ObjectModel
return $ecotax_detail;
}
/**
* generate voucher and return id of the created rule if successful, false otherwise
*/
public function generateVoucher($sendMail = true)
{
if (!Validate::isLoadedObject($this)) {
return false;
}
if ($this->redeem_status != self::REDEEM_STATUS_ACTIVE) {
return false;
}
$objOrder = new Order($this->id_order);
if (!Validate::isLoadedObject($objOrder)) {
return false;
}
$objCustomer = new Customer($this->id_customer);
if (!Validate::isLoadedObject($objCustomer)) {
return false;
}
$context = Context::getContext();
$objCartRule = new CartRule();
$languages = Language::getLanguages();
$creditSlipPrefix = Configuration::get('PS_CREDIT_SLIP_PREFIX', $context->language->id);
$creditSlipID = sprintf(('%1$s%2$06d'), $creditSlipPrefix, (int) $this->id_order_slip);
$dateFrom = $this->date_add;
$dateTo = date('Y-m-d H:i:s', strtotime($dateFrom) + (3600 * 24 * 365.25)); /* 1 year */
foreach ($languages as $language) {
$objCartRule->name[$language['id_lang']] = sprintf('Voucher for credit slip #%s', $creditSlipID);
}
$objCartRule->description = sprintf('Order: #%s', $objOrder->id);
$objCartRule->code = 'CS'.(int) ($this->id_order_slip).'C'.(int) ($objCustomer->id).'O'.(int) ($objOrder->id);
$objCartRule->quantity = 1;
$objCartRule->quantity_per_user = 1;
$objCartRule->id_customer = $objCustomer->id;
$objCartRule->date_from = $dateFrom;
$objCartRule->date_to = $dateTo;
$objCartRule->highlight = 1;
$objCartRule->active = 1;
$objCartRule->reduction_amount = $this->amount;
$objCartRule->reduction_tax = true;
$objCartRule->minimum_amount_currency = $objOrder->id_currency;
$objCartRule->reduction_currency = $objOrder->id_currency;
if (!$objCartRule->save()) {
return false;
}
$this->redeem_status = self::REDEEM_STATUS_REDEEMED;
$this->id_cart_rule = (int) $objCartRule->id;
$this->save();
if ($sendMail) {
$objCartRule = new CartRule($this->id_cart_rule);
$objCustomer = new Customer($objCartRule->id_customer);
$objCurrency = new Currency($objCartRule->reduction_currency, $context->language->id);
$mailVars['{firstname}'] = $objCustomer->firstname;
$mailVars['{lastname}'] = $objCustomer->lastname;
$mailVars['{credit_slip_id}'] = $creditSlipID;
$mailVars['{voucher_code}'] = $objCartRule->code;
$mailVars['{voucher_amount}'] = Tools::displayPrice($objCartRule->reduction_amount, $objCurrency, false);
Mail::Send(
$context->language->id,
'credit_slip_voucher',
sprintf(Mail::l('New voucher for your credit slip #%s', $context->language->id), $creditSlipID),
$mailVars,
$objCustomer->email,
$objCustomer->firstname.' '.$objCustomer->lastname,
null,
null,
null,
null,
_PS_MAIL_DIR_,
true
);
}
return $this->id_cart_rule;
}
public function getWsOrderSlipDetails()
{
$query = 'SELECT id_order_slip as id, id_order_detail, product_quantity, amount_tax_excl, amount_tax_incl

View File

@@ -352,8 +352,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
$cart_htl_data[$type_key]['adult'] = $rm_dtl['adult'];
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
@@ -400,6 +398,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
$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'];
$num_days = $cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'];
@@ -446,6 +446,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = Tools::displayDate($data_v['date_from']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = Tools::displayDate($data_v['date_to']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$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;

View File

@@ -40,7 +40,7 @@ class WebserviceOutputJSON implements WebserviceOutputInterface
/**
* Current association
*/
protected $currentAssociatedEntity;
protected $currentAssociatedEntity = array();
/**
* Json content

View File

@@ -161,10 +161,10 @@ if ($cookie_lifetime > 0) {
$cookie_lifetime = time() + (max($cookie_lifetime, 1) * 3600);
}
$force_ssl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE');
if (defined('_PS_ADMIN_DIR_')) {
$cookie = new Cookie('psAdmin', '', $cookie_lifetime);
$cookie = new Cookie('psAdmin', '', $cookie_lifetime, null, false, $force_ssl);
} else {
$force_ssl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE');
if ($context->shop->getGroup()->share_order) {
$cookie = new Cookie('ps-sg'.$context->shop->getGroup()->id, '', $cookie_lifetime, $context->shop->getUrlsSharedCart(), false, $force_ssl);
} else {

View File

@@ -65,7 +65,6 @@
<hooks>
<hook module="hotelreservationsystem" hook="actionValidateOrder" position="1"/>
<hook module="hotelreservationsystem" hook="Header" position="1"/>
<hook module="hotelreservationsystem" hook="actionProductUpdate" position="1"/>
<hook module="hotelreservationsystem" hook="displayTop" position="1"/>
<hook module="hotelreservationsystem" hook="displayFooter" position="1"/>
<hook module="hotelreservationsystem" hook="actionOrderStatusPostUpdate" position="1"/>
@@ -77,8 +76,6 @@
<hook module="hotelreservationsystem" hook="displayAfterDefautlFooterHook" position="1"/>
<hook module="hotelreservationsystem" hook="addWebserviceResources" position="1"/>
<hook module="hotelreservationsystem" hook="actionObjectLanguageAddAfter" position="1"/>
<hook module="hotelreservationsystem" hook="actionAdminControllerSetMedia" position="1"/>
<hook module="hotelreservationsystem" hook="displayAdminProductsExtra" position="1"/>
<hook module="hotelreservationsystem" hook="actionObjectProfileAddAfter" position="1"/>
<hook module="hotelreservationsystem" hook="actionObjectProfileDeleteBefore" position="1"/>
<hook module="hotelreservationsystem" hook="actionObjectGroupDeleteBefore" position="1"/>
@@ -154,14 +151,15 @@
<hook module="dashtrends" hook="actionOrderStatusPostUpdate" position="3"/>
<hook module="dashtrends" hook="actionAdminControllerSetMedia" position="3"/>
<hook module="dashtrends" hook="dashboardData" position="2"/>
<hook module="dashtrends" hook="dashboardZoneTwo" position="1"/>
<hook module="dashguestcycle" hook="dashboardZoneTwo" position="1"/>
<hook module="dashtrends" hook="dashboardZoneTwo" position="2"/>
<hook module="dashgoals" hook="actionAdminControllerSetMedia" position="4"/>
<hook module="dashgoals" hook="dashboardData" position="3"/>
<hook module="dashgoals" hook="dashboardZoneTwo" position="2"/>
<hook module="dashgoals" hook="dashboardZoneTwo" position="3"/>
<hook module="dashproducts" hook="actionSearch" position="1"/>
<hook module="dashproducts" hook="dashboardData" position="4"/>
<hook module="dashproducts" hook="actionObjectOrderAddAfter" position="2"/>
<hook module="dashproducts" hook="dashboardZoneTwo" position="3"/>
<hook module="dashproducts" hook="dashboardZoneTwo" position="4"/>
<hook module="statsdata" hook="actionAuthentication" position="1"/>
<hook module="statsdata" hook="displayFooter" position="7"/>
<hook module="statsdata" hook="actionCustomerAccountAdd" position="2"/>

View File

@@ -85,6 +85,16 @@ class AdminAdminPreferencesControllerCore extends AdminController
'default' => '480',
'visibility' => Shop::CONTEXT_ALL
),
'PS_COOKIE_SAMESITE' => array(
'title' => $this->l('Same site cookie'),
'hint' => $this->l('Allows you to declare if your cookie should be restricted to a first-party or same-site context.'),
'validation' => 'isGenericName',
'type' => 'select',
'cast' => 'strval',
'identifier' => 'type',
'list' => CookieCore::SAMESITE_AVAILABLE_VALUES,
'visibility' => Shop::CONTEXT_ALL
),
),
'submit' => array('title' => $this->l('Save'))
),
@@ -159,6 +169,12 @@ class AdminAdminPreferencesControllerCore extends AdminController
$upload_max_size = (int)str_replace('M', '', ini_get('upload_max_filesize'));
$post_max_size = (int)str_replace('M', '', ini_get('post_max_size'));
$max_size = $upload_max_size < $post_max_size ? $upload_max_size : $post_max_size;
$forceSsl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE');
if (!$forceSsl && Tools::getValue('PS_COOKIE_SAMESITE') === Cookie::SAMESITE_NONE) {
$this->errors[] = Tools::displayError('The SameSite=None is only available in secure mode.');
return;
}
if (Tools::getValue('PS_LIMIT_UPLOAD_FILE_VALUE') > $max_size || Tools::getValue('PS_LIMIT_UPLOAD_IMAGE_VALUE') > $max_size) {
$this->errors[] = Tools::displayError('The limit chosen is larger than the server\'s maximum upload limit. Please increase the limits of your server.');

View File

@@ -592,7 +592,7 @@ class AdminCartsControllerCore extends AdminController
$id_cart = Tools::getValue('id_cart');//get cart id from url
$cart_detail_data = array();
$cart_detail_data_obj = new HotelCartBookingData();
$update_htl_cart_currency = $cart_detail_data_obj->updateIdCurrencyByIdCart($id_cart, $currency->id);
$cart_detail_data_obj->updateIdCurrencyByIdCart($id_cart, $currency->id);
$cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart);
$this->context->smarty->assign(array(
'cart_detail_data' => $cart_detail_data,
@@ -951,6 +951,79 @@ class AdminCartsControllerCore extends AdminController
}
}
public function ajaxProcessupdateRoomOccupancy()
{
$params = Tools::getValue('params');
$idBookingData = (int) $params['id_booking_data'];
$idCart = (int) $params['id_cart'];
$occupancy = $params['occupancy'];
$this->context->cart = new Cart($idCart);
if ($this->tabAccess['edit'] === '1') {
// validate occupancy is correct
$hasError = false;
if (is_array($occupancy)) {
if (!$occupancy['adults'] || !Validate::isUnsignedInt($occupancy['adults'])) {
$hasError = true;
}
if (!Validate::isUnsignedInt($occupancy['children'])) {
$hasError = true;
}
if ($occupancy['children']) {
if (!isset($occupancy['child_ages']) || $occupancy['children'] != count($occupancy['child_ages'])) {
$hasError = true;
} else {
foreach($occupancy['child_ages'] as $age) {
if (!Validate::isUnsignedInt($occupancy['adults'])) {
$hasError = true;
}
}
}
}
} else {
$hasError = true;
}
if (!$hasError) {
$objHotelCartBookingData = new HotelCartBookingData($idBookingData);
$objRoomType = new HotelRoomType();
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($objHotelCartBookingData->id_product)) {
if ($occupancy['adults'] > $roomTypeInfo['max_adults']) {
$hasError = true;
}
if ($occupancy['children'] > $roomTypeInfo['max_children']) {
$hasError = true;
}
if ($occupancy['adults'] + $occupancy['children'] > $roomTypeInfo['max_guests']) {
$hasError = true;
}
if (!$hasError) {
$objHotelCartBookingData->adults = $occupancy['adults'];
$objHotelCartBookingData->children = $occupancy['children'];
$objHotelCartBookingData->child_ages = json_encode($occupancy['child_ages']);
$objHotelCartBookingData->save();
}
}
}
$objHotelCartBookingData = new HotelCartBookingData();
$bookingsInfo = $objHotelCartBookingData->getCartFormatedBookinInfoByIdCart($idCart);
foreach ($bookingsInfo as &$bookingInfo) {
if ($bookingInfo['id'] == $idBookingData) {
$amtWithQty = $bookingInfo['amt_with_qty'];
$bookingInfo['amt_with_qty'] = Tools::displayPrice($amtWithQty);
$bookingInfo['total_price'] = Tools::displayPrice($amtWithQty + $bookingInfo['demand_price']);
$response = array(
'curr_booking_info' => $bookingInfo,
'cart_info' => $this->ajaxReturnVars(),
);
die(json_encode($response));
}
}
}
}
// Process to get extra demands of any room while order creation process form.tpl
public function ajaxProcessGetRoomTypeCartDemands()
{

View File

@@ -219,6 +219,11 @@ class AdminOrdersControllerCore extends AdminController
$cart_detail_data = array();
$cart_detail_data_obj = new HotelCartBookingData();
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']);
}
$this->context->smarty->assign('cart_detail_data', $cart_detail_data);
} else {
// if no rooms added in the cart and user visits add order page then redirect to BOOK NOW page
@@ -240,6 +245,11 @@ class AdminOrdersControllerCore extends AdminController
$payment_modules[] = Module::getInstanceById((int)$p_module['id_module']);
}
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
$this->context->smarty->assign(array(
'recyclable_pack' => (int)Configuration::get('PS_RECYCLABLE_PACK'),
'gift_wrapping' => (int)Configuration::get('PS_GIFT_WRAPPING'),
@@ -253,8 +263,10 @@ class AdminOrdersControllerCore extends AdminController
'toolbar_btn' => $this->toolbar_btn,
'toolbar_scroll' => $this->toolbar_scroll,
'PS_CATALOG_MODE' => Configuration::get('PS_CATALOG_MODE'),
'title' => array($this->l('Orders'), $this->l('Create order'))
'title' => array($this->l('Orders'), $this->l('Create order')),
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
));
$this->content .= $this->createTemplate('form.tpl')->fetch();
}
@@ -454,8 +466,8 @@ class AdminOrdersControllerCore extends AdminController
}
if (!count($this->errors)) {
$obj_booking_dtl = new HotelBookingDetail();
$room_swapped = $obj_booking_dtl->reallocateRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $realloc_room_id);
$objBookingDetail = new HotelBookingDetail();
$room_swapped = $objBookingDetail->reallocateRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $realloc_room_id);
if (!$room_swapped) {
$this->errors[] = Tools::displayError('Some error occured. Please try again.');
} else {
@@ -489,8 +501,8 @@ class AdminOrdersControllerCore extends AdminController
}
if (!count($this->errors)) {
$obj_booking_dtl = new HotelBookingDetail();
$room_swapped = $obj_booking_dtl->swapRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $swapped_room_id);
$objBookingDetail = new HotelBookingDetail();
$room_swapped = $objBookingDetail->swapRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $swapped_room_id);
if (!$room_swapped) {
$this->errors[] = Tools::displayError('Some error occured. Please try again.');
} else {
@@ -746,7 +758,7 @@ class AdminOrdersControllerCore extends AdminController
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $order->id_customer;
$objOrderReturn->id_order = $order->id;
$objOrderReturn->state = 1;
$objOrderReturn->state = Configuration::get('PS_ORS_PENDING');
$objOrderReturn->by_admin = 1;
$objOrderReturn->question = $refundReason;
$objOrderReturn->save();
@@ -879,13 +891,14 @@ class AdminOrdersControllerCore extends AdminController
false,
$cart->secure_key
);
/*
setcookie('wk_id_cart', ' ', time() - 86400, '/');
setcookie('wk_id_guest', ' ', time() - 86400, '/');
unset($_COOKIE['wk_id_cart']);
unset($_COOKIE['wk_id_guest']);
*/
if (isset($this->context->cookie->id_cart)) {
unset($this->context->cookie->id_cart);
}
if (isset($this->context->cookie->id_guest)) {
unset($this->context->cookie->id_guest);
}
if ($payment_module->currentOrder) {
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3');
}
@@ -1459,6 +1472,7 @@ class AdminOrdersControllerCore extends AdminController
$totalDemandsPriceTI = 0;
if ($order_detail_data = $objBookingDetail->getOrderFormatedBookinInfoByIdOrder($order->id)) {
$objBookingDemand = new HotelBookingDemands();
$objHotelRoomType = new HotelRoomType();
foreach ($order_detail_data as $key => $value) {
$order_detail_data[$key]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order->id,
@@ -1512,6 +1526,8 @@ class AdminOrdersControllerCore extends AdminController
$order_detail_data[$key]['unit_amt_tax_incl'] = $value['total_price_tax_incl']/$num_days;
$order_detail_data[$key]['amt_with_qty_tax_excl'] = $value['total_price_tax_excl'];
$order_detail_data[$key]['amt_with_qty_tax_incl'] = $value['total_price_tax_incl'];
$order_detail_data[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']);
}
}
@@ -1527,7 +1543,6 @@ class AdminOrdersControllerCore extends AdminController
// hotel booking statuses
$htlOrderStatus = HotelBookingDetail::getAllHotelOrderStatus();
$this->tpl_view_vars = array(
// refund info
'refund_allowed' => (int) $order->isReturnable(),
@@ -1543,6 +1558,8 @@ class AdminOrdersControllerCore extends AdminController
'htl_booking_order_data' => $bookingOrderInfo,
'hotel_order_status' => $htlOrderStatus,
'order_detail_data' => $order_detail_data,
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
/*END*/
'order' => $order,
'cart' => new Cart($order->id_cart),
@@ -1678,7 +1695,13 @@ class AdminOrdersControllerCore extends AdminController
}
if ($products = Product::searchByName((int)$this->context->language->id, pSQL(Tools::getValue('product_search')), null, $idHotel)) {
$objRoomType = new HotelRoomType();
foreach ($products as &$product) {
// get product room type informatin
if ($roomTypeDetail = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product'])) {
$product['room_type_info'] = $roomTypeDetail;
}
// Formatted price
$product['formatted_price'] = Tools::displayPrice(Tools::convertPrice($product['price_tax_incl'], $currency), $currency);
// Concret price
@@ -1811,6 +1834,7 @@ class AdminOrdersControllerCore extends AdminController
$date_from = date('Y-m-d', strtotime($product_informations['date_from']));
$date_to = date('Y-m-d', strtotime($product_informations['date_to']));
$curr_date = date('Y-m-d');
$occupancy = Tools::getValue('occupancy');
/*Validations*/
if ($date_from == '') {
die(json_encode(array(
@@ -1842,6 +1866,45 @@ class AdminOrdersControllerCore extends AdminController
'result' => false,
'error' => Tools::displayError('Check out Date Should be after Check In date.'),
)));
}
if ($order->with_occupancy) {
if ($occupancy) {
foreach($occupancy as $key =>$roomOccupancy) {
if (!$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
die(json_encode(array(
'result' => false,
'error' => sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1)),
)));
} elseif (!Validate::isUnsignedInt($roomOccupancy['children'])) {
die(json_encode(array(
'result' => false,
'error' => sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1)),
)));
}
if ($roomOccupancy['children'] > 0) {
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages']))) {
die(json_encode(array(
'result' => false,
'error' => sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1)),
)));
} else {
foreach($roomOccupancy['child_ages'] as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
die(json_encode(array(
'result' => false,
'error' => sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1)),
)));
}
}
}
}
}
} else {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Invalid occupancy.'),
)));
}
} elseif (!Validate::isUnsignedInt($product_informations['product_quantity'])) {
die(json_encode(array(
'result' => false,
@@ -1849,8 +1912,13 @@ class AdminOrdersControllerCore extends AdminController
)));
}
if ($order->with_occupancy) {
$req_rm = count($occupancy);
} else {
$req_rm = $product_informations['product_quantity'];
}
$obj_booking_detail = new HotelBookingDetail();
$req_rm = $product_informations['product_quantity'];
$num_days = $obj_booking_detail->getNumberOfDays($date_from, $date_to);
$product_informations['product_quantity'] = $product_informations['product_quantity'] * (int) $num_days;
@@ -1861,9 +1929,17 @@ class AdminOrdersControllerCore extends AdminController
$id_hotel = $room_info_by_id_product['id_hotel'];
if ($id_hotel) {
$obj_booking_dtl = new HotelBookingDetail();
$hotel_room_data = $obj_booking_dtl->DataForFrontSearch($date_from, $date_to, $id_hotel, $product_informations['product_id'], 1, 0, 0, -1, 0, 0, $id_cart, $id_guest);
$objBookingDetail = new HotelBookingDetail();
$bookingParams = array(
'date_from' => $date_from,
'date_to' => $date_to,
'hotel_id' => $id_hotel,
'id_room_type' => $product_informations['product_id'],
'only_search_data' => 1,
'id_cart' => $id_cart,
'id_guest' => $id_guest,
);
$hotel_room_data = $objBookingDetail->dataForFrontSearch($bookingParams);
$total_available_rooms = $hotel_room_data['stats']['num_avail'];
if ($total_available_rooms < $req_rm) {
@@ -1934,54 +2010,40 @@ class AdminOrdersControllerCore extends AdminController
$this->context->cart = $cart;
$this->context->customer = new Customer($order->id_customer);
// always add taxes even if there are not displayed to the customer
$use_taxes = true;
$initial_product_price_tax_incl = Product::getPriceStatic(
$product->id,
$use_taxes,
isset($combination) ? $combination->id : null,
2,
null,
false,
true,
1,
false,
$order->id_customer,
$cart->id,
$order->{Configuration::get('PS_TAX_ADDRESS_TYPE', null, null, $order->id_shop)}
);
// create feature price if needed
$createFeaturePrice = $product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl;
$featurePriceParams = array();
if ($createFeaturePrice) {
$featurePriceParams = array(
'id_cart' => $this->context->cart->id,
'id_guest' => $this->context->cookie->id_guest,
'price' => $product_informations['product_price_tax_excl'],
'id_product' => $product->id,
);
if ($order->with_occupancy) {
$objRoomType = new HotelRoomType();
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($id_product);
}
/*By Webkul to make entries in HotelCartBookingData */
$hotel_room_info_arr = $hotel_room_data['rm_data'][0]['data']['available'];
$hotel_room_info_arr = $hotel_room_data['rm_data'][$idProduct]['data']['available'];
$chkQty = 0;
if ($hotel_room_info_arr) {
foreach ($hotel_room_info_arr as $room_info) {
foreach ($hotel_room_info_arr as $key => $room_info) {
if ($chkQty < $req_rm) {
$obj_htl_cart_booking_data = new HotelCartBookingData();
$obj_htl_cart_booking_data->id_cart = $this->context->cart->id;
$obj_htl_cart_booking_data->id_guest = $this->context->cookie->id_guest;
$obj_htl_cart_booking_data->id_customer = $this->context->customer->id;
$obj_htl_cart_booking_data->id_currency = $order->id_currency;
$obj_htl_cart_booking_data->id_product = $room_info['id_product'];
$obj_htl_cart_booking_data->id_room = $room_info['id_room'];
$obj_htl_cart_booking_data->id_hotel = $room_info['id_hotel'];
$obj_htl_cart_booking_data->booking_type = HotelBookingDetail::ALLOTMENT_AUTO;
$obj_htl_cart_booking_data->quantity = $num_days;
$obj_htl_cart_booking_data->date_from = $date_from;
$obj_htl_cart_booking_data->date_to = $date_to;
$obj_htl_cart_booking_data->save();
$objCartBookingData = new HotelCartBookingData();
$objCartBookingData->id_cart = $this->context->cart->id;
$objCartBookingData->id_guest = $this->context->cookie->id_guest;
$objCartBookingData->id_customer = $this->context->customer->id;
$objCartBookingData->id_currency = $order->id_currency;
$objCartBookingData->id_product = $room_info['id_product'];
$objCartBookingData->id_room = $room_info['id_room'];
$objCartBookingData->id_hotel = $room_info['id_hotel'];
$objCartBookingData->booking_type = HotelBookingDetail::ALLOTMENT_AUTO;
$objCartBookingData->quantity = $num_days;
$objCartBookingData->date_from = $date_from;
$objCartBookingData->date_to = $date_to;
if ($order->with_occupancy) {
$room_occupancy = array_shift($occupancy);
$objCartBookingData->adults = $room_occupancy['adults'];
$objCartBookingData->children = $room_occupancy['children'];
$objCartBookingData->child_ages = $room_occupancy['children'] ? json_encode($room_occupancy['child_ages']) : json_encode(array());
} else {
$objCartBookingData->adults = $roomTypeInfo['adults'];
$objCartBookingData->children = $roomTypeInfo['children'];
$objCartBookingData->child_ages = json_encode(array());
}
$objCartBookingData->save();
++$chkQty;
// create feature price if needed
@@ -1996,10 +2058,52 @@ class AdminOrdersControllerCore extends AdminController
}
}
/*END*/
// always add taxes even if there are not displayed to the customer
$use_taxes = true;
$initial_product_price_tax_incl = Product::getPriceStatic(
$product->id,
$use_taxes,
isset($combination) ? $combination->id : null,
2,
null,
false,
true,
1,
false,
$order->id_customer,
$cart->id,
$order->id_address_tax
);
// Creating specific price if needed
if ($product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl) {
$specific_price = new SpecificPrice();
$specific_price->id_shop = 0;
$specific_price->id_shop_group = 0;
$specific_price->id_currency = 0;
$specific_price->id_country = 0;
$specific_price->id_group = 0;
$specific_price->id_customer = $order->id_customer;
$specific_price->id_product = $product->id;
if (isset($combination)) {
$specific_price->id_product_attribute = $combination->id;
} else {
$specific_price->id_product_attribute = 0;
}
$specific_price->price = $product_informations['product_price_tax_excl'];
$specific_price->from_quantity = 1;
$specific_price->reduction = 0;
$specific_price->reduction_type = 'amount';
$specific_price->reduction_tax = 0;
$specific_price->from = '0000-00-00 00:00:00';
$specific_price->to = '0000-00-00 00:00:00';
$specific_price->add();
}
// Add product to cart
$update_quantity = $cart->updateQty(
$product_informations['product_quantity'],
($req_rm * $num_days),
$product->id,
isset($product_informations['product_attribute_id']) ? $product_informations['product_attribute_id'] : null,
isset($combination) ? $combination->id : null,
@@ -2226,76 +2330,79 @@ class AdminOrdersControllerCore extends AdminController
/*By Webkul Entry into table HotelbookingDetail*/
$objRoomType = new HotelRoomType();
$objHtlBkDtl = new HotelBookingDetail();
$inserted_id_order_detail = $objHtlBkDtl->getLastInsertedIdOrderDetail($order->id);
$objBookingDetail = new HotelBookingDetail();
$inserted_id_order_detail = $objBookingDetail->getLastInsertedIdOrderDetail($order->id);
$idLang = (int)$this->context->cart->id_lang;
$obj_cart_bk_data = new HotelCartBookingData();
if ($cart_bk_data = $obj_cart_bk_data->getOnlyCartBookingData(
$objCartBookingData = new HotelCartBookingData();
if ($cartBookingData = $objCartBookingData->getOnlyCartBookingData(
$this->context->cart->id,
$this->context->cart->id_guest,
$idProduct
)) {
foreach ($cart_bk_data as $cb_k => $cb_v) {
$obj_cart_bk_data = new HotelCartBookingData($cb_v['id']);
$obj_cart_bk_data->id_order = $order->id;
$obj_cart_bk_data->save();
foreach ($cartBookingData as $cb_k => $cb_v) {
$objCartBookingData = new HotelCartBookingData($cb_v['id']);
$objCartBookingData->id_order = $order->id;
$objCartBookingData->save();
$objHtlBkDtl = new HotelBookingDetail();
$objHtlBkDtl->id_product = $idProduct;
$objHtlBkDtl->id_order = $order->id;
$objHtlBkDtl->id_order_detail = $inserted_id_order_detail;
$objHtlBkDtl->id_cart = $this->context->cart->id;
$objHtlBkDtl->id_room = $obj_cart_bk_data->id_room;
$objHtlBkDtl->id_hotel = $obj_cart_bk_data->id_hotel;
$objHtlBkDtl->id_customer = $this->context->customer->id;
$objHtlBkDtl->booking_type = $obj_cart_bk_data->booking_type;
$objHtlBkDtl->id_status = 1;
$objHtlBkDtl->comment = $obj_cart_bk_data->comment;
$objHtlBkDtl->room_type_name = Product::getProductName($idProduct, null, $order->id_lang);
$objBookingDetail = new HotelBookingDetail();
$objBookingDetail->id_product = $idProduct;
$objBookingDetail->id_order = $order->id;
$objBookingDetail->id_order_detail = $inserted_id_order_detail;
$objBookingDetail->id_cart = $this->context->cart->id;
$objBookingDetail->id_room = $objCartBookingData->id_room;
$objBookingDetail->id_hotel = $objCartBookingData->id_hotel;
$objBookingDetail->id_customer = $this->context->customer->id;
$objBookingDetail->booking_type = $objCartBookingData->booking_type;
$objBookingDetail->id_status = 1;
$objBookingDetail->comment = $objCartBookingData->comment;
$objBookingDetail->room_type_name = Product::getProductName($idProduct, null, $order->id_lang);
$objHtlBkDtl->date_from = $obj_cart_bk_data->date_from;
$objHtlBkDtl->date_to = $obj_cart_bk_data->date_to;
$objBookingDetail->date_from = $objCartBookingData->date_from;
$objBookingDetail->date_to = $objCartBookingData->date_to;
$objBookingDetail->adults = $objCartBookingData->adults;
$objBookingDetail->children = $objCartBookingData->children;
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$idProduct,
$obj_cart_bk_data->date_from,
$obj_cart_bk_data->date_to,
$objCartBookingData->date_from,
$objCartBookingData->date_to,
0,
Group::getCurrent()->id,
$this->context->cart->id,
$this->context->cookie->id_guest,
$obj_cart_bk_data->id_room
$objCartBookingData->id_room
);
$objHtlBkDtl->total_price_tax_excl = $total_price['total_price_tax_excl'];
$objHtlBkDtl->total_price_tax_incl = $total_price['total_price_tax_incl'];
$objHtlBkDtl->total_paid_amount = Tools::ps_round($total_price['total_price_tax_incl'], 5);
$objBookingDetail->total_price_tax_excl = $total_price['total_price_tax_excl'];
$objBookingDetail->total_price_tax_incl = $total_price['total_price_tax_incl'];
$objBookingDetail->total_paid_amount = Tools::ps_round($total_price['total_price_tax_incl'], 5);
// Save hotel information/location/contact
if (Validate::isLoadedObject($objRoom = new HotelRoomInformation($obj_cart_bk_data->id_room))) {
$objHtlBkDtl->room_num = $objRoom->room_num;
if (Validate::isLoadedObject($objRoom = new HotelRoomInformation($objCartBookingData->id_room))) {
$objBookingDetail->room_num = $objRoom->room_num;
}
if (Validate::isLoadedObject($objHotelBranch = new HotelBranchInformation(
$obj_cart_bk_data->id_hotel,
$objCartBookingData->id_hotel,
$idLang
))) {
$addressInfo = $objHotelBranch->getAddress($obj_cart_bk_data->id_hotel);
$objHtlBkDtl->hotel_name = $objHotelBranch->hotel_name;
$objHtlBkDtl->city = $addressInfo['city'];
$objHtlBkDtl->state = State::getNameById($addressInfo['id_state']);
$objHtlBkDtl->country = Country::getNameById($idLang, $addressInfo['id_country']);
$objHtlBkDtl->zipcode = $addressInfo['postcode'];;
$objHtlBkDtl->phone = $addressInfo['phone'];
$objHtlBkDtl->email = $objHotelBranch->email;
$objHtlBkDtl->check_in_time = $objHotelBranch->check_in;
$objHtlBkDtl->check_out_time = $objHotelBranch->check_out;
$addressInfo = $objHotelBranch->getAddress($objCartBookingData->id_hotel);
$objBookingDetail->hotel_name = $objHotelBranch->hotel_name;
$objBookingDetail->city = $addressInfo['city'];
$objBookingDetail->state = State::getNameById($addressInfo['id_state']);
$objBookingDetail->country = Country::getNameById($idLang, $addressInfo['id_country']);
$objBookingDetail->zipcode = $addressInfo['postcode'];;
$objBookingDetail->phone = $addressInfo['phone'];
$objBookingDetail->email = $objHotelBranch->email;
$objBookingDetail->check_in_time = $objHotelBranch->check_in;
$objBookingDetail->check_out_time = $objHotelBranch->check_out;
}
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
$objHtlBkDtl->adult = $roomTypeInfo['adult'];
$objHtlBkDtl->children = $roomTypeInfo['children'];
$objBookingDetail->adults = $objCartBookingData->adults;
$objBookingDetail->children = $objCartBookingData->children;
$objBookingDetail->child_ages = $objCartBookingData->child_ages;
}
$objHtlBkDtl->save();
$objBookingDetail->save();
}
}
@@ -2406,7 +2513,7 @@ class AdminOrdersControllerCore extends AdminController
}
/*By webkul To edit Order and cart entries when edit rooms from the orderLine when editing the order*/
$product_informations = $_POST['add_product'];
$product_informations = $_POST['edit_product'];
$new_date_from = trim(date('Y-m-d', strtotime($product_informations['date_from'])));
$new_date_to = trim(date('Y-m-d', strtotime($product_informations['date_to'])));
$old_date_from = trim(Tools::getValue('date_from'));
@@ -2419,6 +2526,10 @@ class AdminOrdersControllerCore extends AdminController
$product_quantity = (int) $obj_booking_detail->getNumberOfDays($new_date_from, $new_date_to);
$old_product_quantity = (int) $obj_booking_detail->getNumberOfDays($old_date_from, $old_date_to);
$qty_diff = $product_quantity - $old_product_quantity;
$occupancy = array_shift(Tools::getValue('occupancy'));
$adults = $occupancy['adults'];
$children = $occupancy['children'];
$child_ages = $occupancy['child_ages'];
/*By webkul to validate fields before deleting the cart and order data form the tables*/
if ($id_hotel == '') {
@@ -2476,6 +2587,33 @@ class AdminOrdersControllerCore extends AdminController
'result' => false,
'error' => Tools::displayError('Invalid quantity.'),
)));
} elseif (!isset($adults) || !$adults || !Validate::isUnsignedInt($adults)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Invalid number of adults.'),
)));
} elseif (!Validate::isUnsignedInt($children)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Invalid number of children.'),
)));
}
if ($children > 0) {
if (!isset($child_ages) || ($children != count($child_ages))) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Please provide all children age.'),
)));
} else {
foreach($child_ages as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
die(json_encode(array(
'result' => false,
'error' => Tools::displayError('Invalid children age.'),
)));
}
}
}
}
$rooms_booked = $obj_booking_detail->getRoomBookinInformationForDateRangeByOrder($id_room, $old_date_from, $old_date_to, $new_date_from, $new_date_to);
@@ -2704,6 +2842,13 @@ class AdminOrdersControllerCore extends AdminController
$old_date_to
);
// set occupancy details
$occupancy = array(
'adults' => $adults,
'children' => $children,
'child_ages' => $child_ages
);
/*By webkul to edit the Hotel Cart and Hotel Order tables when editing the room for the order detail page*/
$new_total_price = array(
'tax_excl' => $totalRoomPriceAfterTE,
@@ -2716,6 +2861,7 @@ class AdminOrdersControllerCore extends AdminController
$old_date_to,
$new_date_from,
$new_date_to,
$occupancy,
$new_total_price
)) {
// update extra demands total prices if dates are changes (price calc method for each day)

View File

@@ -109,15 +109,91 @@ class AdminPPreferencesControllerCore extends AdminController
'cast' => 'intval',
'required' => false,
'type' => 'bool'
)
),
'submit' => array('title' => $this->l('Save'))
),
'search' => array(
'title' => $this->l('Search'),
'fields' => array(
'PS_FRONT_SEARCH_TYPE' => array(
'title' => $this->l('Front end search type'),
'hint' => $this->l('Select search type for frontend. In "Occupancy wise search", occupancy field will be shown in the search panel and search will be based on required occupancy by the guest. In "Search without occupancy", All available room types will be shown for the search dates without any occupancy filter.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::SEARCH_TYPE_OWS, 'name' => $this->l('Occupancy wise search')),
array('id' => HotelBookingDetail::SEARCH_TYPE_NORMAL, 'name' => $this->l('Search without occupancy'))
),
'identifier' => 'id',
'desc' => $this->l('Choose "Occupancy wise search" or "Search without occupancy". Occupancy search restriction will depend on this option selection at front end.'),
),
'PS_FRONT_OWS_SEARCH_ALGO_TYPE' => array(
'title' => $this->l('Front end occupancy wise search algorithm'),
'hint' => $this->l('In occupancy wise search at front end, you want to display only room types which are fully satisfying searched occupancy or you want to display all the available room types for the dates searched'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::SEARCH_EXACT_ROOM_TYPE_ALGO, 'name' => $this->l('Show room types satisfying required occupancy')),
array('id' => HotelBookingDetail::SEARCH_ALL_ROOM_TYPE_ALGO, 'name' => $this->l('Show all available room types'))
),
'identifier' => 'id',
'desc' => $this->l('This option is only for fully available rooms. For partially available rooms, always all possible rooms will be displayed.'),
),
'PS_FRONT_ROOM_UNIT_SELECTION_TYPE' => array(
'title' => $this->l('In front-end, add rooms to cart with'),
'hint' => $this->l('In Room occupancy, while adding rooms in cart customer has to select per room occupancy and in room quantity customer only has to select number of rooms.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY, 'name' => $this->l('Room Occupancy')),
array('id' => HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_QUANTITY, 'name' => $this->l('Rooms Quantity (No. of rooms)'))
),
'identifier' => 'id',
),
'PS_BACKOFFICE_SEARCH_TYPE' => array(
'title' => $this->l('Back-office search type'),
'hint' => $this->l('Select search type for Back-office. In "Occupancy wise search", occupancy field will be shown in the search panel and search will be based on required occupancy by the employee. In "Search without occupancy", All available room types will be shown for the search dates without any occupancy filter.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::SEARCH_TYPE_OWS, 'name' => $this->l('Occupancy wise search')),
array('id' => HotelBookingDetail::SEARCH_TYPE_NORMAL, 'name' => $this->l('Search without occupancy'))
),
'identifier' => 'id',
'desc' => $this->l('Choose "Occupancy wise search" or "Search without occupancy". Occupancy search restriction will depend on this option selection at back-office.'),
),
'PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE' => array(
'title' => $this->l('Back-office occupancy wise search algorithm'),
'hint' => $this->l('In occupancy wise search at back-office, you want to display only room types which are fully satisfying searched occupancy or you want to display all the available room types for the dates searched.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::SEARCH_EXACT_ROOM_TYPE_ALGO, 'name' => $this->l('Show room types satisfying required occupancy')),
array('id' => HotelBookingDetail::SEARCH_ALL_ROOM_TYPE_ALGO, 'name' => $this->l('Show all available room types'))
),
'identifier' => 'id',
'desc' => $this->l('This option is only for fully available rooms. For partially available rooms, always all possible rooms will be displayed.'),
),
'PS_BACKOFFICE_ROOM_BOOKING_TYPE' => array(
'title' => $this->l('In back-office, add rooms to cart with'),
'hint' => $this->l('In Room occupancy, while adding rooms in cart customer has to select per room occupancy and in room quantity customer only has to select number of rooms.'),
'cast' => 'intval',
'type' => 'select',
'list' => array(
array('id' => HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY, 'name' => $this->l('Room Occupancy')),
array('id' => HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_QUANTITY, 'name' => $this->l('Rooms Quantity (No. of rooms)'))
),
'identifier' => 'id',
),
'PS_LOS_RESTRICTION_BO' => array(
'title' => $this->l('Apply Min and Max lenght of stay restrictions for back-office bookings'),
'hint' => $this->l('While creating bookings from back-office, apply minimum and maximum lenght of stay restrictions'),
'title' => $this->l('Apply Min and Max lenght of stay restrictions for back-office search'),
'hint' => $this->l('While searching for available rooms from back-office, apply minimum and maximum lenght of stay restrictions'),
'validation' => 'isBool',
'cast' => 'intval',
'required' => false,
'type' => 'bool'
)
),
),
'submit' => array('title' => $this->l('Save'))
),
@@ -306,6 +382,29 @@ class AdminPPreferencesControllerCore extends AdminController
// 'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();advancedStockManagementActivationAuthorization();</script>',
// 'submit' => array('title' => $this->l('Save'))
// ),
'fo_search_filters' => array(
'title' => $this->l('Search Results Page Filters'),
'icon' => 'icon-search',
'fields' => array(
'SHOW_AMENITIES_FILTER' => array(
'title' => $this->l('Show Amenities filter'),
'hint' => $this->l('Enable to display Amenities filter.'),
'validation' => 'isBool',
'cast' => 'intval',
'required' => false,
'type' => 'bool',
),
'SHOW_PRICE_FILTER' => array(
'title' => $this->l('Show Price filter'),
'hint' => $this->l('Enable to display Price filter.'),
'validation' => 'isBool',
'cast' => 'intval',
'required' => false,
'type' => 'bool',
),
),
'submit' => array('title' => $this->l('Save'))
),
);
}
@@ -333,9 +432,28 @@ class AdminPPreferencesControllerCore extends AdminController
Db::getInstance()->execute($sql);
}
if (Tools::getValue('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$_POST['PS_FRONT_ROOM_UNIT_SELECTION_TYPE'] = HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
}
if (Tools::getValue('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
$_POST['PS_BACKOFFICE_ROOM_BOOKING_TYPE'] = HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
}
if (Tools::getIsset('PS_CATALOG_MODE')) {
Tools::clearSmartyCache();
Media::clearCache();
}
}
public function setMedia()
{
parent::setMedia();
Media::addJsDef(array(
'SEARCH_TYPE_OWS' => HotelBookingDetail::SEARCH_TYPE_OWS
));
$this->addJS(_PS_JS_DIR_.'admin/ppreferences.js');
}
}

View File

@@ -113,6 +113,7 @@ class AdminProductsControllerCore extends AdminController
'Configuration' => $this->l('Configuration'),
'Occupancy' => $this->l('Occupancy'),
'LengthOfStay' => $this->l('Length of Stay'),
'AdditionalFacilities' => $this->l('Additional Facilities'),
);
$this->available_tabs = array('Warehouses' => 14);
@@ -134,6 +135,7 @@ class AdminProductsControllerCore extends AdminController
'Configuration' => 14,
'Occupancy' => 15,
'LengthOfStay' => 16,
'AdditionalFacilities' => 17,
));
}
@@ -211,7 +213,7 @@ class AdminProductsControllerCore extends AdminController
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)';
$this->_select .= ' (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
$this->_select .= 'hrt.`adult`, hrt.`children`, hb.`id` as id_hotel, aa.`city`, hbl.`hotel_name`, ';
$this->_select .= 'hrt.`adults`, hrt.`children`, hb.`id` as id_hotel, aa.`city`, hbl.`hotel_name`, ';
$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
$this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
@@ -253,9 +255,9 @@ class AdminProductsControllerCore extends AdminController
'callback' => 'getHotelName',
);
}
$this->fields_list['adult'] = array(
$this->fields_list['adults'] = array(
'title' => $this->l('Adults'),
'filter_key' => 'hrt!adult',
'filter_key' => 'hrt!adults',
'align' => 'center',
);
$this->fields_list['child'] = array(
@@ -2228,6 +2230,9 @@ class AdminProductsControllerCore extends AdminController
if ($this->isTabSubmitted('Configuration')) {
$this->processConfiguration();
}
if ($this->isTabSubmitted('AdditionalFacilities')) {
$this->processAdditionalFacilities();
}
$this->updatePackItems($object);
// Disallow avanced stock management if the product become a pack
@@ -3433,6 +3438,7 @@ class AdminProductsControllerCore extends AdminController
} else {
$this->displayWarning($this->l('You must save this room type before managing occupancy.'));
}
$smartyVars['currency'] = $this->context->currency;
$data->assign($smartyVars);
$this->tpl_form_vars['custom_form'] = $data->fetch();
}
@@ -3449,16 +3455,48 @@ class AdminProductsControllerCore extends AdminController
if (Validate::isLoadedObject($objRoomType = new HotelRoomType($idHtlRoomType))) {
$baseAdults = Tools::getValue('base_adults');
$baseChildren = Tools::getValue('base_children');
$maxAdults = Tools::getValue('max_adults');
$maxChildren = Tools::getValue('max_children');
$maxGuests = Tools::getValue('max_guests');
if (!$baseAdults || !Validate::isUnsignedInt($baseAdults)) {
$this->errors[] = Tools::displayError('Invalid base adults');
}
if (!Validate::isUnsignedInt($baseChildren)) {
if ($baseChildren == '' || !Validate::isUnsignedInt($baseChildren)) {
$this->errors[] = Tools::displayError('Invalid base children');
} else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
if ($baseChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
$this->errors[] = sprintf(Tools::displayError('Base children cannot be greater than max childern allowed on your website (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
}
}
if (!$maxAdults || !Validate::isUnsignedInt($maxAdults)) {
$this->errors[] = Tools::displayError('Invalid maximum number of adults');
} elseif ($maxAdults < $baseAdults) {
$this->errors[] = Tools::displayError('Maximum number of adults cannot be less than base adults');
}
if ($maxChildren == '' || !Validate::isUnsignedInt($maxChildren)) {
$this->errors[] = Tools::displayError('Invalid maximum number of children');
} else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
if ($maxChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) {
$this->errors[] = sprintf(Tools::displayError('Maximum number of children cannot be greater than max childern allowed on your website (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'));
}
} elseif ($maxChildren < $baseChildren) {
$this->errors[] = Tools::displayError('Maximum number of children cannot be less than base children');
}
if (!$maxGuests || !Validate::isUnsignedInt($maxGuests)) {
$this->errors[] = Tools::displayError('Invalid maximum number of guests');
} elseif ($maxGuests < ($baseAdults + $baseChildren)) {
$this->errors[] = Tools::displayError('Maximum number of guests cannot be less than base occupancy of adults and children');
} elseif ($maxGuests > ($maxChildren + $maxAdults)) {
$this->errors[] = Tools::displayError('Maximum number of guests cannot be more than max occupancy of adults and children');
}
if (!count($this->errors)) {
$objRoomType->adult = $baseAdults;
$objRoomType->adults = $baseAdults;
$objRoomType->children = $baseChildren;
$objRoomType->max_adults = $maxAdults;
$objRoomType->max_children = $maxChildren;
$objRoomType->max_guests = $maxGuests;
$objRoomType->save();
}
} else {
@@ -3469,7 +3507,7 @@ class AdminProductsControllerCore extends AdminController
}
}
}
// send information for the length of stay tab
public function initFormLengthOfStay($product)
{
@@ -3751,6 +3789,122 @@ class AdminProductsControllerCore extends AdminController
die('0');
}
public function initFormAdditionalFacilities($obj)
{
$data = $this->createTemplate($this->tpl_form);
if ($obj->id) {
$objGlobalDemand = new HotelRoomTypeGlobalDemand();
$allDemands = $objGlobalDemand->getAllDemands();
$objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
// get room type additional facilities
$objRoomDemand = new HotelRoomTypeDemand();
$roomDemandPrices = $objRoomDemand->getRoomTypeDemands($obj->id, 0, 0);
$data->assign(array(
'product' => $obj,
'roomDemandPrices' => $roomDemandPrices,
'allDemands' => $allDemands,
'defaultcurrencySign' => $objCurrency->sign,
));
} else {
$this->displayWarning($this->l('You must save this room type before managing additional facilities.'));
}
$this->tpl_form_vars['custom_form'] = $data->fetch();
}
public function processAdditionalFacilities()
{
if ($idProduct = Tools::getValue('id_product')) {
$objRoomTypeDemand = new HotelRoomTypeDemand();
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
// first delete all the previously saved prices and demands of this room type
$objRoomTypeDemand->deleteRoomTypeDemands($idProduct);
$objRoomTypeDemandPrice->deleteRoomTypeDemandPrices($idProduct);
if ($selectedDemands = Tools::getValue('selected_demand')) {
$objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption();
foreach ($selectedDemands as $idGlobalDemand) {
if (Validate::isLoadedObject($objGlobalDemand = new HotelRoomTypeGlobalDemand($idGlobalDemand))) {
// save selected demands for this room type
$objRoomTypeDemand = new HotelRoomTypeDemand();
$objRoomTypeDemand->id_product = $idProduct;
$objRoomTypeDemand->id_global_demand = $idGlobalDemand;
$objRoomTypeDemand->save();
// save selected demands prices for this room type
$demandPrice = Tools::getValue('demand_price_'.$idGlobalDemand);
if (Validate::isPrice($demandPrice)) {
if ($objGlobalDemand->price != $demandPrice) {
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
$objRoomTypeDemandPrice->id_product = $idProduct;
$objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand;
$objRoomTypeDemandPrice->id_option = 0;
$objRoomTypeDemandPrice->price = $demandPrice;
$objRoomTypeDemandPrice->save();
}
} else {
$this->errors[] = Tools::displayError('Invalid demand price of facility.').
' : '.$objGlobalDemand->name[$this->context->language->id];
}
if ($advOptions = $objAdvOption->getGlobalDemandAdvanceOptions($idGlobalDemand)) {
foreach ($advOptions as $option) {
if (Validate::isLoadedObject($objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption($option['id']))) {
$optionPrice = Tools::getValue('option_price_'.$option['id']);
if (Validate::isPrice($optionPrice)) {
if ($optionPrice != $objAdvOption->price) {
$objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice();
$objRoomTypeDemandPrice->id_product = $idProduct;
$objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand;
$objRoomTypeDemandPrice->id_option = $option['id'];
$objRoomTypeDemandPrice->price = $optionPrice;
$objRoomTypeDemandPrice->save();
}
} else {
$this->errors[] = Tools::displayError('Invalid price of advanced option: ').$objAdvOption->name[$this->context->language->id];
}
}
}
}
}
}
if (count($this->errors)) {
$this->warnings[] = Tools::displayError('Invalid price values are not saved. Please correct them and save again.');
}
$objCartBookingData = new HotelCartBookingData();
if ($cartExtraDemands = $objCartBookingData->getCartExtraDemands(0, $idProduct)) {
// delete the demands from cart if not available in cart
$objRoomDemand = new HotelRoomTypeDemand();
$roomTypeDemandIds = array();
if ($roomTypeDemands = $objRoomDemand->getRoomTypeDemands($idProduct)) {
$roomTypeDemandIds = array_keys($roomTypeDemands);
}
foreach ($cartExtraDemands as &$demandInfo) {
if (isset($demandInfo['extra_demands']) && $demandInfo['extra_demands']) {
$cartChanged = 0;
foreach ($demandInfo['extra_demands'] as $key => $demand) {
if (!in_array($demand['id_global_demand'], $roomTypeDemandIds)) {
$cartChanged = 1;
unset($demandInfo['extra_demands'][$key]);
}
}
if ($cartChanged) {
if (Validate::isLoadedObject(
$objCartBooking = new HotelCartBookingData($demandInfo['id'])
)) {
$objCartBooking->extra_demands = json_encode($demandInfo['extra_demands']);
$objCartBooking->save();
}
}
}
}
}
}
}
}
/**
* @param Product $obj
*

View File

@@ -34,11 +34,14 @@ class AdminSlipControllerCore extends AdminController
$this->bootstrap = true;
$this->table = 'order_slip';
$this->className = 'OrderSlip';
$this->list_no_link = true;
$this->_select = ' o.`id_shop`';
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (o.`id_order` = a.`id_order`)';
$this->_group = ' GROUP BY a.`id_order_slip`';
$this->addRowAction('statusChange');
$this->fields_list = array(
'id_order_slip' => array(
'title' => $this->l('ID'),
@@ -63,7 +66,26 @@ class AdminSlipControllerCore extends AdminController
'callback' => 'printPDFIcons',
'orderby' => false,
'search' => false,
'remove_onclick' => true)
'remove_onclick' => true
),
'redeem_status' => array(
'title' => $this->l('Status'),
'type' => 'select',
'list' => array(
OrderSlip::REDEEM_STATUS_ACTIVE => $this->l('Active'),
OrderSlip::REDEEM_STATUS_REDEEMED => $this->l('Redeemed'),
),
'align' => 'center',
'filter_key' => 'a!redeem_status',
'callback' => 'displayRedeemStatus',
'class' => 'fixed-width-md',
),
'id_cart_rule' => array(
'title' => $this->l('Voucher'),
'align' => 'center',
'callback' => 'displayVoucherLink',
'class' => 'fixed-width-lg',
),
);
$this->_select = 'a.id_order_slip AS id_pdf';
@@ -162,6 +184,38 @@ class AdminSlipControllerCore extends AdminController
}
}
public function processStatusChange()
{
$idOrderSlip = Tools::getValue('id_order_slip');
$objOrderSlip = new OrderSlip($idOrderSlip);
if (!Validate::isLoadedObject($objOrderSlip)) {
$this->errors[] = $this->l('The credit slip can not be loaded.');
} elseif ($objOrderSlip->redeem_status != OrderSlip::REDEEM_STATUS_ACTIVE) {
$this->errors[] = $this->l('The status for this credit slip can not be changed.');
} else {
$objOrder = new Order($objOrderSlip->id_order);
$objCustomer = new Customer($objOrderSlip->id_customer);
if (!Validate::isLoadedObject($objOrder)) {
$this->errors[] = $this->l('The related order for this credit slip can not be loaded.');
}
if (!Validate::isLoadedObject($objCustomer)) {
$this->errors[] = $this->l('The related customer for this credit slip can not be loaded.');
}
}
if (!count($this->errors)) {
$objOrderSlip->redeem_status = OrderSlip::REDEEM_STATUS_REDEEMED;
if ($objOrderSlip->save()) {
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4');
}
$this->errors[] = $this->l('Something went wrong while changing status.');
}
}
public function initContent()
{
$this->initTabModuleList();
@@ -202,4 +256,43 @@ class AdminSlipControllerCore extends AdminController
return $this->createTemplate('_print_pdf_icon.tpl')->fetch();
}
public function displayRedeemStatus($redeemStatus, $row)
{
$this->context->smarty->assign(array(
'redeem_status' => $redeemStatus,
));
return $this->createTemplate('_redeem_status.tpl')->fetch();
}
public function displayVoucherLink($idCartRule, $row)
{
if ($row['redeem_status'] == OrderSlip::REDEEM_STATUS_REDEEMED && $idCartRule) {
$this->context->smarty->assign(array(
'id_cart_rule' => (int) $idCartRule,
));
return $this->createTemplate('_display_voucher_link.tpl')->fetch();
}
return '--';
}
public function displayStatusChangeLink($token = null, $id)
{
$objOrderSlip = new OrderSlip($id);
if ($objOrderSlip->redeem_status != OrderSlip::REDEEM_STATUS_REDEEMED) {
$statusChangeLink = self::$currentIndex.'&'.$this->identifier.'='.$id.'&action=statusChange'.
'&token='.($token != null ? $token : $this->token);
$this->context->smarty->assign(array(
'status_change_link' => $statusChangeLink,
));
return $this->createTemplate('_status_change_link.tpl')->fetch();
}
return '--';
}
}

View File

@@ -842,7 +842,9 @@ class AdminStatsControllerCore extends AdminStatsTabController
$totalDepartures = Db::getInstance()->getValue(
'SELECT COUNT(hbd.`id_room`)
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0
WHERE hbd.`is_refunded` = 0
AND ((hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.') OR
(hbd.`check_in` != "0000:00:00 00:00:00" AND hbd.`check_out` != "0000:00:00 00:00:00"))
AND hbd.`date_to` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'.
HotelBranchInformation::addHotelRestriction($idHotel, 'hbd')
);
@@ -850,9 +852,10 @@ class AdminStatsControllerCore extends AdminStatsTabController
$departed = Db::getInstance()->getValue(
'SELECT COUNT(hbd.`id_room`)
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0
WHERE hbd.`is_refunded` = 0
AND hbd.`date_to` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"
AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_OUT.
AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_OUT.'
AND hbd.`check_in` != "0000:00:00 00:00:00"'.
HotelBranchInformation::addHotelRestriction($idHotel, 'hbd')
);
@@ -900,7 +903,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
public static function getGuestsByDate($date, $idHotel = false)
{
return Db::getInstance()->getRow(
'SELECT SUM(hbd.`adult`) AS `adults`, SUM(hbd.`children`) AS `children`
'SELECT SUM(hbd.`adults`) AS `adults`, SUM(hbd.`children`) AS `children`
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0
AND hbd.`date_from` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'.
@@ -1136,6 +1139,87 @@ class AdminStatsControllerCore extends AdminStatsTabController
);
}
public static function getArrivalsInfoByDate($date, $idHotel = null)
{
$sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name,
DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`)
WHERE hbd.`is_refunded` = 0 AND hbd.`date_from` = "'.pSQL($date).' 00:00:00"
AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_IN.'
AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_OUT.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
$result = Db::getInstance()->executeS($sql);
return $result;
}
public static function getDeparturesInfoByDate($date, $idHotel = null)
{
$sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name,
DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`)
WHERE hbd.`is_refunded` = 0 AND hbd.`date_to` = "'.pSQL($date).' 00:00:00"
AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
$result = Db::getInstance()->executeS($sql);
return $result;
}
public static function getInHousesInfo($idHotel = null)
{
$sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name,
DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`)
WHERE hbd.`is_refunded` = 0 AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '');
$result = Db::getInstance()->executeS($sql);
return $result;
}
public static function getNewBookingsInfoByDate($date, $idHotel = null)
{
$sql = 'SELECT hbd.`id_customer`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name,
COUNT(hbd.`id`) AS total_rooms, SUM(hbd.`adult` + hbd.`children`) AS total_guests,
hbd.`id_hotel`, hbd.`hotel_name`, hbd.`id_order`, o.`total_paid_tax_excl`, o.`id_currency`, osl.`name` AS `state_name`
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`)
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl
ON (osl.`id_order_state` = o.`current_state` AND osl.`id_lang` = '.(int) Context::getContext()->language->id.')
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`)
WHERE hbd.`date_add` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
GROUP BY hbd.`id_order`';
$result = Db::getInstance()->executeS($sql);
return $result;
}
public static function getCancellationsInfoByDate($date, $idHotel = null)
{
$sql = 'SELECT orr.`id_order_return`, orr.`id_customer`, hbd.`room_num`, hbd.`id_product`, hbd.`room_type_name`,
CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name,
hbd.`id_hotel`, hbd.`hotel_name`, SUM(hbd.`adult` + hbd.`children`) AS total_guests,
hbd.`date_from`, hbd.`date_to`, orr.`id_order`
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (ord.`id_order_return` = orr.`id_order_return`)
LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = orr.`id_order`)
LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = ord.`id_htl_booking`)
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = orr.`id_customer`)
WHERE orr.`date_add` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"
AND orr.`state` = '.(int) OrderReturnState::ORDER_RETRUN_FIRST_STATUS.
(!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').'
GROUP BY ord.`id_htl_booking`
ORDER BY orr.`date_add` DESC';
$result = Db::getInstance()->executeS($sql);
return $result;
}
public static function getOccupiedRoomsForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)
{
$dateTo = !$dateTo ? date('Y-m-d', strtotime('+1 day', strtotime($dateFrom))) : $dateTo;

View File

@@ -176,15 +176,16 @@ class CartControllerCore extends FrontController
$result = $objCartBooking->deleteCartBookingData($id_cart, $id_product, 0, 0, 0, 0);
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($id_product)) {
if ($id_hotel = $roomTypeInfo['id_hotel']) {
$obj_booking_dtl = new HotelBookingDetail();
if ($hotel_room_data = $obj_booking_dtl->DataForFrontSearch(
$date_from,
$date_to,
$id_hotel,
$id_product,
1
)) {
$total_available_rooms = $hotel_room_data['stats']['num_avail'];
$objBookingDetail = new HotelBookingDetail();
$bookingParams = array(
'date_from' => $date_from,
'date_to' => $date_to,
'hotel_id' => $id_hotel,
'id_room_type' => $id_product,
'only_search_data' => 1,
);
if ($hotelRoomData = $objBookingDetail->dataForFrontSearch($bookingParams)) {
$total_available_rooms = $hotelRoomData['stats']['num_avail'];
}
}
}
@@ -267,11 +268,27 @@ class CartControllerCore extends FrontController
$date_to = Tools::getValue('dateTo');
$date_from = date("Y-m-d", strtotime($date_from));
$date_to = date("Y-m-d", strtotime($date_to));
$operator = Tools::getValue('op', 'up');
$occupancyRequiredForBooking = false;
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$occupancyRequiredForBooking = true;
}
if ($occupancyRequiredForBooking) {
if ($occupancy = json_decode(Tools::getValue('occupancy'), true)) {
$this->qty = count($occupancy);
} else {
$this->errors[] = Tools::displayError('Invalid occupnacy.');
}
} else {
$occupancy = Tools::getValue('qty');
$this->qty = $occupancy;
}
$id_cart = $this->context->cart->id;
$id_guest = $this->context->cart->id_guest;
if ($this->qty == 0) {
$this->errors[] = Tools::displayError('Null quantity.', !Tools::getValue('ajax'));
} elseif (!$this->id_product) {
@@ -284,71 +301,106 @@ class CartControllerCore extends FrontController
return;
}
$qty_to_check = $this->qty;
$cart_products = $this->context->cart->getProducts();
// By Webkul : This code is to check available quantity of Room before adding it to cart.
// only check availability if qty is increasing
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
$objRoomType = new HotelRoomType();
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($this->id_product)) {
if ($id_hotel = $roomTypeInfo['id_hotel']) {
if (strtotime($date_from) < strtotime(date('Y-m-d'))) {
$this->errors[] = Tools::displayError('You can\'t book room before current date');
} elseif (strtotime($date_from) >= strtotime($date_to)) {
$this->errors[] = Tools::displayError('Check-out date must be after check-in date');
} elseif ($maxOrdDate = HotelOrderRestrictDate::getMaxOrderDate($id_hotel)) {
// Check Order restrict condition before adding in to cart
if (strtotime('-1 day', strtotime($maxOrdDate)) < strtotime($date_from)
|| strtotime($maxOrdDate) < strtotime($date_to)
) {
$maxOrdDate = date('d-m-Y', strtotime($maxOrdDate));
$this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate);
}
// valdiate occupancy if providede
if ($operator == 'up') {
if ($occupancyRequiredForBooking) {
foreach($occupancy as $key => $roomOccupancy) {
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of adults for Room %s.'), ($key + 1));
}
if (isset($roomOccupancy['children'])) {
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
$this->errors[] = sprintf(Tools::displayError('Invalid number of children for Room %s.'), ($key + 1));
}
if (!$this->errors) {
$objBookingDtl = new HotelBookingDetail();
$num_days = $objBookingDtl->getNumberOfDays($date_from, $date_to);
$req_rm = $this->qty;
$this->qty = $this->qty * (int) $num_days;
$obj_booking_dtl = new HotelBookingDetail();
if ($hotel_room_data = $obj_booking_dtl->DataForFrontSearch(
$date_from,
$date_to,
$id_hotel,
$this->id_product,
1,
0,
0,
-1,
0,
0,
$id_cart,
$id_guest
)) {
if (isset($hotel_room_data['stats']['num_avail'])) {
$total_available_rooms = $hotel_room_data['stats']['num_avail'];
if (Tools::getValue('op', 'up') == 'up') {
if ($total_available_rooms < $req_rm) {
die(json_encode(array('status' => 'unavailable_quantity', 'avail_rooms' => $total_available_rooms)));
if ($roomOccupancy['children'] > 0) {
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
$this->errors[] = sprintf(Tools::displayError('Please provide all children age for Room %s.'), ($key + 1));
} else {
if (is_array($roomOccupancy['child_ages'])) {
foreach($roomOccupancy['child_ages'] as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
$this->errors[] = sprintf(Tools::displayError('Invalid children age for Room %s.'), ($key + 1));
}
}
} else {
$this->errors[] = Tools::displayError('Rooms are unavailable. Please try with different dates');
}
}
}
}
}
}
}
// By Webkul : This code is to check available quantity of Room before adding it to cart.
// only check availability if qty is increasing
if (!$this->errors) {
$objRoomType = new HotelRoomType();
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($this->id_product)) {
if ($id_hotel = $roomTypeInfo['id_hotel']) {
if (strtotime($date_from) < strtotime(date('Y-m-d'))) {
$this->errors[] = Tools::displayError('You can\'t book room before current date');
} elseif (strtotime($date_from) >= strtotime($date_to)) {
$this->errors[] = Tools::displayError('Check-out date must be after check-in date');
} elseif ($maxOrdDate = HotelOrderRestrictDate::getMaxOrderDate($id_hotel)) {
// Check Order restrict condition before adding in to cart
if (strtotime('-1 day', strtotime($maxOrdDate)) < strtotime($date_from)
|| strtotime($maxOrdDate) < strtotime($date_to)
) {
$maxOrdDate = date('d-m-Y', strtotime($maxOrdDate));
$this->errors[] = Tools::displayError('You can\'t book room after date '.$maxOrdDate);
}
}
if ($occupancyRequiredForBooking) {
foreach($occupancy as $key => $roomOccupancy) {
if ($roomOccupancy['adults'] > $roomTypeInfo['max_adults']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have adults more than %s'), $key + 1, $roomTypeInfo['max_adults']);
}
if ($roomOccupancy['children'] > $roomTypeInfo['max_children']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have children more than %s'), $key + 1, $roomTypeInfo['max_children']);
}
if ($roomOccupancy['adults'] + $roomOccupancy['children'] > $roomTypeInfo['max_guests']) {
$this->errors[] = sprintf(Tools::displayError('Room %s cannot have total guests more than %s'), $key + 1, $roomTypeInfo['max_guests']);
}
}
}
if (!$this->errors) {
$objBookingDetail = new HotelBookingDetail();
$num_days = $objBookingDetail->getNumberOfDays($date_from, $date_to);
$req_rm = $this->qty;
$this->qty = $this->qty * (int) $num_days;
$objBookingDetail = new HotelBookingDetail();
$bookingParams = array(
'date_from' => $date_from,
'date_to' => $date_to,
'hotel_id' => $id_hotel,
'id_room_type' => $this->id_product,
'only_search_data' => 1,
'id_cart' => $id_cart,
'id_guest' => $id_guest,
);
if ($hotelRoomData = $objBookingDetail->dataForFrontSearch($bookingParams)) {
if (isset($hotelRoomData['stats']['num_avail'])) {
$total_available_rooms = $hotelRoomData['stats']['num_avail'];
if (Tools::getValue('op', 'up') == 'up') {
if ($total_available_rooms < $req_rm) {
die(json_encode(array('status' => 'unavailable_quantity', 'avail_rooms' => $total_available_rooms)));
}
}
} else {
$this->errors[] = Tools::displayError('Rooms are unavailable. Please try with different dates');
}
} else {
$this->errors[] = Tools::displayError('Rooms are unavailable. Please try with different dates');
}
} else {
die(json_encode(array('status' => 'failed3')));
}
} else {
die(json_encode(array('status' => 'failed4')));
die(json_encode(array('status' => 'failed3')));
}
} else {
die(json_encode(array('status' => 'failed4')));
}
}
$cart_products = $this->context->cart->getProducts();
$qty_to_check = $this->qty;
if (is_array($cart_products)) {
foreach ($cart_products as $cart_product) {
if ((!isset($this->id_product_attribute) || $cart_product['id_product_attribute'] == $this->id_product_attribute) &&
@@ -411,54 +463,37 @@ class CartControllerCore extends FrontController
/*
* To add Rooms in hotel cart
*/
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
if (Tools::getValue('op', 'up') == 'up') {
$update_quantity = $this->context->cart->updateQty($this->qty, $this->id_product, $this->id_product_attribute, $this->customization_id, Tools::getValue('op', 'up'), $this->id_address_delivery);
$this->availQty = false;
$id_customer = $this->context->cart->id_customer;
$id_currency = $this->context->cart->id_currency;
$hotel_room_info_arr = $hotel_room_data['rm_data'][0]['data']['available'];
$chkQty = 0;
foreach ($hotel_room_info_arr as $key_hotel_room_info => $val_hotel_room_info) {
if ($chkQty < $req_rm) {
$roomDemand = Tools::getValue('roomDemands');
$roomDemand = json_decode($roomDemand, true);
$roomDemand = json_encode($roomDemand);
$obj_htl_cart_booking_data = new HotelCartBookingData();
$obj_htl_cart_booking_data->id_cart = $this->context->cart->id;
$obj_htl_cart_booking_data->id_guest = $this->context->cart->id_guest;
$obj_htl_cart_booking_data->id_customer = $id_customer;
$obj_htl_cart_booking_data->id_currency = $id_currency;
$obj_htl_cart_booking_data->id_product = $val_hotel_room_info['id_product'];
$obj_htl_cart_booking_data->id_room = $val_hotel_room_info['id_room'];
$obj_htl_cart_booking_data->id_hotel = $val_hotel_room_info['id_hotel'];
$obj_htl_cart_booking_data->booking_type = HotelBookingDetail::ALLOTMENT_AUTO;
$obj_htl_cart_booking_data->quantity = $num_days;
$obj_htl_cart_booking_data->extra_demands = $roomDemand;
$obj_htl_cart_booking_data->date_from = $date_from;
$obj_htl_cart_booking_data->date_to = $date_to;
$obj_htl_cart_booking_data->save();
++$chkQty;
} else {
break;
}
}
$this->availQty = $total_available_rooms - $req_rm;
} else {
$objCartBooking = new HotelCartBookingData();
$update_quantity = $objCartBooking->deleteCartBookingData(
$id_cart,
$this->id_product,
0,
$date_from,
$date_to
);
$this->availQty = $total_available_rooms + $req_rm;
}
$this->context->cookie->avail_rooms = $this->availQty;
$objHotelCartBookingData = new HotelCartBookingData();
$roomDemand = json_decode(Tools::getValue('roomDemands'), true);
$roomDemand = json_encode($roomDemand);
$this->availQty = $total_available_rooms;
$update_quantity = $objHotelCartBookingData->updateRoomCartBookingData(
$this->id_product,
$occupancy,
$operator,
$id_hotel,
$date_from,
$date_to,
$roomDemand,
$id_cart,
$id_guest
);
if ($operator == 'up') {
$this->availQty = $total_available_rooms - $req_rm;
$this->context->cookie->currentAddedProduct = json_encode(array(
'date_from' => $date_from,
'date_to' => $date_to,
'id_product' => $this->id_product,
'occupancy' => $occupancy,
'room_demand' => $roomDemand,
'req_rm' => $req_rm
));
} else {
$this->availQty = $total_available_rooms + $req_rm;
}
$this->context->cookie->avail_rooms = $this->availQty;
/*------ BY Webkul ------*/
if ($update_quantity < 0) {

View File

@@ -57,6 +57,9 @@ class CategoryControllerCore extends FrontController
));
}
$this->addCSS(_THEME_CSS_DIR_.'occupancy.css');
$this->addJS(_THEME_JS_DIR_.'occupancy.js');
$scenes = Scene::getScenes($this->category->id, $this->context->language->id, true, false);
if ($scenes && count($scenes)) {
$this->addJS(_THEME_JS_DIR_.'scenes.js');
@@ -99,11 +102,15 @@ class CategoryControllerCore extends FrontController
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
if ($dateFrom != '' && !Validate::isDate($dateFrom)) {
$currentTimestamp = strtotime(date('Y-m-d'));
$dateFromTimestamp = strtotime($dateFrom);
$dateToTimestamp = strtotime($dateTo);
if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $currentTimestamp))) {
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
}
if ($dateTo != '' && !Validate::isDate($dateTo)) {
if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $currentTimestamp))) {
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
}
@@ -150,6 +157,9 @@ class CategoryControllerCore extends FrontController
$date_to = date('Y-m-d', strtotime($date_from) + 86400);
}
// get occupancy of the search
$occupancy = Tools::getValue('occupancy');
$currency = new Currency($this->context->currency->id);
if (Module::isInstalled('hotelreservationsystem')) {
@@ -160,8 +170,18 @@ class CategoryControllerCore extends FrontController
$id_cart = $this->context->cart->id;
$id_guest = $this->context->cookie->id_guest;
$obj_booking_dtl = new HotelBookingDetail();
$booking_data = $obj_booking_dtl->DataForFrontSearch($date_from, $date_to, $id_hotel, 0, 0, 0, 0, -1, 0, 0, $id_cart, $id_guest);
$objBookingDetail = new HotelBookingDetail();
$bookingParams = array(
'date_from' => $date_from,
'date_to' => $date_to,
'occupancy' => $occupancy,
'hotel_id' => $id_hotel,
'get_total_rooms' => 0,
'id_cart' => $id_cart,
'id_guest' => $id_guest,
);
$booking_data = $objBookingDetail->dataForFrontSearch($bookingParams);
$feat_img_dir = _PS_IMG_.'rf/';
$ratting_img = _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png';
@@ -239,21 +259,24 @@ class CategoryControllerCore extends FrontController
$date_to = Tools::getValue('date_to');
$htl_id_category = Tools::getValue('id_category');
// occupancy of the search
$occupancy = Tools::getValue('occupancy');
$sort_by = Tools::getValue('sort_by');
$sort_value = Tools::getValue('sort_value');
$filter_data = Tools::getValue('filter_data');
$adult = 0;
$child = 0;
$adults = 0;
$children = 0;
$amenities = 0;
$price = 0;
if (!empty($filter_data)) {
foreach ($filter_data as $key => $value) {
if ($key == 'adult') {
$adult = min($value);
if ($key == 'adults') {
$adults = min($value);
} elseif ($key == 'children') {
$child = min($value);
$children = min($value);
} elseif ($key == 'amenities') {
$amenities = array();
foreach ($value as $a_k => $a_v) {
@@ -272,11 +295,21 @@ class CategoryControllerCore extends FrontController
$id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category);
$id_cart = $this->context->cart->id;
$id_guest = $this->context->cookie->id_guest;
$objBookingDetail = new HotelBookingDetail();
$obj_booking_dtl = new HotelBookingDetail();
$booking_data = $obj_booking_dtl->DataForFrontSearch($date_from, $date_to, $id_hotel, 0, 0, $adult, $child, -1, $amenities, $price, $id_cart, $id_guest);
$bookingParams = array(
'date_from' => $date_from,
'date_to' => $date_to,
'hotel_id' => $id_hotel,
'occupancy' => $occupancy,
'amenities' => $amenities,
'price' => $price,
'get_total_rooms' => 0,
'id_cart' => $this->context->cart->id,
'id_guest' => $this->context->cookie->id_guest,
);
$booking_data = $objBookingDetail->dataForFrontSearch($bookingParams);
// reset array keys from 0
$booking_data['rm_data'] = array_values($booking_data['rm_data']);
if ($sort_by && $sort_value) {

View File

@@ -250,7 +250,7 @@ class GuestTrackingControllerCore extends FrontController
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
$cartHotelData[$type_key]['cover_img'] = $cover_img;
$cartHotelData[$type_key]['adult'] = $rm_dtl['adult'];
$cartHotelData[$type_key]['adults'] = $rm_dtl['adults'];
$cartHotelData[$type_key]['children'] = $rm_dtl['children'];
$objBookingDemand = new HotelBookingDemands();

View File

@@ -155,8 +155,9 @@ class OrderConfirmationControllerCore extends FrontController
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
$cart_htl_data[$type_key]['adult'] = $rm_dtl['adult'];
$cart_htl_data[$type_key]['adults'] = $rm_dtl['adults'];
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
foreach ($order_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
/*Product price when order was created*/
@@ -176,6 +177,9 @@ class OrderConfirmationControllerCore extends FrontController
$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]['adults'] += $data_v['adults'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
//// By webkul New way to calculate product prices with feature Prices
$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_incl']/$num_days;
@@ -195,6 +199,10 @@ class OrderConfirmationControllerCore extends FrontController
$cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$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'];
// By webkul New way to calculate product prices with feature Prices
$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_incl']/$num_days;

View File

@@ -246,7 +246,7 @@ class OrderDetailControllerCore extends FrontController
}
}
// Emails to customer, admin on refund request state change
$objOrderReturn->changeIdOrderReturnState(OrderReturnState::ORDER_RETRUN_FIRST_STATUS, $objOrderReturn->id);
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
die(json_encode(array('status' => 1)));
}
@@ -321,8 +321,6 @@ class OrderDetailControllerCore extends FrontController
$rm_dtl = $objRoomType->getRoomTypeInfoByIdProduct($type_value['product_id']);
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
$cartHotelData[$type_key]['cover_img'] = $cover_img;
$cartHotelData[$type_key]['adult'] = $rm_dtl['adult'];
$cartHotelData[$type_key]['children'] = $rm_dtl['children'];
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
@@ -339,6 +337,9 @@ class OrderDetailControllerCore extends FrontController
$num_days = $cartHotelData[$type_key]['date_diff'][$date_join]['num_days'];
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
@@ -355,6 +356,8 @@ class OrderDetailControllerCore extends FrontController
$cartHotelData[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
$cartHotelData[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
$cartHotelData[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
@@ -428,7 +431,6 @@ class OrderDetailControllerCore extends FrontController
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
}
$this->context->smarty->assign(
array(
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),

View File

@@ -53,4 +53,34 @@ class OrderSlipControllerCore extends FrontController
$this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer));
$this->setTemplate(_PS_THEME_DIR_.'order-slip.tpl');
}
public function postProcess()
{
if (Tools::isSubmit('generateVoucher')) {
$idOrderSlip = Tools::getValue('id_order_slip');
$objOrderSlip = new OrderSlip($idOrderSlip);
if (!Validate::isLoadedObject($objOrderSlip)) {
$this->errors[] = Tools::displayError('The credit slip is invalid.');
} elseif ($objOrderSlip->redeem_status == OrderSlip::REDEEM_STATUS_REDEEMED) {
$this->errors[] = Tools::displayError('The credit slip has already been redeemed.');
} elseif ($objOrderSlip->id_customer != $this->context->customer->id) {
$this->errors[] = Tools::displayError('Invalid request.');
}
if (!count($this->errors)) {
if ($objOrderSlip->generateVoucher()) {
Tools::redirect($this->context->link->getPageLink(
$this->php_self,
$this->ssl,
$this->context->language->id,
'confirmation=1'
));
}
$this->errors[] = Tools::displayError('The voucher code for this credit slip could not be generated.');
}
}
parent::postProcess();
}
}

View File

@@ -46,10 +46,10 @@ class ProductControllerCore extends FrontController
$this->addCSS(_THEME_CSS_DIR_.'product.css');
$this->addCSS(_THEME_CSS_DIR_.'print.css', 'print');
$this->addJqueryPlugin(array('fancybox', 'idTabs', 'scrollTo', 'serialScroll', 'bxslider'));
$this->addCSS(_THEME_CSS_DIR_.'datepicker.css');
$this->addJS(array(
_THEME_JS_DIR_.'tools.js', // retro compat themes 1.5
_THEME_JS_DIR_.'product.js'
_THEME_JS_DIR_.'product.js',
));
} else {
$this->addJqueryPlugin(array('scrollTo', 'serialScroll'));
@@ -60,6 +60,9 @@ class ProductControllerCore extends FrontController
));
}
$this->addCSS(_THEME_CSS_DIR_.'occupancy.css');
$this->addJS(_THEME_JS_DIR_.'occupancy.js');
if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) {
$this->addJqueryPlugin('jqzoom');
}
@@ -92,11 +95,15 @@ class ProductControllerCore extends FrontController
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
if ($dateFrom != '' && !Validate::isDate($dateFrom)) {
$currentTimestamp = strtotime(date('Y-m-d'));
$dateFromTimestamp = strtotime($dateFrom);
$dateToTimestamp = strtotime($dateTo);
if ($dateFrom != '' && ($dateFromTimestamp === false || ($dateFromTimestamp < $currentTimestamp))) {
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
}
if ($dateTo != '' && !Validate::isDate($dateTo)) {
if ($dateTo != '' && ($dateToTimestamp === false || ($dateToTimestamp < $currentTimestamp))) {
Tools::redirect($this->context->link->getPageLink('pagenotfound'));
}
@@ -287,7 +294,7 @@ class ProductControllerCore extends FrontController
$obj_hotel_room_type = new HotelRoomType();
$room_info_by_product_id = $obj_hotel_room_type->getRoomTypeInfoByIdProduct($this->product->id);
$productCapacity = array();
$productCapacity['adult'] = $room_info_by_product_id['adult'];
$productCapacity['adults'] = $room_info_by_product_id['adults'];
$productCapacity['children'] = $room_info_by_product_id['children'];
$this->product->capacity = $productCapacity;
$hotel_id = $room_info_by_product_id['id_hotel'];
@@ -359,6 +366,7 @@ class ProductControllerCore extends FrontController
$this->context->smarty->assign(
array(
'room_type_info' => $room_info_by_product_id,
'isHotelRefundable' => $hotel_branch_obj->isRefundable(),
'max_order_date' => $max_order_date,
'preparation_time' => $preparationTime,
@@ -471,7 +479,7 @@ class ProductControllerCore extends FrontController
$idProduct,
$dateFrom,
$dateTo,
$quantity = 1,
$occupancy = array(),
$jsonDemands = ''
) {
$objProduct = new Product($idProduct, true, $this->context->language->id, $this->context->shop->id);
@@ -509,23 +517,22 @@ class ProductControllerCore extends FrontController
}
$numDays = $objBookingDetail->getNumberOfDays($dateFrom, $dateTo);
$hotelRoomData = $objBookingDetail->DataForFrontSearch(
$dateFrom,
$dateTo,
$idHotel,
$idProduct,
1,
0,
0,
-1,
0,
0,
$idCart,
$idGuest
$bookingParams = array(
'date_from' => $dateFrom,
'date_to' => $dateTo,
'hotel_id' => $idHotel,
'id_room_type' => $idProduct,
'id_cart' => $idCart,
'id_guest' => $idGuest,
);
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_FRONT_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
$bookingParams['occupancy'] = $occupancy;
$quantity = count($occupancy);
} else {
$quantity = $occupancy;
}
if ($hotelRoomData) {
if ($hotelRoomData = $objBookingDetail->DataForFrontSearch($bookingParams)) {
$totalAvailableRooms = $hotelRoomData['stats']['num_avail'];
$quantity = ($quantity > $totalAvailableRooms) ? $totalAvailableRooms : $quantity;
}
@@ -580,6 +587,13 @@ class ProductControllerCore extends FrontController
// calculate total price
$totalPrice = $totalRoomPrice + $demandsPrice;
// send occupancy information searched by the user
if ($this->ajax && $occupancy && is_array($occupancy)) {
$smartyVars['occupancies'] = $occupancy;
$smartyVars['occupancy_adults'] = array_sum(array_column($occupancy, 'adults'));
$smartyVars['occupancy_children'] = array_sum(array_column($occupancy, 'children'));
$smartyVars['occupancy_child_ages'] = array_sum(array_column($occupancy, 'child_ages'));
}
$smartyVars['hotel_location'] = $hotelLocation;
$smartyVars['order_date_restrict'] = $orderDateRestrict;
@@ -1070,7 +1084,7 @@ class ProductControllerCore extends FrontController
$idProduct = (int) Tools::getValue('id_product');
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
$quantity = (int) Tools::getValue('quantity');
$occupancy = Tools::getValue('occupancy');
$roomTypeDemands = Tools::getValue('room_type_demands');
$dateFrom = date('Y-m-d', strtotime($dateFrom));
@@ -1080,7 +1094,7 @@ class ProductControllerCore extends FrontController
$idProduct,
$dateFrom,
$dateTo,
$quantity,
$occupancy,
$roomTypeDemands
)) {
$html = $this->context->smarty->fetch('_partials/booking-form.tpl');
@@ -1091,102 +1105,6 @@ class ProductControllerCore extends FrontController
$this->ajaxDie(json_encode($response));
}
public function displayAjaxCheckRoomAvailabilityAndRate()
{
$result = array();
if ($idProduct = Tools::getValue('id_product')) {
$objHotelRoomType = new HotelRoomType();
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
$quantity = Tools::getValue('qty');
if ($idHotel = $roomTypeInfo['id_hotel']) {
$objBookingDetail = new HotelBookingDetail();
if ($hotelRoomData = $objBookingDetail->DataForFrontSearch(
$dateFrom,
$dateTo,
$idHotel,
$idProduct,
1,
0,
0,
-1,
0,
0,
$this->context->cart->id,
$this->context->cart->id_guest
)) {
$totalAvailRooms = $hotelRoomData['stats']['num_avail'];
if ($totalAvailRooms >= $quantity) {
$totalPrice = 0;
$useTax = HotelBookingDetail::useTax();
$product = new Product($idProduct);
$productPriceWithoutReduction = $product->getPriceWithoutReduct(!$useTax);
$numDays = $objBookingDetail->getNumberOfDays($dateFrom, $dateTo);
$roomTypeDateRangePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$idProduct,
$dateFrom,
$dateTo
);
if ($useTax) {
$priceProduct = Product::getPriceStatic($idProduct, true);
$featurePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($idProduct, $dateFrom, $dateTo, true);
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_incl'];
} else {
$priceProduct = Product::getPriceStatic($idProduct, false);
$featurePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($idProduct, $dateFrom, $dateTo, false);
$roomTypeDateRangePrice = $roomTypeDateRangePrice['total_price_tax_excl'];
}
$featurePriceDiff = (float)($productPriceWithoutReduction - $featurePrice);
//$price_tax_incl = Product::getPriceStatic($idProduct, $price_tax);
$totalRoomPrice = $roomTypeDateRangePrice * $quantity;
$totalPrice += $totalRoomPrice;
$demandsPrice = 0;
if ($roomDemand = Tools::getValue('room_demands')) {
if ($roomDemand = json_decode($roomDemand, true)) {
$objRoomDemandPrice = new HotelRoomTypeDemandPrice();
$demandsPrice = $objRoomDemandPrice->getRoomTypeDemandsTotalPrice(
$idProduct,
$roomDemand,
$useTax,
$dateFrom,
$dateTo
);
$demandsPrice *= $quantity;
$totalPrice += $demandsPrice;
}
}
$result['msg'] = 'success';
$result['quantity'] = (int)$quantity;
$result['total_price'] = $totalPrice;
$result['total_room_price'] = $totalRoomPrice;
$result['extra_demand_price'] = $demandsPrice;
$result['num_days'] = $numDays;
$result['avail_rooms'] = $totalAvailRooms;
$result['original_product_price'] = $priceProduct;
$result['feature_price'] = $featurePrice;
$result['feature_price_diff'] = $featurePriceDiff;
} else {
$result['msg'] = 'unavailable_quantity';
$result['avail_rooms'] = $totalAvailRooms;
}
} else {
$result['msg'] = 'failed1';
$result['avail_rooms'] = $totalAvailRooms;
}
} else {
$result['msg'] = 'failed2';
$result['avail_rooms'] = $totalAvailRooms;
}
}
} else {
$result['msg'] = 'failed3';
$result['avail_rooms'] = 0;
}
die(json_encode($result));
}
public function displayAjaxGetHotelImages()
{
$response = array('status' => false);

View File

@@ -1166,6 +1166,7 @@ CREATE TABLE `PREFIX_orders` (
`valid` int(1) unsigned NOT NULL DEFAULT '0',
`is_advance_payment` tinyint(1) NOT NULL DEFAULT '0',
`advance_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.00',
`with_occupancy` tinyint(1) NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order`),
@@ -1330,6 +1331,8 @@ CREATE TABLE `PREFIX_order_return` (
`refunded_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
`question` text NOT NULL,
`by_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`id_return_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`return_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order_return`),
@@ -1384,6 +1387,8 @@ CREATE TABLE `PREFIX_order_slip` (
`amount` DECIMAL(10,2) NOT NULL,
`shipping_cost_amount` DECIMAL(10,2) NOT NULL,
`partial` TINYINT(1) NOT NULL,
`redeem_status` TINYINT(1) NOT NULL DEFAULT '0',
`id_cart_rule` int(10) unsigned NOT NULL DEFAULT '0',
`order_slip_type` TINYINT(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,

View File

@@ -3,6 +3,8 @@ SET NAMES 'utf8';
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_CONDITIONS';
UPDATE `PREFIX_configuration` SET value = '12' WHERE name = 'PS_PRODUCTS_PER_PAGE';
UPDATE `PREFIX_configuration` SET value = '9' WHERE name = 'PS_HOTEL_IMAGES_PER_PAGE';
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'SHOW_AMENITIES_FILTER';
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'SHOW_PRICE_FILTER';
UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'PS_PRODUCTS_ORDER_WAY';
UPDATE `PREFIX_configuration` SET value = '4' WHERE name = 'PS_PRODUCTS_ORDER_BY';
UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_DISPLAY_QTIES';

View File

@@ -62,6 +62,12 @@
<configuration id="PS_HOTEL_IMAGES_PER_PAGE" name="PS_HOTEL_IMAGES_PER_PAGE">
<value>9</value>
</configuration>
<configuration id="SHOW_AMENITIES_FILTER" name="SHOW_AMENITIES_FILTER">
<value>1</value>
</configuration>
<configuration id="SHOW_PRICE_FILTER" name="SHOW_PRICE_FILTER">
<value>1</value>
</configuration>
<configuration id="PS_PURCHASE_MINIMUM" name="PS_PURCHASE_MINIMUM">
<value>0</value>
</configuration>
@@ -431,6 +437,15 @@
<!-- <configuration id="PS_OS_AWAITING_PARTIAL_PAYMENT" name="PS_OS_AWAITING_PARTIAL_PAYMENT">
<value>13</value>
</configuration> -->
<configuration id="PS_ORS_PENDING" name="PS_ORS_PENDING">
<value>1</value>
</configuration>
<configuration id="PS_ORS_DENIED" name="PS_ORS_DENIED">
<value>2</value>
</configuration>
<configuration id="PS_ORS_REFUNDED" name="PS_ORS_REFUNDED">
<value>3</value>
</configuration>
<configuration id="PS_LEGACY_IMAGES" name="PS_LEGACY_IMAGES">
<value>0</value>
</configuration>
@@ -449,6 +464,9 @@
<configuration id="PS_COOKIE_LIFETIME_BO" name="PS_COOKIE_LIFETIME_BO">
<value>480</value>
</configuration>
<configuration id="PS_COOKIE_SAMESITE" name="PS_COOKIE_SAMESITE">
<value>Lax</value>
</configuration>
<configuration id="PS_RESTRICT_DELIVERED_COUNTRIES" name="PS_RESTRICT_DELIVERED_COUNTRIES">
<value>0</value>
</configuration>

View File

@@ -4,8 +4,7 @@
<field name="color"/>
</fields>
<entities>
<order_return_state id="Waiting_for_confirmation" color="#4169E1" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="0"/>
<order_return_state id="Request_received" color="#32CD32" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="0"/>
<order_return_state id="Pending" color="#4169E1" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="0"/>
<order_return_state id="Refund_denied" color="#DC143C" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="1" refunded="0"/>
<order_return_state id="Refund_completed" color="#108510" send_email_to_customer="1" send_email_to_superadmin="1" send_email_to_employee="1" send_email_to_hotelier="1" denied="0" refunded="1"/>
</entities>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<entity_order_return_state>
<order_return_state id="Waiting_for_confirmation">
<name>Waiting for confirmation</name>
<customer_template>order_refund_waiting_customer</customer_template>
<admin_template>order_refund_waiting_admin</admin_template>
</order_return_state>
<order_return_state id="Request_received">
<name>Request received</name>
<customer_template>order_refund_received_customer</customer_template>
<admin_template>order_refund_received_admin</admin_template>
<order_return_state id="Pending">
<name>Pending</name>
<customer_template>order_refund_pending_customer</customer_template>
<admin_template>order_refund_pending_admin</admin_template>
</order_return_state>
<order_return_state id="Refund_denied">
<name>Refund denied</name>

View File

@@ -383,6 +383,15 @@ function init()
else
{
$('tr#new_product input, tr#new_product select, tr#new_product button').removeAttr('disabled');
$('tr#new_product .booking_guest_occupancy').removeClass('disabled');
if (data.room_type_info) {
$('tr#new_product .max_adults').val(data.room_type_info.max_adults);
$('tr#new_product .max_children').val(data.room_type_info.max_children);
$('tr#new_product .max_guests').val(data.room_type_info.max_guests);
$('tr#new_product .num_adults').attr('max', data.room_type_info.max_adults);
$('tr#new_product .num_children').attr('max', data.room_type_info.max_children);
}
// Keep product variable
current_product = data;
$('#add_product_product_id').val(data.id_product);
@@ -458,10 +467,220 @@ function init()
else
$('#add_product_product_stock').css('font-weight', 'normal').css('color', 'black').css('font-size', '1em');
}
// update occupancy input
// updateOccupancyInput()
// total update
addProductRefreshTotal();
});
function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
{
var adults = 0;
var children = 0;
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
adults += parseInt($(this).val());
});
$(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) {
children += parseInt($(this).val());
});
var guestButtonVal = parseInt(adults) + ' ';
if (parseInt(adults) > 1) {
guestButtonVal += adults_txt;
} else {
guestButtonVal += adult_txt;
}
if (parseInt(children) > 0) {
if (parseInt(children) > 1) {
guestButtonVal += ', ' + parseInt(children) + ' ' + children_txt;
} else {
guestButtonVal += ', ' + parseInt(children) + ' ' + child_txt;
}
}
if (parseInt(rooms) > 1) {
guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
}
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
}
$(document).on('click', '.booking_occupancy_wrapper .remove-room-link', function(e) {
e.preventDefault();
booking_occupancy_inner = $(this).closest('.booking_occupancy_inner');
$(this).closest('.occupancy_info_block').remove();
$(booking_occupancy_inner).find('.room_num_wrapper').each(function(key, val) {
$(this).text(room_txt + ' - '+ (key+1) );
});
setRoomTypeGuestOccupancy($(booking_occupancy_inner).closest('.booking_occupancy_wrapper'));
});
$(document).on('change', '.num_occupancy', function(e) {
let current_room_occupancy = 0;
$(this).closest('.occupancy_info_block').find('.num_occupancy').each(function(){
current_room_occupancy += parseInt($(this).val());
});
let max_guests_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_guests').val();
let max_allowed_for_current = (max_guests_in_room - current_room_occupancy) + parseInt($(this).val());
if ($(this).val() > $(this).attr('max')) {
$(this).val($(this).attr('max'));
}
if ($(this).val() < $(this).attr('min')) {
$(this).val($(this).attr('min'));
}
if ($(this).val() > max_allowed_for_current) {
$(this).val(max_allowed_for_current);
}
if ($(this).hasClass('num_children')) {
var totalChilds = $(this).closest('.occupancy_info_block').find('.guest_child_age').length;
if (totalChilds < $(this).val()) {
let max_child_in_room;
if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) {
max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val();
} else {
max_child_in_room = window.max_child_in_room;
}
if (totalChilds < max_child_in_room) {
$(this).closest('.occupancy_info_block').find('.children_age_info_block').show();
while ($(this).closest('.occupancy_info_block').find('.guest_child_age').length < $(this).val()) {
var roomBlockIndex = parseInt($(this).closest('.occupancy_info_block').attr('occ_block_index'));
var childAgeSelect = '<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">';
childAgeSelect += '<select class="guest_child_age room_occupancies" name="occupancy[' +roomBlockIndex+ '][child_ages][]">';
childAgeSelect += '<option value="-1">' + select_age_txt + '</option>';
childAgeSelect += '<option value="0">' + under_1_age + '</option>';
for (let age = 1; age < max_child_age; age++) {
childAgeSelect += '<option value="'+age+'">'+age+'</option>';
}
childAgeSelect += '</select>';
childAgeSelect += '</p>';
$(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect);
}
}
} else {
let child = $(this).val();
$(this).closest('.occupancy_info_block').find('.guest_child_age').each(function(ind, element) {
if (child <= ind) {
$(element).parent().remove();
}
});
if (child == 0) {
$(this).closest('.occupancy_info_block').find('.children_age_info_block').hide();
}
}
}
setRoomTypeGuestOccupancy($(this).closest('.booking_occupancy_wrapper'));
});
$(document).on('click', '.booking_guest_occupancy:not(.disabled)', function(e) {
$(this).parent().toggleClass('open');
});
$(document).on('click', function(e) {
if ($('.booking_occupancy_wrapper:visible').length) {
var occupancy_wrapper = $('.booking_occupancy_wrapper:visible');
$(occupancy_wrapper).find(".occupancy_info_block").addClass('selected');
if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length)) {
let hasErrors = 0;
let adults = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get();
let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get();
let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get();
// start validating above values
if (!adults.length || (adults.length != children.length)) {
hasErrors = 1;
showErrorMessage(invalid_occupancy_txt);
} else {
$(occupancy_wrapper).find('.occupancy_count').removeClass('error_border');
// validate values of adults and children
adults.forEach(function (item, index) {
if (isNaN(item) || parseInt(item) < 1) {
hasErrors = 1;
$(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border');
}
if (isNaN(children[index])) {
hasErrors = 1;
$(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border');
}
});
// validate values of selected child ages
$(occupancy_wrapper).find('.guest_child_age').parent().removeClass('has-error');
child_ages.forEach(function (age, index) {
age = parseInt(age);
if (isNaN(age) || (age < 0) || (age >= parseInt(max_child_age))) {
hasErrors = 1;
$(occupancy_wrapper).find(".guest_child_age").eq(index).parent().addClass('has-error');
}
});
}
if (hasErrors == 0) {
$(occupancy_wrapper).parent().removeClass('open');
$(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]);
}
}
}
});
$('.booking_occupancy_wrapper .add_new_occupancy_btn').on('click', function(e) {
e.preventDefault();
var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper');
var occupancy_block = '';
var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index'));
roomBlockIndex += 1;
let max_child_in_room;
if ($(this).closest(".booking_occupancy_wrapper").find('.max_children').val()) {
max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val();
} else {
max_child_in_room = window.max_child_in_room;
}
var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length);
countRooms += 1
occupancy_block += '<div class="occupancy_info_block col-sm-12" occ_block_index="'+roomBlockIndex+'">';
occupancy_block += '<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">'+ room_txt + ' - ' + countRooms + '</label><a class="remove-room-link pull-right" href="#">' + remove_txt + '</a></div>';
occupancy_block += '<div class="col-sm-12">';
occupancy_block += '<div class="row">';
occupancy_block += '<div class="form-group col-xs-6 occupancy_count_block">';
occupancy_block += '<label>' + adults_txt + '</label>';
occupancy_block += '<input type="number" class="form-control num_occupancy num_adults" name="occupancy['+roomBlockIndex+'][adults]" value="1" min="1">';
occupancy_block += '</div>';
occupancy_block += '<div class="form-group col-xs-6 occupancy_count_block">';
occupancy_block += '<label>' + child_txt + '<span class="label-desc-txt"></span></label>';
occupancy_block += '<input type="number" class="form-control num_occupancy num_children" name="occupancy['+roomBlockIndex+'][children]" value="0" min="0" max="'+max_child_in_room+'">(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '<div class="row children_age_info_block" style="display:none">';
occupancy_block += '<div class="form-group col-sm-12">';
occupancy_block += '<label class="">' + all_children_txt + '</label>';
occupancy_block += '<div class="">';
occupancy_block += '<div class="row children_ages">';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '<hr class="occupancy-info-separator col-sm-12">';
$(booking_occupancy_wrapper).find('.booking_occupancy_inner').append(occupancy_block);
setRoomTypeGuestOccupancy(booking_occupancy_wrapper);
});
$('input#add_product_product_quantity').on('change', function(){
// updateOccupancyInput()
addProductRefreshTotal();
});
$('#submitAddProduct').unbind('click').click(function(e) {
e.preventDefault();
stopAjaxQuery();
@@ -635,16 +854,13 @@ function init()
if (!element_list.length)
{
element_list = element.parents('.product-line-row');
element_list.find('td .booking_duration_show').hide();
element_list.find('td .booking_duration_edit').show();
}
else
{
element_list.find('td .booking_duration_show').hide();
element_list.find('td .booking_duration_edit').show();
}
element_list.find('td .room_unit_price_show').hide();
element_list.find('td .room_unit_price_edit').show();
element_list.find('td .booking_duration_show').hide();
element_list.find('td .booking_duration_edit').show();
element_list.find('td .booking_occupancy_show').hide();
element_list.find('td .booking_occupancy_edit').show();
//element_list.find('td .product_price_show').hide();
//element_list.find('td .product_price_edit').show();
element_list.find('td.cancelCheck').hide();
@@ -685,6 +901,8 @@ function init()
element_list.find('td .booking_duration_edit').hide();
element_list.find('td .room_unit_price_show').show();
element_list.find('td .room_unit_price_edit').hide();
element_list.find('td .booking_occupancy_show').show();
element_list.find('td .booking_occupancy_edit').hide();
element_list.find('td.product_invoice').hide();
element_list.find('td.cancelCheck').show();
element_list.find('td.cancelQuantity').show();
@@ -724,10 +942,12 @@ function init()
var id_order_detail = $(this).closest('.product-line-row').find('td .edit_product_id_order_detail').val();
//some vaues are added to the query by webkul
query = 'ajax=1&token='+token+'&action=editProductOnOrder&id_order='+id_order+'&id_room='+id_room+'&id_product='+id_product+'&id_hotel='+id_hotel+'&date_from='+date_from+'&date_to='+date_to+'&order_detail_id='+order_detail_id+'&';
if (element_list.length)
if (element_list.length) {
query += element_list.parent().parent().find('input, select, .edit_product_id_order_detail').serialize();
else
} else {
query += element.parent().parent().find('input, select, .edit_product_id_order_detail').serialize();
}
$.ajax({
type: 'POST',
@@ -942,21 +1162,19 @@ function init()
var flagRefund = '';
$(document).ready(function() {
// Used for Cancel bookings/Initiate refund button
$('#desc-order-standard_refund').click(function() {
$('.cancel_product_change_link:visible').trigger('click');
closeAddProduct();
if (flagRefund == 'standard') {
flagRefund = '';
$('.partial_refund_fields').hide();
$('.standard_refund_fields').hide();
}
else {
flagRefund = 'standard';
$('.partial_refund_fields').hide();
$('.standard_refund_fields').fadeIn();
}
if (order_discount_price)
$('.cancel_product_change_link:visible').trigger('click');
if (order_discount_price) {
actualizeTotalRefundVoucher();
}
$('.standard_refund_fields, .order_action').fadeIn();
scroll_if_anchor('#refundForm', 170);
});
$('#cancelRefund').click(function() {
$('.standard_refund_fields').hide();
});
$('#desc-order-partial_refund').click(function() {

48
js/admin/ppreferences.js Normal file
View File

@@ -0,0 +1,48 @@
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
$(document).ready(function() {
setFrontOccupancyView();
$('#PS_FRONT_SEARCH_TYPE').on('change', setFrontOccupancyView);
setBackOccupancyView();
$('#PS_BACKOFFICE_SEARCH_TYPE').on('change', setBackOccupancyView);
function setFrontOccupancyView()
{
if ($('#PS_FRONT_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
$('#PS_FRONT_ROOM_UNIT_SELECTION_TYPE').closest('.form-group').hide('fast');
} else {
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
$('#PS_FRONT_ROOM_UNIT_SELECTION_TYPE').closest('.form-group').show('fast');
}
}
function setBackOccupancyView()
{
if ($('#PS_BACKOFFICE_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').hide('fast');
} else {
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').show('fast');
}
}
});

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015 Chunlong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,460 @@
.date-picker {
width: 170px;
height: 25px;
padding: 0;
border: 0;
line-height: 25px;
padding-left: 10px;
font-size: 12px;
font-family: Arial, sans-serif;
font-weight: bold;
cursor: pointer;
color: #303030;
position: relative;
z-index: 2;
}
.date-picker-wrapper {
position: absolute;
z-index: 1;
border: 1px solid #bfbfbf;
background-color: #efefef;
padding: 5px 12px;
font-size: 12px;
line-height: 20px;
color: #aaa;
font-family: Arial, sans-serif;
-webkit-box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
-webkit-box-sizing: initial;
box-sizing: initial;
}
.dp-clearfix {
clear: both;
height: 0;
font-size: 0;
}
.date-picker-wrapper.inline-wrapper {
position: relative;
-webkit-box-shadow: none;
box-shadow: none;
display: inline-block;
}
.date-picker-wrapper.single-date {
width: auto;
}
.date-picker-wrapper.no-shortcuts {
padding-bottom: 12px;
}
.date-picker-wrapper.no-topbar {
padding-top: 12px;
}
.date-picker-wrapper .footer {
font-size: 11px;
padding-top: 3px;
}
.date-picker-wrapper b {
color: #666;
font-weight: 700;
}
.date-picker-wrapper a {
color: #6bb4d6;
text-decoration: underline;
}
.date-picker-wrapper .month-name {
text-transform: uppercase;
}
.date-picker-wrapper .select-wrapper {
position: relative;
overflow: hidden;
display: inline-block;
vertical-align: middle;
}
.date-picker-wrapper .select-wrapper:hover {
text-decoration: underline;
}
.date-picker-wrapper .month-element {
display: inline-block;
vertical-align: middle;
}
.date-picker-wrapper .select-wrapper select {
position: absolute;
margin: 0;
padding: 0;
left: 0;
top: -1px;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
text-transform: inherit;
color: inherit;
cursor: pointer;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: transparent;
border: 0;
outline: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
filter: alpha(opacity=1);
opacity: 0.01;
}
.date-picker-wrapper .month-wrapper {
border: 1px solid #bfbfbf;
border-radius: 3px;
background-color: #fff;
padding: 5px;
cursor: default;
position: relative;
_overflow: hidden;
}
.date-picker-wrapper .month-wrapper table {
width: 190px;
float: left;
}
.date-picker-wrapper .month-wrapper table.month2 {
width: 190px;
float: left;
}
.date-picker-wrapper .month-wrapper table th, .date-picker-wrapper .month-wrapper table td {
vertical-align: middle;
text-align: center;
line-height: 14px;
margin: 0px;
padding: 0px;
}
.date-picker-wrapper .month-wrapper table .day {
padding: 5px 0;
line-height: 1;
font-size: 12px;
margin-bottom: 1px;
color: #ccc;
cursor: default;
}
.date-picker-wrapper .month-wrapper table div.day.lastMonth, .date-picker-wrapper .month-wrapper table div.day.nextMonth {
color: #999;
cursor: default;
}
.date-picker-wrapper .month-wrapper table .day.checked {
background-color: #9cdbf7;
}
.date-picker-wrapper .month-wrapper table .week-name {
height: 20px;
line-height: 20px;
font-weight: 100;
text-transform: uppercase;
}
.date-picker-wrapper .month-wrapper table .day.has-tooltip {
cursor: help !important;
}
.date-picker-wrapper .month-wrapper table .day.has-tooltip .tooltip {
white-space: nowrap;
}
.date-picker-wrapper .time label {
white-space: nowrap;
}
.date-picker-wrapper .month-wrapper table .day.toMonth.valid {
color: #333;
cursor: pointer;
}
.date-picker-wrapper .month-wrapper table .day.toMonth.hovering {
background-color: #cdecfa;
}
.date-picker-wrapper .month-wrapper table .day.nextMonth, .date-picker-wrapper .month-wrapper table .day.lastMonth {
display: none;
}
.date-picker-wrapper .month-wrapper table .day.real-today {
background-color: #ffe684;
}
.date-picker-wrapper .month-wrapper table .day.real-today.checked, .date-picker-wrapper .month-wrapper table .day.real-today.hovering {
background-color: #70ccd5;
}
.date-picker-wrapper table .caption {
height: 40px;
}
.date-picker-wrapper table .caption > th:first-of-type, .date-picker-wrapper table .caption > th:last-of-type {
width: 27px;
}
.date-picker-wrapper table .caption .next, .date-picker-wrapper table .caption .prev {
padding: 0 5px;
cursor: pointer;
}
.date-picker-wrapper table .caption .next:hover, .date-picker-wrapper table .caption .prev:hover {
background-color: #ccc;
color: white;
}
.date-picker-wrapper .gap {
position: relative;
z-index: 1;
width: 15px;
height: 100%;
background-color: red;
font-size: 0;
line-height: 0;
float: left;
top: -5px;
margin: 0 10px -10px;
visibility: hidden;
height: 0;
}
.date-picker-wrapper .gap .gap-lines {
height: 100%;
overflow: hidden;
}
.date-picker-wrapper .gap .gap-line {
height: 15px;
width: 15px;
position: relative;
}
.date-picker-wrapper .gap .gap-line .gap-1 {
z-index: 1;
height: 0;
border-left: 8px solid white;
border-top: 8px solid #eee;
border-bottom: 8px solid #eee;
}
.date-picker-wrapper .gap .gap-line .gap-2 {
position: absolute;
right: 0;
top: 0px;
z-index: 2;
height: 0;
border-left: 8px solid transparent;
border-top: 8px solid white;
}
.date-picker-wrapper .gap .gap-line .gap-3 {
position: absolute;
right: 0;
top: 8px;
z-index: 2;
height: 0;
border-left: 8px solid transparent;
border-bottom: 8px solid white;
}
.date-picker-wrapper .gap .gap-top-mask {
width: 6px;
height: 1px;
position: absolute;
top: -1px;
left: 1px;
background-color: #eee;
z-index: 3;
}
.date-picker-wrapper .gap .gap-bottom-mask {
width: 6px;
height: 1px;
position: absolute;
bottom: -1px;
left: 7px;
background-color: #eee;
z-index: 3;
}
.date-picker-wrapper .selected-days {
display: none;
}
.date-picker-wrapper .drp_top-bar {
line-height: 1.4;
position: relative;
padding: 10px 40px 10px 0;
}
.date-picker-wrapper .drp_top-bar .error-top, .date-picker-wrapper .drp_top-bar .normal-top {
display: none;
}
.date-picker-wrapper .drp_top-bar .default-top {
display: block;
}
.date-picker-wrapper .drp_top-bar.error .default-top {
display: none;
}
.date-picker-wrapper .drp_top-bar.error .error-top {
display: block;
color: red;
}
.date-picker-wrapper .drp_top-bar.normal .default-top {
display: none;
}
.date-picker-wrapper .drp_top-bar.normal .normal-top {
display: block;
}
.date-picker-wrapper .drp_top-bar.normal .normal-top .selection-top {
color: #333;
}
.date-picker-wrapper .drp_top-bar .apply-btn {
position: absolute;
right: 0px;
top: 6px;
padding: 3px 5px;
margin: 0;
font-size: 12px;
border-radius: 4px;
cursor: pointer;
color: #d9eef7;
border: solid 1px #0076a3;
background: #0095cd;
background: -moz-linear-gradient(top, #00adee, #0078a5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
color: white;
line-height: initial;
}
.date-picker-wrapper .drp_top-bar .apply-btn.disabled {
cursor: pointer;
color: #606060;
border: solid 1px #b7b7b7;
background: #fff;
background: -moz-linear-gradient(top, #fff, #ededed);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
}
.date-picker-wrapper .time {
position: relative;
}
.date-picker-wrapper.single-month .time {
display: block;
}
.date-picker-wrapper .time input[type=range] {
vertical-align: middle;
width: 129px;
padding: 0;
margin: 0;
height: 20px;
}
.date-picker-wrapper .time1 {
width: 180px;
padding: 0 5px;
text-align: center;
}
/*time styling*/
.time2 {
width: 180px;
padding: 0 5px;
text-align: center;
}
.date-picker-wrapper .time1 {
float: left;
}
.date-picker-wrapper .time2 {
float: right;
}
.date-picker-wrapper .hour {
text-align: right;
}
.minute {
text-align: right;
}
.date-picker-wrapper .hide {
display: none;
}
.date-picker-wrapper .first-date-selected, .date-picker-wrapper .last-date-selected {
background-color: #49e !important;
color: white !important;
}
.date-picker-wrapper .date-range-length-tip {
position: absolute;
margin-top: -4px;
margin-left: -8px;
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
display: none;
background-color: yellow;
padding: 0 6px;
border-radius: 2px;
font-size: 12px;
line-height: 16px;
-webkit-filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
-moz-filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
-ms-filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
-o-filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}
.date-picker-wrapper .date-range-length-tip:after {
content: '';
position: absolute;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid yellow;
left: 50%;
margin-left: -4px;
bottom: -4px;
}
.date-picker-wrapper.two-months.no-gap .month1 .next, .date-picker-wrapper.two-months.no-gap .month2 .prev {
display: none;
}
.date-picker-wrapper .week-number {
padding: 5px 0;
line-height: 1;
font-size: 12px;
margin-bottom: 1px;
color: #999;
cursor: pointer;
}
.date-picker-wrapper .week-number.week-number-selected {
color: #49e;
font-weight: bold;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
js/daterangepicker/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,62 @@
/**
* 2010-2022 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
*
* @author Webkul IN <support@webkul.com>
* @copyright 2010-2022 Webkul IN
* @license https://store.webkul.com/license.html
*/
(function($) {
var dateRangePickerOrg = $.fn.dateRangePicker;
$.fn.dateRangePicker = function(opt) {
if(typeof opt === "object") {
const custom_opt = {
format: 'DD-MM-YYYY',
showTopbar: false,
autoClose: true,
singleMonth: true,
language: lang_iso,
minDays: 2,
startOfWeek: 'monday',
hoveringTooltip: false,
container: '#page',
customArrowPrevSymbol: '<i class="icon icon-angle-left"></i>',
customArrowNextSymbol: '<i class="icon icon-angle-right"></i>',
getValue: function()
{
return $(this).find('span').html();
},
setValue: function(s, s1, s2) {
if (s) {
$(this).find('span').html(s.replace('to', '&nbsp;<i class="icon icon-minus"></i>&nbsp;'));
} else {
$(this).find('span').html(
RangePickerCheckin + ' &nbsp;<i class="icon icon-minus"></i>&nbsp; ' + RangePickerCheckout
);
}
}
}
$.each(opt, function(index) {
delete custom_opt[index];
});
$.extend(true, opt, custom_opt);
}
var args = Array.prototype.slice.call(arguments,0);
return dateRangePickerOrg.apply(this, args);
}
})(jQuery);

View File

@@ -184,9 +184,7 @@ function validate_field(that)
var selector = '#id_country';
if ($(that).attr('name') == 'postcode_invoice')
selector += '_invoice';
var id_country = $(selector + ' option:selected').val();
if (typeof(countriesNeedZipCode[id_country]) != 'undefined' && typeof(countries[id_country]) != 'undefined')
var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], countries[id_country]['iso_code']);
}

View File

@@ -55,7 +55,7 @@
</style>
</head>
<body style="-webkit-text-size-adjust:none;background-color:#fff;width:650px;font-family:Open-sans, sans-serif;color:#555454;font-size:13px;line-height:18px;margin:auto">
<body style="-webkit-text-size-adjust:none;background-color:#fff;width:650px;font-family:Open-sans, sans-serif;color:#555454;font-size:13px;line-height:18px;margin:auto" >
<table class="table table-mail" style="width:100%;margin-top:10px;-moz-box-shadow:0 0 5px #afafaf;-webkit-box-shadow:0 0 5px #afafaf;-o-box-shadow:0 0 5px #afafaf;box-shadow:0 0 5px #afafaf;filter:progid:DXImageTransform.Microsoft.Shadow(color=#afafaf,Direction=134,Strength=5)">
<tr>
<td class="space" style="width:20px;padding:7px 0">&nbsp;</td>
@@ -73,7 +73,6 @@
<td align="center" class="titleblock" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<span class="title" style="font-weight:500;font-size:28px;text-transform:capitalize;line-height:33px">Hi {firstname} {lastname},</span><br/>
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">Your request for booking cancellation has been recieved.</span>
</font>
</td>
</tr>
@@ -87,10 +86,14 @@
<td width="10" style="padding:7px 0">&nbsp;</td>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:10px">Order details</p>
<p data-html-only="1" style="border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px">
VOUCHER GENERATED
</p>
<span style="color:#777">
<span style="color:#333"><strong>Order:</strong></span> {order_reference} Placed on {order_date}<br /><br />
<span style="color:#333"><strong>Refund Status:</strong></span> <span style="border-radius: 2px;color:#FFFFFF;font-weight:600;padding:5px 10px;background-color:{status_color}">{status_name}</span><br /><br />
Your voucher has been generated successfully against your credit slip #{credit_slip_id}.
<br/><br/>
<span style="color:#333"><strong>Voucher Code: <span>{voucher_code}</span></strong></span> for an amount of <span style="color:#333"><strong>{voucher_amount}.</strong></span><br /><br />
To use this voucher just copy and paste this code during payment process for your next order.
</span>
</font>
</td>
@@ -99,35 +102,6 @@
</table>
</td>
</tr>
<tr>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="margin:10px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:0px">Booking details</p>
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
<tr>
<tr>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Type</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Hotel</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Num. Rooms</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Duration</th>
</tr>
{refundBookingHtml}
</tbody>
</table>
</font>
</td>
</tr>
<tr>
<td class="space_footer" style="padding:0!important">&nbsp;</td>
</tr>
<tr>
<td class="linkbelow" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<span>
You can review your booking cancelation requests from the <a href="{refund_reqests_url}" style="color:#337ff1">"Booking Refund Requests"</a> section of your customer account by clicking <a href="{my_account_url}" style="color:#337ff1">"My account"</a>.</span>
</font>
</td>
</tr>
<tr>
<td class="space_footer" style="padding:0!important">&nbsp;</td>

View File

@@ -0,0 +1,16 @@
[/{shop_url}]
Hi {firstname} {lastname},
VOUCHER GENERATED
Your voucher has been generated successfully against your credit slip #{credit_slip_id}.
VOUCHER CODE: {voucher_code} for an amount of {voucher_amount}.
To use this voucher just copy and paste this code during payment process for your next
order.
{shop_name} [/{shop_url}] powered by Webkul(tm)
[https://www.webkul.com/]

View File

@@ -73,7 +73,7 @@
<td align="center" class="titleblock" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<span class="title" style="font-weight:500;font-size:28px;text-transform:capitalize;line-height:33px">Hi {firstname} {lastname},</span><br/>
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">A request has been generated for the booking cancellation.</span>
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">A request has been generated for booking cancellations.</span>
</font>
</td>
</tr>
@@ -104,7 +104,7 @@
<tr>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="margin:10px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:0px">Booking details</p>
<p data-html-only="1" style="margin:10px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:0px">Requested Booking Cancellations</p>
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
<tr>
<tr>

View File

@@ -1,7 +1,7 @@
Message from {shop_name}
Hi {firstname} {lastname},
A request has been generated for the booking cancellation.
A request has been generated for booking cancellations.
Order details
@@ -9,7 +9,7 @@ Order: {order_reference} Placed on {order_date}
Refund Status: {status_name}
Cancelation Reason: {cancelation_reason}
Booking details
Requested Booking Cancellations
Room Num
Room Type

View File

@@ -1,153 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>Message from {shop_name}</title>
<style> @media only screen and (max-width: 300px){
body {
width:218px !important;
margin:auto !important;
}
thead, tbody{width: 100%}
.table {width:195px !important;margin:auto !important;}
.logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto !important;display: block !important;}
span.title{font-size:20px !important;line-height: 23px !important}
span.subtitle{font-size: 14px !important;line-height: 18px !important;padding-top:10px !important;display:block !important;}
td.box p{font-size: 12px !important;font-weight: bold !important;}
.table-recap table, .table-recap thead, .table-recap tbody, .table-recap th, .table-recap td, .table-recap tr {
display: block !important;
}
.table-recap{width: 200px!important;}
.table-recap tr td, .conf_body td{text-align:center !important;}
.address{display: block !important;margin-bottom: 10px !important;}
.space_address{display: none !important;}
}
@media only screen and (min-width: 301px) and (max-width: 500px) {
body {width:425px!important;margin:auto!important;}
thead, tbody{width: 100%}
.table {margin:auto!important;}
.logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;}
.table-recap{width: 295px !important;}
.table-recap tr td, .conf_body td{text-align:center !important;}
.table-recap tr th{font-size: 10px !important}
}
@media only screen and (min-width: 501px) and (max-width: 768px) {
body {width:478px!important;margin:auto!important;}
thead, tbody{width: 100%}
.table {margin:auto!important;}
.logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;}
}
@media only screen and (max-device-width: 480px) {
body {width:340px!important;margin:auto!important;}
thead, tbody{width: 100%}
.table {margin:auto!important;}
.logo, .titleblock, .linkbelow, .box, .footer, .space_footer{width:auto!important;display: block!important;}
.table-recap{width: 295px!important;}
.table-recap tr td, .conf_body td{text-align:center!important;}
.address{display: block !important;margin-bottom: 10px !important;}
.space_address{display: none !important;}
}
</style>
</head>
<body style="-webkit-text-size-adjust:none;background-color:#fff;width:650px;font-family:Open-sans, sans-serif;color:#555454;font-size:13px;line-height:18px;margin:auto">
<table class="table table-mail" style="width:100%;margin-top:10px;-moz-box-shadow:0 0 5px #afafaf;-webkit-box-shadow:0 0 5px #afafaf;-o-box-shadow:0 0 5px #afafaf;box-shadow:0 0 5px #afafaf;filter:progid:DXImageTransform.Microsoft.Shadow(color=#afafaf,Direction=134,Strength=5)">
<tr>
<td class="space" style="width:20px;padding:7px 0">&nbsp;</td>
<td align="center" style="padding:7px 0">
<table class="table" bgcolor="#ffffff" style="width:100%">
<tr>
<td align="center" class="logo" style="border-bottom:4px solid #333333;padding:7px 0">
<a title="{shop_name}" href="{shop_url}" style="color:#337ff1">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
<tr>
<td align="center" class="titleblock" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<span class="title" style="font-weight:500;font-size:28px;text-transform:capitalize;line-height:33px">Hi {firstname} {lastname},</span><br/>
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">A request has been recieved for the booking cancellation.</span>
</font>
</td>
</tr>
<tr>
<td class="space_footer" style="padding:0!important">&nbsp;</td>
</tr>
<tr>
<td class="box" style="border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0">
<table class="table" style="width:100%">
<tr>
<td width="10" style="padding:7px 0">&nbsp;</td>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:10px">Order details</p>
<span style="color:#777">
<span style="color:#333"><strong>Order:</strong></span> {order_reference} Placed on {order_date}<br /><br />
<span style="color:#333"><strong>Refund Status:</strong></span> <span style="border-radius: 2px;color:#FFFFFF;font-weight:600;padding:5px 10px;background-color:{status_color}">{status_name}</span><br /><br />
</span>
</font>
</td>
<td width="10" style="padding:7px 0">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="margin:10px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:0px">Booking details</p>
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
<tr>
<tr>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Num</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Type</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Hotel</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Duration</th>
</tr>
{refundBookingHtml}
</tbody>
</table>
</font>
</td>
</tr>
<tr>
<td class="box" style="border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0">
<table class="table" style="width:100%">
<tr>
<td width="10" style="padding:7px 0">&nbsp;</td>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:16px;padding-bottom:10px">Customer details</p>
<span style="color:#777">
<span style="color:#333"><strong>Customer name:</strong></span> {customer_name}<br /><br />
<span style="color:#333"><strong>Customer email:</strong></span> {customer_email}<br /><br />
</font>
</td>
<td width="10" style="padding:7px 0">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="space_footer" style="padding:0!important">&nbsp;</td>
</tr>
<tr>
<td class="footer" style="border-top:4px solid #333333;padding:7px 0">
<span><a href="{shop_url}" style="color:#337ff1">{shop_name}</a> powered by <a href="https://webkul.com" style="color:#337ff1">Webkul&trade;</a></span>
</td>
</tr>
</table>
</td>
<td class="space" style="width:20px;padding:7px 0">&nbsp;</td>
</tr>
</table>
</body>
</html>

View File

@@ -1,25 +0,0 @@
Message from {shop_name}
Hi {firstname} {lastname},
A request has been recieved for the booking cancellation.
Order details
Order: {order_reference} Placed on {order_date}
Refund Status: {status_name}
Booking details
Room Num
Room Type
Hotel
Duration
{refundBookingHtml}
Customer details
Customer name: {customer_name}
Customer email: {customer_email}
{shop_url} {shop_name} powered by Webkul

View File

@@ -1,21 +0,0 @@
Message from {shop_name}
Hi {firstname} {lastname},
Your request for booking cancellation has been recieved.
Order details
Order: {order_reference} Placed on {order_date}
Refund Status: {status_name}
Booking details
Room Type
Hotel
Num. Rooms
Duration
{refundBookingHtml}
You can review your booking cancelation requests from the {refund_reqests_url} Booking Refund Requests section of your customer account by clicking {my_account_url} My account
{shop_url} {shop_name} powered by Webkul

View File

@@ -134,26 +134,28 @@ var ajaxCart = {
var dateFrom = $(this).attr('cat_rm_check_in');
var dateTo = $(this).attr('cat_rm_check_out');
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'));
/* By Webkul
* Note : In our case minimalQuantity is taken from Qty. field
*/
// var minimalQuantity = parseInt($(this).data('minimal_quantity'));
var minimalQuantity = parseInt($(this).data('minimal_quantity'));
var minimalQuantity = $("#cat_quantity_wanted_" + idProduct).val();
if (!minimalQuantity)
minimalQuantity = 1;
if ($(this).prop('disabled') != 'disabled')
ajaxCart.add(idProduct, idProductAttribute, false, this, minimalQuantity, null, dateFrom, dateTo);
// var minimalQuantity = parseInt($(this).data('minimal_quantity'));
// var minimalQuantity = $("#quantity_wanted_" + idProduct).val();
// if (!minimalQuantity)
// minimalQuantity = 1;
if ($(this).prop('disabled') != 'disabled' && occupancy)
ajaxCart.add(idProduct, idProductAttribute, false, this, occupancy, null, dateFrom, dateTo);
});
//for product page 'add' button...
if ($('.cart_block').length) {
$(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e) {
$(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e) {
e.preventDefault();
var date_from = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val()));
var date_to = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val()));
ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null, date_from, date_to);
var date_from = $('#room_check_in').val();
var date_to = $('#room_check_out').val();
var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'));
if (occupancy) {
ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, occupancy, null, date_from, date_to);
}
});
}
@@ -214,8 +216,8 @@ var ajaxCart = {
/*by webkul*/
if (pagename == 'product') {
dateFrom = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val()));
dateTo = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val()));
dateFrom = $('#room_check_in').val();
dateTo = $('#room_check_out').val();
} else if (pagename == 'category') {
dateFrom = $('#check_in_time').val();
dateTo = $('#check_out_time').val();
@@ -319,7 +321,7 @@ var ajaxCart = {
// close fancybox
updateFancyBox: function() {},
// add a product in the cart via ajax
add: function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist, dateFrom, dateTo) {
add: function(idProduct, idCombination, addedFromProductPage, callerElement, occupancy, whishlist, dateFrom, dateTo) {
if (addedFromProductPage && !checkCustomizations()) {
if (contentOnly) {
@@ -346,8 +348,9 @@ var ajaxCart = {
if (addedFromProductPage) {
$('#add_to_cart button').prop('disabled', 'disabled').addClass('disabled');
$('.filled').removeClass('filled');
} else
} else {
$(callerElement).prop('disabled', 'disabled');
}
if ($('.cart_block_list').hasClass('collapsed'))
this.expand();
@@ -355,6 +358,7 @@ var ajaxCart = {
// get the selected extra demands by customer
var roomDemands = getRoomsExtraDemands();
//send the ajax request to the server
$.ajax({
type: 'POST',
@@ -365,7 +369,7 @@ var ajaxCart = {
async: true,
cache: false,
dataType: "json",
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true'+(occupancy_required_for_booking ? '&occupancy=' + JSON.stringify(occupancy) : '&qty=' + occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)),
success: function(jsonData, textStatus, jqXHR) {
/*by webkul checking and setting availability of rooms*/
/*for product page add to cart quantity management*/
@@ -378,18 +382,19 @@ var ajaxCart = {
if (pagename == 'category') {
if (jsonData.avail_rooms <= room_warning_num) {
$(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show();
$(callerElement).closest(".room_cont").find(".rm_left").show();
} else {
$("cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide();
$(callerElement).closest(".room_cont").find(".rm_left").hide();
}
/*for category page add to cart quantity management*/
$(callerElement).closest(".room_cont").find(".remain_rm_qty").text(jsonData.avail_rooms);
$(callerElement).closest(".room_cont").find('.max_avail_type_qty').val(jsonData.avail_rooms);
$(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms);
if (jsonData.avail_rooms == 0) {
$(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').hide();
$(callerElement).closest(".room_cont").hide();
}
//$('#cat_quantity_wanted_'+idProduct).val(1);
//$('#quantity_wanted_'+idProduct).val(1);
}
@@ -406,22 +411,27 @@ var ajaxCart = {
if (jsonData.crossSelling)
$('.crossseling').html(jsonData.crossSelling);
if (idCombination)
$(jsonData.products).each(function() {
if (this.id != undefined && this.id == parseInt(idProduct) && this.idCombination == parseInt(idCombination))
if (contentOnly)
window.parent.ajaxCart.updateLayer(this);
else
ajaxCart.updateLayer(this);
});
else
$(jsonData.products).each(function() {
if (this.id != undefined && this.id == parseInt(idProduct))
if (contentOnly)
window.parent.ajaxCart.updateLayer(this);
else
ajaxCart.updateLayer(this);
});
// if (idCombination)
// $(jsonData.products).each(function() {
// if (this.id != undefined && this.id == parseInt(idProduct) && this.idCombination == parseInt(idCombination))
// if (contentOnly)
// window.parent.ajaxCart.updateLayer(this);
// else
// ajaxCart.updateLayer(this);
// });
// else
// $(jsonData.products).each(function() {
// if (this.id != undefined && this.id == parseInt(idProduct))
// if (contentOnly)
// window.parent.ajaxCart.updateLayer(this);
// else {
// ajaxCart.updateLayer(this);
// }
// });
if (jsonData.last_added_product) {
ajaxCart.updateLayer(jsonData.last_added_product);
}
if (contentOnly)
parent.$.fancybox.close();
} else {
@@ -434,7 +444,9 @@ var ajaxCart = {
else
$(callerElement).removeProp('disabled');
}
if (!addedFromProductPage) {
resetOccupancyField($(callerElement).closest('.booking_room_fields').find('.booking_occupancy_wrapper'));
}
emptyCustomizations();
},
@@ -495,12 +507,11 @@ var ajaxCart = {
/*by webkul checking and setting availability of rooms*/
/*for product page add to cart quantity management*/
if (pagename == 'product') {
var date_checkIn = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val()));
var date_checkOut = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val()));
var date_checkIn = $('#room_check_in').val();
var date_checkOut = $('#room_check_out').val();
var product_page_id_product = $('#product_page_product_id').val();
if (idProduct == product_page_id_product && dateFrom < date_checkOut && dateTo >= date_checkIn) {
$("#max_avail_type_qty").val(jsonData.avail_rooms);
$(".max_avail_type_qty").val(jsonData.avail_rooms);
if (jsonData.avail_rooms == 0) {
disableRoomTypeDemands(1);
}
@@ -510,18 +521,19 @@ var ajaxCart = {
if (pagename == 'category') {
if (jsonData.avail_rooms <= room_warning_num) {
$(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show();
$(".room_cont").find('[data-id-product="'+idProduct+'"] .rm_left').show();
} else {
$("cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide();
$("room_cont").find('[data-id-product="'+idProduct+'"] .rm_left').hide();
}
/*for category page add to cart quantity management*/
$(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms);
$(".room_cont").find('[data-id-product="'+idProduct+'"] .remain_rm_qty').text(jsonData.avail_rooms);
$(".room_cont").find('[data-id-product="'+idProduct+'"] .max_avail_type_qty').val(jsonData.avail_rooms);
if (jsonData.avail_rooms == 0) {
$(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').hide();
$(".room_cont").find('[data-id-product="'+idProduct+'"]').hide();
}
//$('#cat_quantity_wanted_'+idProduct).val(1);
//$('#quantity_wanted_'+idProduct).val(1);
}
ajaxCart.updateCart(jsonData);
@@ -615,14 +627,14 @@ var ajaxCart = {
if (pagename == 'category') {
// for category page....
$(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms);
$(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').show(0, function() {
$('.room_cont[data-id-product="'+idProduct+'"]').find(".remain_rm_qty").text(jsonData.avail_rooms);
$('.room_cont[data-id-product="'+idProduct+'"]').find('.max_avail_type_qty').val(jsonData.avail_rooms);
$('.room_cont[data-id-product="'+idProduct+'"]').show(0, function() {
if (jsonData.avail_rooms <= room_warning_num) {
$(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show();
$('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').show();
} else {
$(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide();
$('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').hide();
}
});
}
@@ -817,7 +829,7 @@ var ajaxCart = {
content += '<div class="room-capacity cart-info-sec">';
content += '<span class="product_info_label">' + capacity_txt + ':</span>';
content += '<span class="product_info_data">&nbsp;' + cart_booking_data[key].adult + '&nbsp;' + adults_txt + '&nbsp;&&nbsp;' + cart_booking_data[key].children + '&nbsp;' + children_txt + '</span>'
content += '<span class="product_info_data">&nbsp;' + cart_booking_data[key].adults + '&nbsp;' + adults_txt + '&nbsp;&&nbsp;' + cart_booking_data[key].children + '&nbsp;' + children_txt + '</span>'
content += '</div>';
if (this.hasAttributes)
@@ -1010,17 +1022,25 @@ var ajaxCart = {
$('#layer_cart_product_price').text(product.price);
//by webkul has to work on it more..
if (pagename == 'product') {
$('#layer_cart_product_time_duration').text($('#room_check_in').val() + ' - ' + $('#room_check_out').val());
$('#layer_cart_product_quantity').text($('#quantity_wanted').val());
$('#quantity_wanted').val(1);
}
if (pagename == 'category') {
$('#layer_cart_product_time_duration').text($('#check_in_time').val() + ' - ' + $('#check_out_time').val());
$('#layer_cart_product_quantity').text($('#cat_quantity_wanted_' + product.id).val());
$('#cat_quantity_wanted_' + product.id).val(1);
$('#layer_cart_product_time_duration').text(
product.date_from + ' - ' + product.date_to
);
let rooms = 0;
let adults = 0;
let children = 0;
let room_quantity_text = '';
if (occupancy_required_for_booking) {
$.each(product.occupancy, function(index, val) {
rooms++;
adults += parseInt(val.adults);
children += parseInt(val.children);
});
room_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
} else {
room_quantity_text = product.occupancy;
}
$('#layer_cart_product_quantity').text(room_quantity_text);
$('.layer_cart_img').html('<img class="layer_cart_img img-responsive" src="' + product.image + '" alt="' + product.name + '" title="' + product.name + '" />');
@@ -1189,4 +1209,48 @@ function getRoomsExtraDemands()
});
return roomDemands;
}
function getBookingOccupancyDetails(bookingform)
{
let occupancy;
if (occupancy_required_for_booking) {
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
if (selected_occupancy.length) {
occupancy = [];
$(selected_occupancy).each(function(ind, element) {
if (parseInt($(element).find('.num_adults').val())) {
let child_ages = [];
$(element).find('.guest_child_age').each(function(index) {
if ($(this).val() > -1) {
child_ages.push($(this).val());
}
});
if ($(element).find('.num_children').val()) {
if (child_ages.length != $(element).find('.num_children').val()) {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
}
occupancy.push({
'adults': $(element).find('.num_adults').val(),
'children': $(element).find('.num_children').val(),
'child_ages': child_ages
});
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
return false;
}
});
} else {
$(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open')
occupancy = false;
}
} else {
occupancy = parseInt($(bookingform).find(".quantity_wanted").val());
}
return occupancy;
}

View File

@@ -129,7 +129,7 @@ class Blockcart extends Module
$wrappingCost = (float) ($params['cart']->getOrderTotal($useTax, Cart::ONLY_WRAPPING));
$totalToPay = $params['cart']->getOrderTotal($useTax);
$tax_cost = 0;
if ($showTax) {
if ($useTax && $showTax) {
$totalToPayWithoutTaxes = $params['cart']->getOrderTotal(false);
$tax_cost = Tools::displayPrice($totalToPay - $totalToPayWithoutTaxes, $currency);
}
@@ -195,6 +195,52 @@ class Blockcart extends Module
1
);
$addedProduct = false;
// get currently added product if exists
if (!empty($params['cookie']->currentAddedProduct)) {
$addedProduct = json_decode($params['cookie']->currentAddedProduct, true);
$objProduct = new Product($addedProduct['id_product'], false, $this->context->language->id);
$addedProduct['name'] = $objProduct->name;
$addedProduct['link'] = $this->context->link->getProductLink(
$objProduct->id,
$objProduct->link_rewrite,
$objProduct->category,
null,
null,
$this->context->cart->id_shop
);
$image = Product::getCover($objProduct->id);
$image['id_product'] = $objProduct->id;
// Product::defineProductImage(array(Product::getCover($objProduct->id)['id_image']/), $this->id_lang)
$addedProduct['image'] = $this->context->link->getImageLink(
$objProduct->link_rewrite,
Product::defineProductImage($image, $this->context->language->id),
'home_default'
);
$addedProduct['image_cart'] = $this->context->link->getImageLink(
$objProduct->link_rewrite,
Product::defineProductImage($image, $this->context->language->id),
'cart_default'
);
$price = $addedProduct['price'] = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$objProduct->id,
$addedProduct['date_from'],
$addedProduct['date_to'],
$addedProduct['req_rm']
);
if ($priceDisplayMethod == PS_TAX_EXC) {
$addedProduct['price'] = Tools::displayPrice($price['total_price_tax_incl']);
} else {
$addedProduct['price'] = Tools::displayPrice($price['total_price_tax_excl']);
}
$addedProduct['date_from'] = Tools::displayDate($addedProduct['date_from']);
$addedProduct['date_to'] = Tools::displayDate($addedProduct['date_to']);
unset($this->context->cookie->currentAddedProduct);
}
$response = array(
'products' => $products,
'customizedDatas' => Product::getAllCustomizedDatas((int) ($params['cart']->id)),
@@ -206,6 +252,7 @@ class Blockcart extends Module
'shipping_cost_float' => $shipping_cost_float,
'show_wrapping' => $wrappingCost > 0 ? true : false,
'show_tax' => $showTax,
'use_tax' => $useTax,
'tax_cost' => $tax_cost,
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency),
@@ -218,7 +265,7 @@ class Blockcart extends Module
'static_token' => Tools::getToken(false),
'free_shipping' => Tools::displayPrice($total_free_shipping),
'free_shipping_float' => $total_free_shipping,
'last_added_product' => $addedProduct,
'cart_booking_data' => $htlCartData,
'total_rooms_in_cart' => $totalRooms,
);

View File

@@ -24,7 +24,7 @@
*}
<!-- MODULE Block cart -->
{if isset($blockcart_top) && $blockcart_top}
<div class="clearfix{if $PS_CATALOG_MODE} header_user_catalog{/if} nav_menu_padding pull-right">
<div class="header-top-item {if $PS_CATALOG_MODE}header_user_catalog{/if}">
{/if}
<div class="shopping_cart">
<a href="{$link->getPageLink($order_process, true)|escape:'html':'UTF-8'}" title="{l s='View my booking cart' mod='blockcart'}" rel="nofollow">
@@ -67,11 +67,6 @@
<!-- <span class="quantity-formated"><span class="quantity">{$cart_booking_data[$data_k]['total_num_rooms']}</span>&nbsp;x&nbsp;</span> -->
<a class="cart_block_product_name" href="{$link->getProductLink($product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}">{$product.name|truncate:30:'...':true|escape:'html':'UTF-8'}</a>
</div>
<!-- extra fields added by webkul to show on the cart -->
<div class="room-capacity cart-info-sec">
<span class="product_info_label">{l s='Capacity' mod='blockcart'}:</span>
<span class="product_info_data">&nbsp;{$cart_booking_data[$data_k]['adult']}&nbsp;{l s='Adults' mod='blockcart'}&nbsp;&&nbsp;{$cart_booking_data[$data_k]['children']}&nbsp;{l s='Children' mod='blockcart'}</span>
</div>
{if isset($product.attributes_small)}
<div class="product-atributes">
@@ -118,7 +113,7 @@
{foreach from=$cart_booking_data[$data_k]['date_diff'] key=data_k1 item=data_v}
<tr class="rooms_remove_container">
<td>
{$data_v['data_form']|date_format:"%d %b %Y"}&nbsp;-&nbsp;{$data_v['data_to']|date_format:"%d %b %Y"}
{$data_v['data_form']|date_format:"%d-%m-%Y"}&nbsp;-&nbsp;{$data_v['data_to']|date_format:"%d-%m-%Y"}
</td>
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
<td>{convertPrice price=$data_v['amount']}</td>
@@ -211,7 +206,7 @@
</span>
</div>
{/if} --><!-- commented by webkul unnecessary data -->
{if $show_tax && isset($tax_cost)}
{if $show_tax && $use_tax}
<div class="cart-prices-line">
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
<span>{l s='Tax' mod='blockcart'}</span>
@@ -271,11 +266,11 @@
<span id="layer_cart_product_time_duration"></span>
</div>
<div>
<strong class="dark">{l s='Rooms Quantity Added' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark">{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_quantity"></span>
</div>
<div>
<strong class="dark">{l s='Total Cart Cost of This Room Type' mod='blockcart'} &nbsp;-&nbsp;</strong>
<strong class="dark">{l s='Room type cost' mod='blockcart'} &nbsp;-&nbsp;</strong>
<span id="layer_cart_product_price"></span>
</div>
</div>

View File

@@ -31,20 +31,16 @@ class BlockcartCheckRoomAvailabilityAjaxProcessModuleFrontController extends Mod
)) {
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct)) {
if ($idHotel = $roomTypeInfo['id_hotel']) {
if ($hotelRoomData = $objBookingDetail->DataForFrontSearch(
$dateFrom,
$dateTo,
$idHotel,
$idProduct,
1,
0,
0,
-1,
0,
0,
$idCart,
$idGuest
)) {
$bookingParams = array(
'date_from' => $dateFrom,
'date_to' => $dateTo,
'hotel_id' => $idHotel,
'id_room_type' => $idProduct,
'only_search_data' => 1,
'id_cart' => $idCart,
'id_guest' => $idGuest,
);
if ($hotelRoomData = $objBookingDetail->dataForFrontSearch($bookingParams)) {
$totalAvailRooms = $hotelRoomData['stats']['num_avail'];
}
}

View File

@@ -44,6 +44,7 @@ class DashGuestCycle extends Module
{
return (parent::install()
&& $this->registerHook('dashboardTop')
&& $this->registerHook('dashboardZoneTwo')
&& $this->registerHook('dashboardData')
&& $this->registerHook('actionAdminControllerSetMedia')
);
@@ -56,42 +57,393 @@ class DashGuestCycle extends Module
}
}
public function hookDashboardTop($params)
public function hookDashboardTop()
{
return $this->display(__FILE__, 'dashboard-top.tpl');
}
public function hookDashboardZoneTwo()
{
return $this->display(__FILE__, 'dashboard-zone-two.tpl');
}
public function hookDashboardData($params)
{
$data = array();
$dataValue = array();
$dataTable = array();
$dateToday = date('Y-m-d');
if (Configuration::get('PS_DASHBOARD_SIMULATION')) {
$data['dgc_total_arrivals'] = sprintf('%02d', rand(100, 1000));
$data['dgc_arrived'] = sprintf('%02d', rand(0, $data['dgc_total_arrivals']));
$data['dgc_total_departures'] = sprintf('%02d', rand(100, 1000));
$data['dgc_departed'] = sprintf('%02d', rand(0, $data['dgc_total_departures']));
$data['dgc_new_bookings'] = sprintf('%02d', rand(10, 500));
$data['dgc_stay_overs'] = sprintf('%02d', rand(10, 500));
$data['dgc_new_messages'] = sprintf('%02d', rand(0, 20));
$data['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20));
$data['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000));
$data['dgc_guests_children'] = sprintf('%02d', rand(0, $data['dgc_guests_adults']));
$dataValue['dgc_total_arrivals'] = sprintf('%02d', rand(100, 1000));
$dataValue['dgc_arrived'] = sprintf('%02d', rand(0, $dataValue['dgc_total_arrivals']));
$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_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));
$dataValue['dgc_guests_children'] = sprintf('%02d', rand(0, $dataValue['dgc_guests_adults']));
} else {
$dateToday = date('Y-m-d');
// set badges data
$arrivalsData = AdminStatsController::getArrivalsByDate($dateToday, $params['id_hotel']);
$departuresData = AdminStatsController::getDeparturesByDate($dateToday, $params['id_hotel']);
$guestsData = AdminStatsController::getGuestsByDate($dateToday, $params['id_hotel']);
$data['dgc_arrived'] = sprintf('%02d', $arrivalsData['arrived']);
$data['dgc_total_arrivals'] = sprintf('%02d', $arrivalsData['total_arrivals']);
$data['dgc_departed'] = sprintf('%02d', $departuresData['departed']);
$data['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']);
$data['dgc_new_bookings'] = sprintf('%02d', AdminStatsController::getBookingsByDate($dateToday, $params['id_hotel']));
$data['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel']));
$data['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday));
$data['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel']));
$data['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']);
$data['dgc_guests_children'] = sprintf('%02d', $guestsData['children']);
$dataValue['dgc_arrived'] = sprintf('%02d', $arrivalsData['arrived']);
$dataValue['dgc_total_arrivals'] = sprintf('%02d', $arrivalsData['total_arrivals']);
$dataValue['dgc_departed'] = sprintf('%02d', $departuresData['departed']);
$dataValue['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']);
$dataValue['dgc_new_bookings'] = sprintf('%02d', AdminStatsController::getBookingsByDate($dateToday, $params['id_hotel']));
$dataValue['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel']));
$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']);
$dataValue['dgc_guests_children'] = sprintf('%02d', $guestsData['children']);
}
return array('data_value' => $data);
// set tables data
$tableCurrentArrivals = $this->getArrivalsTableContentsByDate($dateToday, $params['id_hotel']);
$dataValue['dgc_count_upcoming_arrivals'] = count($tableCurrentArrivals['body']);
$tableCurrentDepartures = $this->getDeparturesTableContentsByDate($dateToday, $params['id_hotel']);
$dataValue['dgc_count_upcoming_departures'] = count($tableCurrentDepartures['body']);
$tableCurrentInHouse = $this->getInHousesTableContents($params['id_hotel']);
$dataValue['dgc_count_current_in_house'] = count($tableCurrentInHouse['body']);
$tableNewBookings = $this->getNewBookingsTableContentsByDate($dateToday, $params['id_hotel']);
$dataValue['dgc_count_new_bookings'] = count($tableNewBookings['body']);
$tableCancellations = $this->getCancellationsTableContentsByDate($dateToday, $params['id_hotel']);
$dataValue['dgc_count_cancellations'] = count($tableCancellations['body']);
$dataTable = array(
'dgc_table_current_arrivals' => $tableCurrentArrivals,
'dgc_table_current_departures' => $tableCurrentDepartures,
'dgc_table_current_in_house' => $tableCurrentInHouse,
'dgc_table_new_bookings' => $tableNewBookings,
'dgc_table_cancellations' => $tableCancellations,
);
return array('data_value' => $dataValue, 'data_table' => $dataTable);
}
public function getArrivalsTableContentsByDate($date, $idHotel)
{
$header = array(
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
);
if ($idHotel != 0) {
unset($header['hotel']);
}
$arrivalsInfo = AdminStatsController::getArrivalsInfoByDate($date, $idHotel);
$body = array();
foreach ($arrivalsInfo as $arrivalInfo) {
$tr = array();
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminCustomers', true).'&id_customer='.$arrivalInfo['id_customer'].'&viewcustomer" target="_blank">'.Tools::htmlentitiesUTF8($arrivalInfo['customer_name']).'</a>',
'class' => 'text-left',
);
$tr[] = array(
'value' => $arrivalInfo['room_num'],
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminProducts', true).'&id_product='.$arrivalInfo['id_product'].'&updateproduct" target="_blank">'.Tools::htmlentitiesUTF8($arrivalInfo['room_type_name']).'</a>',
'class' => 'text-left',
);
if ($idHotel == 0) {
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminAddHotel', true).'&id='.$arrivalInfo['id_hotel'].'&updatehtl_branch_info" target="_blank">'.Tools::htmlentitiesUTF8($arrivalInfo['hotel_name']).'</a>',
'class' => 'text-left',
);
}
$tr[] = array(
'value' => $arrivalInfo['adult'] + $arrivalInfo['children'],
'class' => 'text-center',
);
$tr[] = array(
'value' => Tools::displayDate($arrivalInfo['date_to']).' ('.$arrivalInfo['los'].' '.($arrivalInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')',
'class' => 'text-left',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrders', true).'&id_order='.$arrivalInfo['id_order'].'&vieworder" target="_blank">#'.Tools::htmlentitiesUTF8($arrivalInfo['id_order']).'</a>',
'class' => 'text-center',
);
$body[] = $tr;
}
return array('header' => array_values($header), 'body' => $body);
}
public function getDeparturesTableContentsByDate($date, $idHotel)
{
$header = array(
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in (LOS)'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
);
if ($idHotel != 0) {
unset($header['hotel']);
}
$departuresInfo = AdminStatsController::getDeparturesInfoByDate($date, $idHotel);
$body = array();
foreach ($departuresInfo as $departureInfo) {
$tr = array();
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminCustomers', true).'&id_customer='.$departureInfo['id_customer'].'&viewcustomer" target="_blank">'.Tools::htmlentitiesUTF8($departureInfo['customer_name']).'</a>',
'class' => 'text-left',
);
$tr[] = array(
'value' => $departureInfo['room_num'],
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminProducts', true).'&id_product='.$departureInfo['id_product'].'&updateproduct" target="_blank">'.Tools::htmlentitiesUTF8($departureInfo['room_type_name']).'</a>',
'class' => 'text-left',
);
if ($idHotel == 0) {
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminAddHotel', true).'&id='.$departureInfo['id_hotel'].'&updatehtl_branch_info" target="_blank">'.Tools::htmlentitiesUTF8($departureInfo['hotel_name']).'</a>',
'class' => 'text-left',
);
}
$tr[] = array(
'value' => $departureInfo['adult'] + $departureInfo['children'],
'class' => 'text-center',
);
$tr[] = array(
'value' => Tools::displayDate($departureInfo['date_from']).' ('.$departureInfo['los'].' '.($departureInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')',
'class' => 'text-left',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrders', true).'&id_order='.$departureInfo['id_order'].'&vieworder" target="_blank">#'.Tools::htmlentitiesUTF8($departureInfo['id_order']).'</a>',
'class' => 'text-center',
);
$body[] = $tr;
}
return array('header' => array_values($header), 'body' => $body);
}
public function getInHousesTableContents($idHotel)
{
$header = array(
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'),
'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
);
if ($idHotel != 0) {
unset($header['hotel']);
}
$inHousesInfo = AdminStatsController::getInHousesInfo($idHotel);
$body = array();
foreach ($inHousesInfo as $inHouseInfo) {
$tr = array();
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminCustomers', true).'&id_customer='.$inHouseInfo['id_customer'].'&viewcustomer" target="_blank">'.Tools::htmlentitiesUTF8($inHouseInfo['customer_name']).'</a>',
'class' => 'text-left',
);
$tr[] = array(
'value' => $inHouseInfo['room_num'],
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminProducts', true).'&id_product='.$inHouseInfo['id_product'].'&updateproduct" target="_blank">'.Tools::htmlentitiesUTF8($inHouseInfo['room_type_name']).'</a>',
'class' => 'text-left',
);
if ($idHotel == 0) {
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminAddHotel', true).'&id='.$inHouseInfo['id_hotel'].'&updatehtl_branch_info" target="_blank">'.Tools::htmlentitiesUTF8($inHouseInfo['hotel_name']).'</a>',
'class' => 'text-left',
);
}
$tr[] = array(
'value' => $inHouseInfo['adult'] + $inHouseInfo['children'],
'class' => 'text-center',
);
$tr[] = array(
'value' => Tools::displayDate($inHouseInfo['date_from']),
'class' => 'text-left',
);
$tr[] = array(
'value' => Tools::displayDate($inHouseInfo['date_to']).' ('.$inHouseInfo['los'].' '.($inHouseInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')',
'class' => 'text-left',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrders', true).'&id_order='.$inHouseInfo['id_order'].'&vieworder" target="_blank">#'.Tools::htmlentitiesUTF8($inHouseInfo['id_order']).'</a>',
'class' => 'text-center',
);
$body[] = $tr;
}
return array('header' => array_values($header), 'body' => $body);
}
public function getNewBookingsTableContentsByDate($date, $idHotel)
{
$header = array(
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'total' => array('title' => $this->l('Total Rooms'), 'class' => 'text-center'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'order_total' => array('title' => $this->l('Order Total'), 'class' => 'text-right'),
'order_status' => array('title' => $this->l('Order Status'), 'class' => 'text-left'),
);
if ($idHotel != 0) {
unset($header['hotel']);
}
$newBookingsInfo = AdminStatsController::getNewBookingsInfoByDate($date, $idHotel);
$body = array();
foreach ($newBookingsInfo as $newBookingInfo) {
$objCurrency = Currency::getCurrency($newBookingInfo['id_currency']);
$tr = array();
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrders', true).'&id_order='.$newBookingInfo['id_order'].'&vieworder" target="_blank">#'.Tools::htmlentitiesUTF8($newBookingInfo['id_order']).'</a>',
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminCustomers', true).'&id_customer='.$newBookingInfo['id_customer'].'&viewcustomer" target="_blank">'.Tools::htmlentitiesUTF8($newBookingInfo['customer_name']).'</a>',
'class' => 'text-left',
);
if ($idHotel == 0) {
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminAddHotel', true).'&id='.$newBookingInfo['id_hotel'].'&updatehtl_branch_info" target="_blank">'.Tools::htmlentitiesUTF8($newBookingInfo['hotel_name']).'</a>',
'class' => 'text-left',
);
}
$tr[] = array(
'value' => $newBookingInfo['total_rooms'],
'class' => 'text-center',
);
$tr[] = array(
'value' => $newBookingInfo['total_guests'],
'class' => 'text-center',
);
$tr[] = array(
'value' => Tools::displayPrice($newBookingInfo['total_paid_tax_excl'], $objCurrency),
'class' => 'text-right',
);
$tr[] = array(
'value' => $newBookingInfo['state_name'],
'class' => 'text-left',
);
$body[] = $tr;
}
return array('header' => array_values($header), 'body' => $body);
}
public function getCancellationsTableContentsByDate($date, $idHotel)
{
$header = array(
'request_id' => array('title' => $this->l('Request ID'), 'class' => 'text-center'),
'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'),
'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'),
'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'),
'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'),
'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'),
'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'),
'check_out' => array('title' => $this->l('Check-out'), 'class' => 'text-left'),
'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'),
);
if ($idHotel != 0) {
unset($header['hotel']);
}
$cancellationsInfo = AdminStatsController::getCancellationsInfoByDate($date, $idHotel);
$body = array();
foreach ($cancellationsInfo as $cancellationInfo) {
$objCurrency = Currency::getCurrency($cancellationInfo['id_currency']);
$tr = array();
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrderRefundRequests', true).'&id_order_return='.$cancellationInfo['id_order_return'].'&vieworder_return" target="_blank">#'.Tools::htmlentitiesUTF8($cancellationInfo['id_order_return']).'</a>',
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminCustomers', true).'&id_customer='.$cancellationInfo['id_customer'].'&viewcustomer" target="_blank">'.Tools::htmlentitiesUTF8($cancellationInfo['customer_name']).'</a>',
'class' => 'text-left',
);
$tr[] = array(
'value' => $cancellationInfo['room_num'],
'class' => 'text-center',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminProducts', true).'&id_product='.$cancellationInfo['id_product'].'&updateproduct" target="_blank">'.Tools::htmlentitiesUTF8($cancellationInfo['room_type_name']).'</a>',
'class' => 'text-left',
);
if ($idHotel == 0) {
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminAddHotel', true).'&id='.$cancellationInfo['id_hotel'].'&updatehtl_branch_info" target="_blank">'.Tools::htmlentitiesUTF8($cancellationInfo['hotel_name']).'</a>',
'class' => 'text-left',
);
}
$tr[] = array(
'value' => $cancellationInfo['total_guests'],
'class' => 'text-center',
);
$tr[] = array(
'value' => Tools::displayDate($cancellationInfo['date_from']),
'class' => 'text-left',
);
$tr[] = array(
'value' => Tools::displayDate($cancellationInfo['date_to']),
'class' => 'text-left',
);
$tr[] = array(
'value' => '<a href="'.$this->context->link->getAdminLink('AdminOrders', true).'&id_order='.$cancellationInfo['id_order'].'&vieworder" target="_blank">#'.Tools::htmlentitiesUTF8($cancellationInfo['id_order']).'</a>',
'class' => 'text-center',
);
$body[] = $tr;
}
return array('header' => array_values($header), 'body' => $body);
}
}

View File

@@ -2,13 +2,36 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Dashboard-Gästezyklus';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Fügt einen Block mit einer grafischen Darstellung der Gästezyklusstatistiken hinzu.';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Bist du sicher, dass du es deinstallieren willst?';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Ankunft';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Abflüge';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Neue Buchungen';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Übernachten';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Gastnachrichten';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Stornierte Buchungen';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Gäste (Erwachsene/Kinder)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Dashboard Gastzyklus';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Fügt einen Block mit einer grafischen Darstellung der Gastzyklusstatistiken hinzu.';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Bist du dir sicher dass du es deinstallieren willst?';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Name';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Zimmer Nr.';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Zimmertyp';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Gäste';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Auschecken (LOS)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Auftragsnummer';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Nächte';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Nacht';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Check-in (LOS)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Check-In';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Zimmer insgesamt';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Auftragssumme';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Bestellstatus';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Kasse';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Status abbrechen';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Die Anzahl der für heute geplanten Ankünfte.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Die Anzahl der für heute geplanten Abfahrten.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Die Anzahl der bisher erstellten neuen Buchungen.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Die Anzahl der für heute geplanten Übernachtungen.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Die Anzahl der heute von Gästen erhaltenen neuen Nachrichten.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Die Anzahl der heute bisher stornierten Buchungen.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Die Anzahl der Erwachsenen und Kinder, die heute bleiben sollen.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Betrieb heute';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Aktualisierung';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Ankünfte';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Abflüge';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'Im Haus';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Buchungen';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Stornierungen';

View File

@@ -2,13 +2,36 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de invitado del panel';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de invitado del tablero';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Agrega un bloque con una representación gráfica de las estadísticas del ciclo de invitados.';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = '¿Estas seguro que lo quieres desinstalar?';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Llegadas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Salidas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nuevas reservas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Stay Overs';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Mensajes de invitados';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Reservas canceladas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Invitados (Adultos / Niños)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nombre';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Habitación no.';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Tipo de habitación';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Huéspedes';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Salida (LOS)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Solicitar ID';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Noches';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Noche';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Facturación (LOS)';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Registrarse';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Habitaciones Totales';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Total del pedido';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Estado del pedido';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Verificar';
$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Cancelar estado';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'El número de llegadas programadas para hoy.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'El número de salidas programadas para hoy.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'El número de nuevas reservas creadas hoy hasta el momento.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'El número de estancias programadas para hoy.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'El número de mensajes nuevos recibidos de invitados hoy.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'El número de reservas canceladas hoy hasta ahora.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'El número de adultos y niños programados para quedarse hoy.';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operaciones hoy';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Actualizar';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Llegadas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Salidas';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'interno';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Reservaciones';
$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Cancelaciones';

Some files were not shown because too many files have changed in this diff Show More