Merge pull request #895 from sumitwebkul/overbooking_issues
Fixed: Overbooking issues in QloApps and added new configurations for overbooking handling
This commit is contained in:
@@ -42,6 +42,12 @@
|
||||
right: 0
|
||||
margin: 0 auto
|
||||
|
||||
#customer_cart_details .overbooked_room
|
||||
background-color: #FF69B4
|
||||
color: #FFF
|
||||
padding: 2px 5px
|
||||
border-radius: 2px
|
||||
font-weight: 600
|
||||
|
||||
.room_status_info_form
|
||||
.room_status
|
||||
|
||||
@@ -11,7 +11,7 @@ $contrasted-lightness-threshold: 10%
|
||||
$bg-page-head-color : $secondary-color
|
||||
$bg-panel-heading-color: hsl(hue($secondary-color), 10, 90)
|
||||
|
||||
$badge-notif-color: $greenPrestashop
|
||||
$badge-notif-color: #D27C82
|
||||
$brand-addons: $pinkPrestashop
|
||||
|
||||
$font-family-mono: 'Droid Sans Mono', Helvetica, Arial, sans-serif
|
||||
|
||||
@@ -109,7 +109,11 @@ body
|
||||
.dropdown-menu
|
||||
line-height: normal
|
||||
.panel-danger .panel-heading
|
||||
background-color: $badge-notif-color!important
|
||||
background-color: #DC143C
|
||||
color: #FFF
|
||||
margin: -20px -20px 15px -20px
|
||||
padding: 0px 10px 0px 10px
|
||||
|
||||
form .alert
|
||||
clear: both
|
||||
@media (max-width: $screen-phone)
|
||||
|
||||
@@ -24,4 +24,9 @@
|
||||
*}
|
||||
{extends file="helpers/options/options.tpl"}
|
||||
|
||||
{block name="after"}<script type="text/javascript">changeCMSActivationAuthorization();</script>{/block}
|
||||
{block name="after"}
|
||||
<script type="text/javascript">
|
||||
changeCMSActivationAuthorization();
|
||||
changeOverbookingOrderAction();
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
{*
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{if isset($orderOverBookings) && $orderOverBookings}
|
||||
<div class="panel panel-danger">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-warning"></i> {l s='Overbookings found in this order !!'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<div class="table-responsive form-group">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room type.'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Occupancy'}</th>
|
||||
<th>{l s='Confirmed booking order'}</th>
|
||||
<th>{l s='Reallocate/Swap'}</th>
|
||||
<th>{l s='Resolve'}</th>
|
||||
</tr>
|
||||
{foreach from=$orderOverBookings item=data}
|
||||
{if !$data.is_refunded}
|
||||
<tr>
|
||||
<td>{$data['room_num']}</td>
|
||||
<td>{$data['room_type_name']}</td>
|
||||
<td>{dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']}</td>
|
||||
<td>
|
||||
{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}
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data['booked_room_info']['id_order']) && $data['booked_room_info']['id_order']}
|
||||
<a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$data['booked_room_info']['id_order']}">#{$data['booked_room_info']['id_order']}</a>
|
||||
{else}
|
||||
{l s='N/A'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="btn btn-default reallocate_overbooking" id_htl_booking="{$data['id']}"><i class="icon-refresh"></i> {l s='Reallocate/Swap Room'}</a>
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data['booked_room_info']) && $data['booked_room_info']}
|
||||
<span class="badge badge-information">{l s='Already booked'}</span>
|
||||
{else}
|
||||
<a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$data['id_order']}&resolve_overbooking={$data['id']}" class="btn btn-default resolve_overbooking" id_htl_booking="{$data['id']}"><i class="icon-refresh"></i> {l s='Resolve'}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="help-block">
|
||||
<p>- {l s='You can resolve room overbooking with \'Resolve\' column only when the overbooked room is now free for booked duration.'}</p>
|
||||
<p>- {l s='You can also reallocate an overbooked room with an available room to resolve room\'s overbooking.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -30,7 +30,10 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td class="text-center">
|
||||
{$data.room_num}
|
||||
<p>{$data.room_num}</p>
|
||||
{if $data.is_back_order}
|
||||
<span class="overbooked_room">{l s='overbooked'}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<img src="{$data.image_link}" title="Room image" />
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
{*
|
||||
* 2010-2023 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2023 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
{if isset($resolvableOverBookings) && $resolvableOverBookings}
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-refresh"></i> {l s='Resolvable Overbookings'}
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
{if isset($smarty.get.resolvable_overbooked_orders) && $smarty.get.resolvable_overbooked_orders}
|
||||
<div class="alert alert-warning">
|
||||
<b>{l s='Orders with resolvable overbookings are filtered.'} <a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}" class="btn btn-warning"><i class="icon-refresh"></i> {l s='See all orders'}</a></b>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="alert alert-info">
|
||||
<p>{l s='Some overbookings are now available to be resolved. You can directly resolve overbookings from below list as per your choice.'}</p>
|
||||
{if !isset($smarty.get.resolvable_overbooked_orders) || !$smarty.get.resolvable_overbooked_orders}
|
||||
<br>
|
||||
<p>{l s='You can also filter orders which overbookings are now available to be resolved.'} <a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&resolvable_overbooked_orders=1" class="btn btn-default"><i class="icon-search"></i> {l s='Filter orders with resolvable overbookings'}</a></p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="table-responsive form-group">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room type'}</th>
|
||||
<th>{l s='Hotel'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Order'}</th>
|
||||
<th>{l s='Resolve'}</th>
|
||||
</tr>
|
||||
{foreach from=$resolvableOverBookings item=data}
|
||||
{if !$data.is_refunded}
|
||||
<tr>
|
||||
<td>{$data['room_num']}</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminProducts')}&id_product={$data['id_product']|escape:'html':'UTF-8'}&updateproduct">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminAddHotel')}&id={$data['id_hotel']|escape:'html':'UTF-8'}&updatehtl_branch_info" target="_blank"><span>{$data['hotel_name']}</span></a>
|
||||
</td>
|
||||
<td>{dateFormat date=$data['date_from']|escape:'html':'UTF-8'} {l s='To'} {dateFormat date=$data['date_to']|escape:'html':'UTF-8'}</td>
|
||||
<td>
|
||||
<a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&vieworder&id_order={$data['id_order']|escape:'html':'UTF-8'}">#{$data['id_order']|escape:'html':'UTF-8'}</a>
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data['booked_room_info']) && $data['booked_room_info']}
|
||||
<span class="badge badge-information">{l s='Already booked'}</span>
|
||||
{else}
|
||||
<a href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&resolve_overbooking={$data['id']|escape:'html':'UTF-8'}" class="btn btn-default resolve_overbooking" id_htl_booking="{$data['id']|escape:'html':'UTF-8'}"><i class="icon-refresh"></i> {l s='Resolve'}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
@@ -105,6 +105,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Overbookings information of the order *}
|
||||
{include file='controllers/orders/_overbookings.tpl'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-7">
|
||||
<div class="panel">
|
||||
|
||||
@@ -760,15 +760,16 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
// update order in htl tables
|
||||
$objRoomType = new HotelRoomType();
|
||||
|
||||
$objAdvancedPayment = new HotelAdvancedPayment();
|
||||
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$vatAddress = new Address((int)$order->id_address_tax);
|
||||
|
||||
$idLang = (int)$this->context->cart->id_lang;
|
||||
$normalProducts = array();
|
||||
// variable to check max overbookings are created in the room in any date of the booking duration
|
||||
$maxOverbookingCount = 0;
|
||||
foreach ($order->product_list as $product) {
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$idProduct = $product['id_product'];
|
||||
$cartBookingData = $objCartBookingData->getOnlyCartBookingData($this->context->cart->id, $this->context->cart->id_guest, $idProduct);
|
||||
if ($cartBookingData) {
|
||||
@@ -776,8 +777,67 @@ abstract class PaymentModuleCore extends Module
|
||||
$objCartBookingData = new HotelCartBookingData($bookingInfo['id']);
|
||||
$objCartBookingData->id_order = $order->id;
|
||||
$objCartBookingData->id_customer = $this->context->customer->id;
|
||||
|
||||
// check if still room available for this booking or not
|
||||
$isRoomOverBooked = 1;
|
||||
|
||||
// get all the available rooms right now
|
||||
$bookingParams = array(
|
||||
'date_from' => $objCartBookingData->date_from,
|
||||
'date_to' => $objCartBookingData->date_to,
|
||||
'hotel_id' => $objCartBookingData->id_hotel,
|
||||
'id_room_type' => $idProduct,
|
||||
'only_search_data' => 1
|
||||
);
|
||||
|
||||
if ($searchRoomsInfo = $objBookingDetail->getBookingData($bookingParams)) {
|
||||
if (isset($searchRoomsInfo['rm_data'][$idProduct]['data']['available'])
|
||||
&& $searchRoomsInfo['rm_data'][$idProduct]['data']['available']
|
||||
) {
|
||||
$availableRoomsInfo = $searchRoomsInfo['rm_data'][$idProduct]['data']['available'];
|
||||
if ($roomIdsAvailable = array_column($availableRoomsInfo, 'id_room')) {
|
||||
// If room is still there in the available rooms list then it is not in back order
|
||||
if (in_array($objCartBookingData->id_room, $roomIdsAvailable)) {
|
||||
$isRoomOverBooked = 0;
|
||||
} else {
|
||||
$isRoomOverBooked = 1;
|
||||
foreach ($roomIdsAvailable as $idRoom) {
|
||||
if ($idRoom != $objCartBookingData->id_room) {
|
||||
$objCartBookingData->id_room = $idRoom;
|
||||
$isRoomOverBooked = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if room is not available right now the set it to back order
|
||||
if ($isRoomOverBooked) {
|
||||
$objCartBookingData->is_back_order = 1;
|
||||
|
||||
// max overbookings in a room datewise breakup. So that we can know no. of overbookings in every date
|
||||
if ($roomOverBookings = $objBookingDetail->getOverbookedRooms(
|
||||
0,
|
||||
$objCartBookingData->id_hotel,
|
||||
$objCartBookingData->date_from,
|
||||
$objCartBookingData->date_to,
|
||||
0,
|
||||
1
|
||||
)) {
|
||||
// check in the bokking duration what is the max overbookings in ay date in the date range
|
||||
// replace $maxOverbookingCount with $maxOverbookingsInDate if it is greater
|
||||
if ($maxOverbookingCount < $roomOverBookings) {
|
||||
$maxOverbookingCount = $roomOverBookings;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$objCartBookingData->is_back_order = 0;
|
||||
}
|
||||
$objCartBookingData->save();
|
||||
|
||||
// Lets set data to the hotel booking detail table
|
||||
$objBookingDetail = new HotelBookingDetail();
|
||||
$id_order_detail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id);
|
||||
$objBookingDetail->id_product = $idProduct;
|
||||
@@ -789,12 +849,9 @@ abstract class PaymentModuleCore extends Module
|
||||
$objBookingDetail->id_customer = $this->context->customer->id;
|
||||
$objBookingDetail->booking_type = $objCartBookingData->booking_type;
|
||||
$objBookingDetail->id_status = 1;
|
||||
$objBookingDetail->is_back_order = $objCartBookingData->is_back_order;
|
||||
$objBookingDetail->comment = $objCartBookingData->comment;
|
||||
|
||||
// For Back Order(Because of cart lock)
|
||||
if ($objCartBookingData->is_back_order) {
|
||||
$objBookingDetail->is_back_order = 1;
|
||||
}
|
||||
$total_price = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$idProduct,
|
||||
$objCartBookingData->date_from,
|
||||
@@ -998,10 +1055,39 @@ abstract class PaymentModuleCore extends Module
|
||||
$new_history->addWithemail(true, $extra_vars);
|
||||
|
||||
// Switch to back order if needed
|
||||
if (Configuration::get('PS_STOCK_MANAGEMENT') && ($order_detail->getStockState() || $order_detail->product_quantity_in_stock <= 0)) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
if ($objHotelBookingDetail->getOverbookedRooms($order->id)) {
|
||||
$cancelOrder = 0;
|
||||
// Take overbooking action as per order->overbooking Preferences else set order for cancellation
|
||||
if (Configuration::get('PS_OVERBOOKING_ORDER_ACTION') == Order::OVERBOOKING_ORDER_CANCEL_ACTION) {
|
||||
$cancelOrder = 1;
|
||||
} else {
|
||||
// check conditions for maximun overbookings allowed for the hotel else set order for cancellation
|
||||
$maxAllowedOverbookings = Configuration::get('PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY');
|
||||
// >= condition applied because equal case means already overbooked rooms limit exceeded before this booking
|
||||
if ($maxAllowedOverbookings && ($maxOverbookingCount >= $maxAllowedOverbookings)) {
|
||||
$cancelOrder = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// set order status after all conditions checks
|
||||
if ($cancelOrder) {
|
||||
$id_order_state = Configuration::get('PS_OS_CANCELED');
|
||||
} else {
|
||||
if ($order->valid) {
|
||||
if ($order->is_advance_payment && $order->advance_paid_amount < $order->total_paid_tax_incl) {
|
||||
$id_order_state = Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID');
|
||||
} else {
|
||||
$id_order_state = Configuration::get('PS_OS_OVERBOOKING_PAID');
|
||||
}
|
||||
} else {
|
||||
$id_order_state = Configuration::get('PS_OS_OVERBOOKING_UNPAID');
|
||||
}
|
||||
}
|
||||
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = (int)$order->id;
|
||||
$history->changeIdOrderState(Configuration::get($order->valid ? 'PS_OS_OUTOFSTOCK_PAID' : 'PS_OS_OUTOFSTOCK_UNPAID'), $order, true);
|
||||
$history->changeIdOrderState($id_order_state, $order, true);
|
||||
$history->addWithemail();
|
||||
}
|
||||
|
||||
@@ -1147,8 +1233,21 @@ abstract class PaymentModuleCore extends Module
|
||||
PrestaShopLogger::addLog('PaymentModule::validateOrder - Mail is about to be sent', 1, null, 'Cart', (int)$id_cart, true);
|
||||
}
|
||||
|
||||
// Send order confirmation mails to the reciepients according to the order mail configuration
|
||||
$orderStatusObj = new OrderState((int)$id_order_state, (int)$this->context->language->id);
|
||||
$data['{order_status}'] = $orderStatusObj->name;
|
||||
$data['{order_status_color}'] = $orderStatusObj->color;
|
||||
// Send order confirmation/overbooking mails to the reciepients according to the order mail configuration
|
||||
$overBookingStates = OrderState::getOverBookingStates();
|
||||
$isOverBookingStatus = in_array($id_order_state, $overBookingStates);
|
||||
if (Configuration::get('PS_ORDER_CONF_MAIL_TO_CUSTOMER')){
|
||||
// If order currenct state is overbooking, the send overbooking email or send order confirmation email
|
||||
if ($isOverBookingStatus) {
|
||||
$subject = Mail::l('Order Not Confirmed', (int)$order->id_lang);
|
||||
$template = 'overbooking';
|
||||
} else {
|
||||
$subject = Mail::l('Order confirmation', (int)$order->id_lang);
|
||||
$template = 'order_conf';
|
||||
}
|
||||
if (Validate::isEmail($this->context->customer->email)) {
|
||||
// send customer information
|
||||
$data['{firstname}'] = $this->context->customer->firstname;
|
||||
@@ -1156,8 +1255,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$data['{email}'] = $this->context->customer->email;
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'order_conf',
|
||||
Mail::l('Order confirmation', (int)$order->id_lang),
|
||||
$template,
|
||||
$subject,
|
||||
$data,
|
||||
$this->context->customer->email,
|
||||
$this->context->customer->firstname.' '.$this->context->customer->lastname,
|
||||
@@ -1178,8 +1277,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$data['{email}'] = $objOrderCustomerGuestDetail->email;
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'order_conf',
|
||||
Mail::l('Order confirmation', (int)$order->id_lang),
|
||||
$template,
|
||||
$subject,
|
||||
$data,
|
||||
$objOrderCustomerGuestDetail->email,
|
||||
$objOrderCustomerGuestDetail->firstname.' '.$objOrderCustomerGuestDetail->lastname,
|
||||
@@ -1193,8 +1292,17 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
if (Configuration::get('PS_ORDER_CONF_MAIL_TO_SUPERADMIN')){
|
||||
// send superadmin information
|
||||
// get superadmin employees
|
||||
if ($superAdminEmployees = Employee::getEmployeesByProfile(_PS_ADMIN_PROFILE_, true)) {
|
||||
// If order currenct state is overbooking, the send overbooking email or send order confirmation email
|
||||
if ($isOverBookingStatus) {
|
||||
$subject = Mail::l('Order Not Confirmed', (int)$order->id_lang);
|
||||
$template = 'overbooking_admin';
|
||||
} else {
|
||||
$subject = Mail::l('Order confirmation', (int)$order->id_lang);
|
||||
$template = 'order_conf_admin';
|
||||
}
|
||||
|
||||
foreach ($superAdminEmployees as $superAdminEmployee) {
|
||||
if (Validate::isEmail($superAdminEmployee['email'])) {
|
||||
$data['{customer_name}'] = $this->context->customer->firstname.' '.$this->context->customer->lastname;
|
||||
@@ -1204,8 +1312,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$data['{email}'] = $superAdminEmployee['email'];
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'order_conf_admin',
|
||||
Mail::l('Order confirmation', (int)$order->id_lang),
|
||||
$template,
|
||||
$subject,
|
||||
$data,
|
||||
$superAdminEmployee['email'],
|
||||
$superAdminEmployee['firstname'].' '.$superAdminEmployee['lastname'],
|
||||
@@ -1222,6 +1330,14 @@ abstract class PaymentModuleCore extends Module
|
||||
&& Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))
|
||||
) {
|
||||
if (Configuration::get('PS_ORDER_CONF_MAIL_TO_HOTEL_MANAGER')){
|
||||
// If order currenct state is overbooking, the send overbooking email or send order confirmation email
|
||||
if ($isOverBookingStatus) {
|
||||
$subject = Mail::l('Order Not Confirmed', (int)$order->id_lang);
|
||||
$template = 'overbooking_admin';
|
||||
} else {
|
||||
$subject = Mail::l('Order confirmation', (int)$order->id_lang);
|
||||
$template = 'order_conf_admin';
|
||||
}
|
||||
// send hotel information
|
||||
$data['{firstname}'] = '';
|
||||
$data['{lastname}'] = '';
|
||||
@@ -1231,8 +1347,8 @@ abstract class PaymentModuleCore extends Module
|
||||
if (Validate::isEmail($objHotel->email)) {
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'order_conf_admin',
|
||||
Mail::l('Order confirmation', (int)$order->id_lang),
|
||||
$template,
|
||||
$subject,
|
||||
$data,
|
||||
$objHotel->email,
|
||||
null,
|
||||
@@ -1247,6 +1363,16 @@ abstract class PaymentModuleCore extends Module
|
||||
if ($htlAccesses = $objHotel->getHotelAccess($idHotel)) {
|
||||
$data['{customer_name}'] = $this->context->customer->firstname.' '.$this->context->customer->lastname;
|
||||
$data['{customer_email}'] = $this->context->customer->email;
|
||||
|
||||
// If order currenct state is overbooking, the send overbooking email or send order confirmation email
|
||||
if ($isOverBookingStatus) {
|
||||
$subject = Mail::l('Order Not Confirmed', (int)$order->id_lang);
|
||||
$template = 'overbooking_admin';
|
||||
} else {
|
||||
$subject = Mail::l('Order confirmation', (int)$order->id_lang);
|
||||
$template = 'order_conf_admin';
|
||||
}
|
||||
|
||||
foreach ($htlAccesses as $access) {
|
||||
if ($access['access'] && $access['id_profile'] != _PS_ADMIN_PROFILE_) {
|
||||
if ($htlEmployees = Employee::getEmployeesByProfile($access['id_profile'])) {
|
||||
@@ -1258,8 +1384,8 @@ abstract class PaymentModuleCore extends Module
|
||||
$data['{email}'] = $empl['email'];
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'order_conf_admin',
|
||||
Mail::l('Order confirmation', (int)$order->id_lang),
|
||||
$template,
|
||||
$subject,
|
||||
$data,
|
||||
$empl['email'],
|
||||
$empl['firstname'].' '.$empl['lastname'],
|
||||
@@ -1277,7 +1403,6 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// updates stock in shops
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) {
|
||||
$product_list = $order->getProducts();
|
||||
|
||||
@@ -34,6 +34,10 @@ class OrderCore extends ObjectModel
|
||||
const ORDER_PAYMENT_TYPE_FULL = 1;
|
||||
const ORDER_PAYMENT_TYPE_ADVANCE = 2;
|
||||
|
||||
// actions when overbooking will be created
|
||||
const OVERBOOKING_ORDER_CANCEL_ACTION = 1;
|
||||
const OVERBOOKING_ORDER_NO_ACTION = 2;
|
||||
|
||||
//Consts for: In the order list in which currency prices should be displayed
|
||||
const ORDER_LIST_PRICE_DISPLAY_IN_PAYMENT_CURRENCY = 1;
|
||||
const ORDER_LIST_PRICE_DISPLAY_IN_DEFAULT_CURRENCY = 2;
|
||||
|
||||
@@ -155,4 +155,13 @@ class OrderStateCore extends ObjectModel
|
||||
{
|
||||
return !($this->unremovable);
|
||||
}
|
||||
|
||||
public static function getOverBookingStates()
|
||||
{
|
||||
return array(
|
||||
Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID'),
|
||||
Configuration::get('PS_OS_OVERBOOKING_PAID'),
|
||||
Configuration::get('PS_OS_OVERBOOKING_UNPAID'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,18 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
)
|
||||
);
|
||||
|
||||
// actions when overbooking will be created
|
||||
$overbookingAction = array(
|
||||
array(
|
||||
'value' => Order::OVERBOOKING_ORDER_CANCEL_ACTION,
|
||||
'name' => $this->l('Cancel the booking')
|
||||
),
|
||||
array(
|
||||
'value' => Order::OVERBOOKING_ORDER_NO_ACTION,
|
||||
'name' => $this->l('Take the overbooking')
|
||||
)
|
||||
);
|
||||
|
||||
// Options to display currency in order list
|
||||
$displayCurrencyOptions = array(
|
||||
array(
|
||||
@@ -195,33 +207,83 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
'email' => array(
|
||||
'title' => $this->l('Email'),
|
||||
'title' => $this->l('Order Confirmation / Overbooking Email'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'PS_ORDER_CONF_MAIL_TO_CUSTOMER' => array(
|
||||
'title' => $this->l('Order confirmation mail to customer'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation email to the customer.'),
|
||||
'title' => $this->l('Send email to customer'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation or overbooking or overbooking email to the customer.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_ORDER_CONF_MAIL_TO_SUPERADMIN' => array(
|
||||
'title' => $this->l('Order confirmation mail to super admin'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation email to the super admin.'),
|
||||
'title' => $this->l('Send email to super admin'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation or overbooking email to the super admin.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_ORDER_CONF_MAIL_TO_HOTEL_MANAGER' => array(
|
||||
'title' => $this->l('Order confirmation mail to hotelier'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation email to the hotelier. Mail will be sent to the email saved while creating the hotel.'),
|
||||
'title' => $this->l('Send email to hotelier'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation or overbooking email to the hotelier. Mail will be sent to the email saved while creating the hotel.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
'PS_ORDER_CONF_MAIL_TO_EMPLOYEE' => array(
|
||||
'title' => $this->l('Order confirmation mail to employees'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation email to employees having permission to manage the hotel.'),
|
||||
'title' => $this->l('Send email to employees'),
|
||||
'hint' => $this->l('Enable, if you want to send order confirmation or overbooking email to employees having permission to manage the hotel.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save'))
|
||||
),
|
||||
'overbooking' => array(
|
||||
'title' => $this->l('Overbooking'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'PS_OVERBOOKING_ORDER_ACTION' => array(
|
||||
'title' => $this->l('Overbooking order action'),
|
||||
'hint' => $this->l('Please choose the action to take when overbooking is created in any order.'),
|
||||
'validation' => 'isInt',
|
||||
'type' => 'select',
|
||||
'cast' => 'intval',
|
||||
'validation' => 'isInt',
|
||||
'list' => $overbookingAction,
|
||||
'identifier' => 'value',
|
||||
'js' => "changeOverbookingOrderAction()"
|
||||
),
|
||||
'PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY' => array(
|
||||
'title' => $this->l('Maximun hotel overbookings per date'),
|
||||
'hint' => $this->l('Enter the maximum number of the overbookings on any date can be created for a hotel.(Set 0 for no limit)'),
|
||||
'desc' => $this->l('When maximun number of the overbookings on any date in the booking duration is reached, then the new overbooking order will be cancelled.(Set 0 for no limit)'),
|
||||
'validation' => 'isInt',
|
||||
'type' => 'text',
|
||||
'class' => 'fixed-width-xxl',
|
||||
'validation' => 'isInt',
|
||||
'id' => 'PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY',
|
||||
),
|
||||
'OVERBOOKING_ORDER_CANCEL_ACTION' => array(
|
||||
'title' => $this->l('Overbooking order cancel action value'),
|
||||
'type' => 'hidden',
|
||||
'value' => Order::OVERBOOKING_ORDER_CANCEL_ACTION,
|
||||
'auto_value' => false,
|
||||
),
|
||||
'OVERBOOKING_ORDER_NO_ACTION' => array(
|
||||
'title' => $this->l('Overbooking order no action value'),
|
||||
'validation' => 'isInt',
|
||||
'cast' => 'intval',
|
||||
'type' => 'hidden',
|
||||
'value' => Order::OVERBOOKING_ORDER_NO_ACTION,
|
||||
'auto_value' => false
|
||||
),
|
||||
'PS_OVERBOOKING_AUTO_RESOLVE' => array(
|
||||
'title' => $this->l('Resolve overbooking automatically'),
|
||||
'hint' => $this->l('Enable, if you want to resolve overbooking automatically when rooms are available to be replaced with overbooked rooms.'),
|
||||
'desc' => $this->l('If enabled, the overbookings in the order will be resolved automatically when rooms are available to be replaced with all overbooked rooms in the order.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
|
||||
@@ -96,6 +96,22 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
$this->_group = ' GROUP BY hbd.`id_order`';
|
||||
|
||||
// if request for resolvable overbooked orders filter comes the set condition for this
|
||||
if (Tools::getIsset('resolvable_overbooked_orders') && Tools::getValue('resolvable_overbooked_orders')) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
$resolvableOrders = array();
|
||||
// Overbookings information of the order
|
||||
if ($orderOverBookings = $objHotelBookingDetail->getOverbookedRooms()) {
|
||||
foreach ($orderOverBookings as $overBookedRoom) {
|
||||
if (!in_array($overBookedRoom['id_order'], $resolvableOrders)) {
|
||||
$resolvableOrders[$overBookedRoom['id_order']] = $overBookedRoom['id_order'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_where = ' AND a.`id_order` IN ('.implode(',', $resolvableOrders).')';
|
||||
}
|
||||
|
||||
|
||||
$statuses = OrderState::getOrderStates((int)$this->context->language->id);
|
||||
foreach ($statuses as $status) {
|
||||
$this->statuses_array[$status['id_order_state']] = $status['name'];
|
||||
@@ -326,6 +342,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
parent::__construct();
|
||||
|
||||
// overbooking success status
|
||||
$this->_conf[51] = $this->l('Overbooking is successfully resolved');
|
||||
$this->_conf[52] = $this->l('Room in the booking is successfully reallocated');
|
||||
$this->_conf[53] = $this->l('Room in the booking is successfully swapped');
|
||||
}
|
||||
@@ -610,6 +628,13 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
public function renderList()
|
||||
{
|
||||
// Show all resolvable overbookings if available
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
if ($resolvableOverBookings = $objHotelBookingDetail->getOverbookedRooms(0, 0, '', '', 0, 0, 2)) {
|
||||
$this->context->smarty->assign('resolvableOverBookings', $resolvableOverBookings);
|
||||
$this->content .= $this->context->smarty->fetch('controllers/orders/_resolvable_overbookings.tpl');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitBulkupdateOrderStatus'.$this->table)) {
|
||||
if (Tools::getIsset('cancel')) {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
|
||||
@@ -1701,7 +1726,20 @@ class AdminOrdersControllerCore extends AdminController
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
|
||||
}
|
||||
} elseif(Tools::getIsset('resolve_overbooking') && Tools::getValue('resolve_overbooking')) {
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
// resolve an overbooking manually
|
||||
if ($objHotelBookingDetail->resolveOverbookings(Tools::getValue('resolve_overbooking'))) {
|
||||
if (Tools::getValue('id_order')) {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=51&token='.$this->token);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=51&token='.$this->token);
|
||||
}
|
||||
} else {
|
||||
$this->errors = Tools::displayError('An error occurred while resolving overbooking.');
|
||||
}
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
@@ -2111,8 +2149,12 @@ class AdminOrdersControllerCore extends AdminController
|
||||
// applicable refund policies
|
||||
$applicableRefundPolicies = HotelOrderRefundRules::getApplicableRefundRules($order->id);
|
||||
|
||||
// Overbookings information of the order
|
||||
$orderOverBookings = $objHotelBookingDetail->getOverbookedRooms($order->id, 0, '', '', 0, 0, 1);
|
||||
|
||||
$this->tpl_view_vars = array(
|
||||
// refund info
|
||||
'orderOverBookings' => $orderOverBookings,
|
||||
'refund_allowed' => (int) $order->isReturnable(),
|
||||
'applicable_refund_policies' => $applicableRefundPolicies,
|
||||
'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id),
|
||||
|
||||
@@ -66,6 +66,7 @@ class HistoryControllerCore extends FrontController
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
'orders' => $orders,
|
||||
'overbooking_order_states' => OrderState::getOverBookingStates(),
|
||||
'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'),
|
||||
'reorderingAllowed' => !(bool)Configuration::get('PS_DISALLOW_HISTORY_REORDERING'),
|
||||
'slowValidation' => Tools::isSubmit('slowvalidation')
|
||||
|
||||
@@ -679,6 +679,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
'invoice' => (OrderState::invoiceAvailable($id_order_state) && count($order->getInvoicesCollection())),
|
||||
'logable' => (bool) $order_status->logable,
|
||||
'order_history' => $order->getHistory($this->context->language->id, false, true),
|
||||
'overbooking_order_states' => OrderState::getOverBookingStates(),
|
||||
'products' => $products,
|
||||
'discounts' => $order->getCartRules(),
|
||||
'carrier' => $carrier,
|
||||
|
||||
BIN
install/data/img/os/Overbooking_partial_paid.gif
Normal file
BIN
install/data/img/os/Overbooking_partial_paid.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -332,6 +332,12 @@
|
||||
<configuration id="PS_GUEST_CHECKOUT_ENABLED" name="PS_GUEST_CHECKOUT_ENABLED">
|
||||
<value>0</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OVERBOOKING_ORDER_ACTION" name="PS_OVERBOOKING_ORDER_ACTION">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
<configuration id="PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY" name="PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY">
|
||||
<value>0</value>
|
||||
</configuration>
|
||||
<configuration id="PS_ORDER_CONF_MAIL_TO_CUSTOMER" name="PS_ORDER_CONF_MAIL_TO_CUSTOMER">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
@@ -431,6 +437,9 @@
|
||||
<configuration id="PS_OS_OVERBOOKING_UNPAID" name="PS_OS_OVERBOOKING_UNPAID">
|
||||
<value>11</value>
|
||||
</configuration>
|
||||
<configuration id="PS_OS_OVERBOOKING_PARTIAL_PAID" name="PS_OS_OVERBOOKING_PARTIAL_PAID">
|
||||
<value>12</value>
|
||||
</configuration>
|
||||
<!-- <configuration id="PS_OS_AWAITING_PARTIAL_PAYMENT" name="PS_OS_AWAITING_PARTIAL_PAYMENT">
|
||||
<value>13</value>
|
||||
</configuration> -->
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</order_state>
|
||||
<order_state id="Payment_error" invoice="0" send_email="1" color="#8f0621" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid" invoice="1" send_email="1" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="1" pdf_delivery="0" pdf_invoice="0">
|
||||
<order_state id="Overbooking_paid" invoice="1" send_email="0" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="1" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted" invoice="1" send_email="1" color="#F0B656" unremovable="1" hidden="0" logable="1" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
@@ -34,7 +34,9 @@
|
||||
</order_state>
|
||||
<order_state id="Payment_remotely_accepted" invoice="1" send_email="0" color="#32CD32" unremovable="1" hidden="0" logable="1" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid" invoice="0" send_email="1" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
<order_state id="Overbooking_unpaid" invoice="0" send_email="0" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid" invoice="0" send_email="0" color="#FF69B4" unremovable="1" hidden="0" logable="0" delivery="0" shipped="0" paid="0" pdf_delivery="0" pdf_invoice="0">
|
||||
</order_state>
|
||||
</entities>
|
||||
</entity_order_state>
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -33,11 +33,15 @@
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_paid">
|
||||
<name>Overbooking (paid)</name>
|
||||
<name>Overbooking (Paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_unpaid">
|
||||
<name>Overbooking (not paid)</name>
|
||||
<name>Overbooking (Not paid)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Overbooking_partial_paid">
|
||||
<name>Overbooking (Partial payment)</name>
|
||||
<template/>
|
||||
</order_state>
|
||||
<order_state id="Partial_payment_accepted">
|
||||
|
||||
@@ -504,6 +504,14 @@ function changeCMSActivationAuthorization()
|
||||
getE('PS_CONDITIONS_CMS_ID').disabled = 'disabled';
|
||||
}
|
||||
|
||||
function changeOverbookingOrderAction()
|
||||
{
|
||||
if (getE('PS_OVERBOOKING_ORDER_ACTION').value == $("input[name='OVERBOOKING_ORDER_CANCEL_ACTION']").val())
|
||||
$('#PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY').closest('.form-group').hide();
|
||||
else
|
||||
$('#PS_MAX_OVERBOOKING_PER_HOTEL_PER_DAY').closest('.form-group').show();
|
||||
}
|
||||
|
||||
function disableZipFormat()
|
||||
{
|
||||
if ($('#need_zip_code_on').prop('checked') == false)
|
||||
|
||||
@@ -1844,6 +1844,11 @@ $(document).on('click', '#booking-documents-modal .documents-list .btn-delete-do
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.reallocate_overbooking', function(e) {
|
||||
e.preventDefault();
|
||||
$('#reallocate_room_' + $(this).attr('id_htl_booking')).trigger('click');
|
||||
});
|
||||
|
||||
const BookingDocumentsModal = {
|
||||
init: function(idHtlBooking, $this) {
|
||||
BookingDocumentsModal.currentTr = $this;
|
||||
|
||||
381
mails/en/overbooking.html
Executable file
381
mails/en/overbooking.html
Executable file
@@ -0,0 +1,381 @@
|
||||
<!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"> </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:uppercase;line-height:33px">Hi {firstname} {lastname},</span><br/><br/>
|
||||
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">Thank you for selecting our hotel!</span><br/><br/>
|
||||
<span class="subtitle" style="font-weight:600;font-size:16px;line-height:25px">Bookings in this order are Not Confirmed yet !!</span><br/>
|
||||
<span class="subtitle" style="font-weight:500;font-size:14px;line-height:25px">We are sorry for your inconvenience. Please contact hotel to get final confirmation for your bookings.</span>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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"> </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:18px;padding-bottom:10px">Order details</p>
|
||||
<span style="color:#777">
|
||||
<span style="color:#333"><strong>Order:</strong></span> {order_name} Placed on {date}<br /><br />
|
||||
<span style="color:#333"><strong>Payment:</strong></span> {payment}<br /><br />
|
||||
<span style="color:#333"><strong>Status:</strong></span> <span style="background-color: {order_status_color}; color: #FFF; padding: 5px 10px; border-radius: 2px; font-weight: 600;">{order_status}</span>
|
||||
</span>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:7px 0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
|
||||
<tr>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Image</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Description</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Hotel</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Room Capcity</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Unit Price</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Rooms Qty</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Check-in Date</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Check-out Date</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Total</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{cart_booking_data_html}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;color:#777;padding:7px 0">
|
||||
{extra_demands_details_html}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:7px 0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
|
||||
<tr>
|
||||
<td colspan="2" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{discounts}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Rooms Cost</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" align="right" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{room_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Extra Services Cost </strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" align="right" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{additional_service_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Discounts</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_discounts}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Convenience Fees</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_convenience_fee_te}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Tax</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_tax_paid}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Final Booking Amount</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="4" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_paid}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:7px 0">
|
||||
<table class="table" style="width:100%">
|
||||
<tr>
|
||||
<td class="box address" width="310" 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"> </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:18px;padding-bottom:10px">
|
||||
Customer address </p>
|
||||
<span data-html-only="1" style="color:#777">
|
||||
{invoice_block_html}
|
||||
</span>
|
||||
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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 order and download your invoice from the <a href="{history_url}" style="color:#337ff1">"Order history"</a> section of your customer account by clicking <a href="{my_account_url}" style="color:#337ff1">"My account"</a> on our shop. </span>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="linkbelow" style="padding:7px 0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<span>
|
||||
If you have a guest account, you can follow your order via the <a href="{guest_tracking_url}?id_order={order_name}" style="color:#337ff1">"Guest Tracking"</a> section on our shop.</span>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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™</a></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="space" style="width:20px;padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
60
mails/en/overbooking.txt
Normal file
60
mails/en/overbooking.txt
Normal file
@@ -0,0 +1,60 @@
|
||||
Message from {shop_name}
|
||||
Hi {firstname} {lastname},
|
||||
Thank you for selecting our hotel!
|
||||
Bookings in this order are Not Confirmed yet !!
|
||||
We are sorry for your inconvenience. Please contact hotel to get final confirmation for your bookings.
|
||||
|
||||
Order details
|
||||
Order: {order_name} Placed on {date}
|
||||
Payment: {payment}
|
||||
Status: {order_status}
|
||||
|
||||
Room Image
|
||||
Room Description
|
||||
Hotel
|
||||
Room Capcity
|
||||
Unit Price
|
||||
Rooms Qty
|
||||
Check-in Date
|
||||
Check-out Date
|
||||
Total
|
||||
|
||||
{cart_booking_data_text}
|
||||
|
||||
{extra_demands_details_text}
|
||||
|
||||
{discounts}
|
||||
|
||||
Total Rooms Cost
|
||||
{total_products}
|
||||
|
||||
Total Extra Services Cost
|
||||
{total_extra_demands_te}
|
||||
|
||||
Discounts
|
||||
{total_discounts}
|
||||
|
||||
Total Rooms Tax
|
||||
{total_tax_paid}
|
||||
|
||||
Extra Services Tax
|
||||
{extra_demands_tax}
|
||||
|
||||
Final Booking Amount
|
||||
{total_paid}
|
||||
|
||||
Customer address
|
||||
{invoice_block_html}
|
||||
|
||||
You can review your order and download your invoice from the
|
||||
"Order history" [{history_url}] section of your
|
||||
customer account by clicking "My account"
|
||||
[{my_account_url}] on our shop.
|
||||
|
||||
If you have a guest account, you can follow your order via the
|
||||
"Guest Tracking"
|
||||
[{guest_tracking_url}?id_order={order_name}] section
|
||||
on our shop.
|
||||
|
||||
{shop_name} [{shop_url}] powered by
|
||||
Webkul(tm) [https://webkul.com]
|
||||
353
mails/en/overbooking_admin.html
Executable file
353
mails/en/overbooking_admin.html
Executable file
@@ -0,0 +1,353 @@
|
||||
<!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:800px;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"> </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:uppercase;line-height:33px">Hi {firstname} {lastname},</span><br/><br/>
|
||||
<span class="subtitle" style="font-weight:500;font-size:16px;line-height:25px">New Bookings created on {shop_name}!</span><br/><br/>
|
||||
<span class="subtitle" style="font-weight:600;font-size:16px;line-height:25px">Bookings in this order have Overbookings !!</span><br/>
|
||||
<span class="subtitle" style="font-weight:500;font-size:14px;line-height:25px">This order is not confirmed yet. Please check the order details to resolve overbookings.</span>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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"> </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:18px;padding-bottom:10px">
|
||||
Customer details </p>
|
||||
<span style="color:#777">
|
||||
<span style="color:#333"><strong>Name:</strong></span> {customer_name}<br /><br />
|
||||
<span style="color:#333"><strong>Email:</strong></span> {customer_email}
|
||||
</span>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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"> </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:18px;padding-bottom:10px">
|
||||
Order details </p>
|
||||
<span style="color:#777">
|
||||
<span style="color:#333"><strong>Order:</strong></span> {order_name} Placed on {date}<br /><br />
|
||||
<span style="color:#333"><strong>Payment:</strong></span> {payment}<br /><br />
|
||||
<span style="color:#333"><strong>Status:</strong></span> <span style="background-color: {order_status_color}; color: #FFF; padding: 5px 10px; border-radius: 2px; font-weight: 600;">{order_status}</span>
|
||||
</span>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding:7px 0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
|
||||
<tr>
|
||||
<tr>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Image</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Room Description</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Hotel</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Room Capcity</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Unit Price</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Rooms Qty</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Check-in Date</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Check-out Date</th>
|
||||
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Total</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{cart_booking_data_html}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{extra_demands_details_html}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
{discounts}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Rooms Cost</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" align="right" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{room_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Extra Services Cost</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" align="right" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{additional_service_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Discounts</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_discounts}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Convenience Fees</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_convenience_fee_te}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Total Tax</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_tax_paid}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Final Booking Amount</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
<tr>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="4" face="Open-sans, sans-serif" color="#555454">
|
||||
{total_paid}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="space_footer" style="padding:0!important"> </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™</a></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="space" style="width:20px;padding:7px 0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
51
mails/en/overbooking_admin.txt
Normal file
51
mails/en/overbooking_admin.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
Message from {shop_name}
|
||||
Hi {firstname} {lastname},
|
||||
|
||||
New Bookings created on {shop_name}!
|
||||
Bookings in this order have Overbookings !!
|
||||
This order is not confirmed yet. Please check the order details to resolve overbookings.
|
||||
|
||||
Customer details
|
||||
Name: {customer_name}
|
||||
Email: {customer_email}
|
||||
|
||||
Order details
|
||||
Order: {order_name} Placed on {date}
|
||||
Payment: {payment}
|
||||
Status: {order_status}
|
||||
|
||||
Room Image
|
||||
Room Description
|
||||
Hotel
|
||||
Room Capcity
|
||||
Unit Price
|
||||
Rooms Qty
|
||||
Check-in Date
|
||||
Check-out Date
|
||||
Total
|
||||
|
||||
{cart_booking_data_text}
|
||||
|
||||
{extra_demands_details_text}
|
||||
|
||||
{discounts}
|
||||
|
||||
Total Rooms Cost
|
||||
{total_products}
|
||||
|
||||
Total Extra Services Cost
|
||||
{total_extra_demands_te}
|
||||
|
||||
Discounts
|
||||
{total_discounts}
|
||||
|
||||
Total Rooms Tax
|
||||
{total_tax_paid}
|
||||
|
||||
Extra Services Tax
|
||||
{extra_demands_tax}
|
||||
|
||||
Final Booking Amount
|
||||
{total_paid}
|
||||
|
||||
{shop_name} powered by Webkul™
|
||||
@@ -55,9 +55,8 @@ class BankwireValidationModuleFrontController extends ModuleFrontController
|
||||
// Check Order restrict condition before Payment by the customer
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$order_restrict_error = HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this);
|
||||
if ($order_restrict_error) {
|
||||
die($this->errors);
|
||||
if (HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this)) {
|
||||
Tools::redirect('index.php?controller=order-opc');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +54,8 @@ class ChequeValidationModuleFrontController extends ModuleFrontController
|
||||
/*Check Order restrict condition before Payment by the customer*/
|
||||
if (Module::isInstalled('hotelreservationsystem') && Module::isEnabled('hotelreservationsystem')) {
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
$order_restrict_error = HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this);
|
||||
if ($order_restrict_error) {
|
||||
die($this->errors);
|
||||
if (HotelOrderRestrictDate::validateOrderRestrictDateOnPayment($this)) {
|
||||
Tools::redirect('index.php?controller=order-opc');
|
||||
}
|
||||
}
|
||||
/*END*/
|
||||
|
||||
@@ -168,6 +168,23 @@ class HotelBookingDetail extends ObjectModel
|
||||
parent::__construct($id);
|
||||
}
|
||||
|
||||
public function update($null_values = false)
|
||||
{
|
||||
$result = parent::update($null_values);
|
||||
|
||||
// if automatic overbooking resolution is enabled
|
||||
if (Configuration::get('PS_OVERBOOKING_AUTO_RESOLVE')) {
|
||||
// if room is getting free and this room is not already in back order then resolve the overbookings for this free room
|
||||
// $this->is_cancelled == 1 is not checked because currently we always set is_refunded to 1 when room is free
|
||||
// $this->is_back_order == 0 is checked because $this->is_back_order == 1 is used as room is free
|
||||
if ($this->is_refunded == 1 && $this->is_back_order == 0) {
|
||||
$this->resolveOverBookings();
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getBookingDataParams($params)
|
||||
{
|
||||
if (!isset($params['id_room_type'])) {
|
||||
@@ -1956,6 +1973,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
{
|
||||
$table = 'htl_booking_detail';
|
||||
$data = array('is_refunded' => (int) $is_refunded);
|
||||
|
||||
if ($id_rooms) {
|
||||
foreach ($id_rooms as $key_rm => $val_rm) {
|
||||
$where = 'id_order='.(int)$id_order.' AND id_room = '.(int)$val_rm['id_room'].' AND `date_from`= \''.
|
||||
@@ -1963,8 +1981,15 @@ class HotelBookingDetail extends ObjectModel
|
||||
$result = Db::getInstance()->update($table, $data, $where);
|
||||
}
|
||||
} else {
|
||||
return Db::getInstance()->update($table, $data, 'id_order='.(int)$id_order);
|
||||
$result = Db::getInstance()->update($table, $data, 'id_order='.(int)$id_order);
|
||||
}
|
||||
|
||||
// if automatic overbooking resolution is enabled
|
||||
if ($result && Configuration::get('PS_OVERBOOKING_AUTO_RESOLVE') && $is_refunded) {
|
||||
// if room is getting free and this room is not already in back order then resolve the overbookings for this free room
|
||||
$this->resolveOverBookings();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -3007,4 +3032,191 @@ class HotelBookingDetail extends ObjectModel
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get overbooked rooms in the order|hotel
|
||||
* @param [int] $idOrder : id of the order
|
||||
* @param [int] $idHotel : id of the hotel
|
||||
* @param [string] $dateFrom
|
||||
* @param [string] $dateTo
|
||||
* @param [int] $datewiseBreakup : send 1 to get overbooked rooms in datewise breakup
|
||||
* @param [int] $roomCount : send 1 to get the count of the rooms overbooked only
|
||||
* @param [int] $bookedRoomFlag : send 0 for no action | send 1 to get booked room info | send 2 to get overbooked rooms which are free
|
||||
*
|
||||
* @return array | integer : array of overbooked rooms | count of overbooked rooms
|
||||
*/
|
||||
public function getOverbookedRooms(
|
||||
$idOrder = 0,
|
||||
$idHotel = 0,
|
||||
$dateFrom = '',
|
||||
$dateTo = '',
|
||||
$datewiseBreakup = 0,
|
||||
$roomCount = 0,
|
||||
$bookedRoomInfoFlag = 0
|
||||
) {
|
||||
$result = array();
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($roomCount) {
|
||||
$sql .= ' COUNT(*)';
|
||||
} else {
|
||||
$sql .= ' *';
|
||||
}
|
||||
|
||||
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_back_order` = 1 AND `is_refunded` = 0 AND `is_cancelled` = 0';
|
||||
|
||||
if ($idOrder) {
|
||||
$sql .= ' AND `id_order` = '.(int) $idOrder;
|
||||
}
|
||||
if ($idHotel) {
|
||||
$sql .= ' AND `id_hotel` = '.(int) $idHotel;
|
||||
}
|
||||
|
||||
if ($datewiseBreakup && $dateFrom && $dateTo) {
|
||||
for ($currentDate = $dateFrom; $currentDate < $dateTo; $currentDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate)))) {
|
||||
$dateSql = $sql . ' AND `date_from` <= \''.pSQL($currentDate).'\' AND `date_to` > \''.pSQL($currentDate).'\'';
|
||||
|
||||
if ($roomCount) {
|
||||
$result[$currentDate] = Db::getInstance()->getValue($dateSql);
|
||||
} else {
|
||||
$result[$currentDate] = Db::getInstance()->executeS($dateSql);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($dateFrom && $dateTo) {
|
||||
$sql .= ' AND `date_from` < \''.pSQL($dateTo).'\' AND `date_to` > \''.pSQL($dateFrom).'\'';
|
||||
}
|
||||
|
||||
if ($roomCount) {
|
||||
$result = Db::getInstance()->getValue($sql);
|
||||
} else {
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ($bookedRoomInfoFlag && !$roomCount && $result) {
|
||||
$link = new Link();
|
||||
foreach ($result as $key => $bookingInfo) {
|
||||
$result[$key]['booked_room_info'] = $this->chechRoomBooked($bookingInfo['id_room'], $bookingInfo['date_from'], $bookingInfo['date_to']);
|
||||
$result[$key]['orders_filter_link'] = $link->getAdminLink('AdminOrders');
|
||||
|
||||
// if need only rooms which are available to resolve overbooking the unset booked rooms
|
||||
if ($bookedRoomInfoFlag == 2 && $result[$key]['booked_room_info']) {
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all the orders which are in overbooking
|
||||
* @param integer $onlyFutureDates : for orders which bookings dates are in future
|
||||
* @return array
|
||||
*/
|
||||
public function getOverBookedOrders($onlyFutureDates = 0)
|
||||
{
|
||||
$sql = 'SELECT DISTINCT `id_order` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_back_order` = 1 AND `is_refunded` = 0 AND `is_cancelled` = 0';
|
||||
|
||||
if ($onlyFutureDates) {
|
||||
$sql .= ' AND `date_to` > \''.pSQL(date('Y-m-d')).'\'';
|
||||
}
|
||||
$sql .= ' ORDER BY `id_order` ASC';
|
||||
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
|
||||
return array_column($result, 'id_order');
|
||||
}
|
||||
|
||||
// Resolve overbookings by checking current available rooms
|
||||
// Overbookings resolution will only be done if all overbookings are getting resolved in the order
|
||||
public function resolveOverBookings($idHotelBooking = 0)
|
||||
{
|
||||
$result = false;
|
||||
|
||||
$overBookedOrders = array();
|
||||
if ($idHotelBooking) {
|
||||
if (Validate::isLoadedObject($objHtlBookingDetail = new HotelBookingDetail($idHotelBooking))) {
|
||||
$overBookedOrders = array($objHtlBookingDetail->id_order);
|
||||
}
|
||||
} else {
|
||||
$overBookedOrders = $this->getOverBookedOrders(1);
|
||||
}
|
||||
|
||||
if ($overBookedOrders) {
|
||||
foreach ($overBookedOrders as $idOrder) {
|
||||
// get all overbooked rooms in the order so that we can decide status of the order after overbooking resolved
|
||||
$overBookedRooms = $this->getOverbookedRooms($idOrder);
|
||||
$totalOverBookedInOrder = count($overBookedRooms);
|
||||
|
||||
// if request for specific booking resolve
|
||||
if ($idHotelBooking) {
|
||||
$overBookedRooms = array((array)($objHtlBookingDetail));
|
||||
}
|
||||
|
||||
if ($overBookedRooms) {
|
||||
$resolvableOverbookings = array();
|
||||
foreach($overBookedRooms as $roomBooking) {
|
||||
$params = array(
|
||||
'idHotel' => $roomBooking['id_hotel'],
|
||||
'dateFrom' => $roomBooking['date_from'],
|
||||
'dateTo' => $roomBooking['date_to'],
|
||||
'idRoomType' => $roomBooking['id_product'],
|
||||
'searchOccupancy' => 0,
|
||||
'allowedIdRoomTypes' => implode(",", array($roomBooking['id_product']))
|
||||
);
|
||||
|
||||
if ($availableRooms = $this->getSearchAvailableRooms($params)) {
|
||||
if (isset($availableRooms['availableRoomTypes']['roomTypes'][$roomBooking['id_product']]['rooms'])
|
||||
&& $availableRooms['availableRoomTypes']['roomTypes'][$roomBooking['id_product']]['rooms']
|
||||
) {
|
||||
$availableRoomsInfo = $availableRooms['availableRoomTypes']['roomTypes'][$roomBooking['id_product']]['rooms'];
|
||||
if ($roomIdsAvailable = array_column($availableRoomsInfo, 'id_room')) {
|
||||
// If room is still there in the available rooms list then we can resolve its overbooking
|
||||
if (in_array($roomBooking['id_room'], $roomIdsAvailable)) {
|
||||
$resolvableOverbookings[] = $roomBooking['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if request for specific booking Or all overbooked rooms are resolved then resolve the overbooking by setting is_back_order to 0
|
||||
if ($idHotelBooking || (count($resolvableOverbookings) == $totalOverBookedInOrder)) {
|
||||
foreach ($resolvableOverbookings as $idHtlBookingDtl) {
|
||||
$objBookingDetail = new HotelBookingDetail($idHtlBookingDtl);
|
||||
$objBookingDetail->is_back_order = 0;
|
||||
$objBookingDetail->update();
|
||||
|
||||
$result = true;
|
||||
}
|
||||
|
||||
// After all overbookings are resolved we can update the status of the order
|
||||
if (count($resolvableOverbookings) == $totalOverBookedInOrder) {
|
||||
$objOrder = new Order($idOrder);
|
||||
$idOrderState = 0;
|
||||
if ($objOrder->current_state == Configuration::get('PS_OS_OVERBOOKING_PAID')) {
|
||||
$idOrderState = Configuration::get('PS_OS_PAYMENT_ACCEPTED');
|
||||
} elseif ($objOrder->current_state == Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')) {
|
||||
$idOrderState = Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED');
|
||||
} elseif ($objOrder->current_state == Configuration::get('PS_OS_OVERBOOKING_UNPAID')) {
|
||||
$idOrderState = Configuration::get('PS_OS_AWAITING_PAYMENT');
|
||||
}
|
||||
|
||||
// if we have order state to change
|
||||
if ($idOrderState) {
|
||||
$objOrderHistory = new OrderHistory();
|
||||
$objOrderHistory->id_order = (int)$idOrder;
|
||||
$objOrderHistory->changeIdOrderState((int)$idOrderState, $objOrder, true);
|
||||
$objOrderHistory->add();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,11 @@
|
||||
<td{if isset($order.order_state)} data-value="{$order.id_order_state}"{/if} class="history_state">
|
||||
{if isset($order.order_state)}
|
||||
<span class="label{if isset($order.order_state_color) && Tools::getBrightness($order.order_state_color) > 128} dark{/if}"{if isset($order.order_state_color) && $order.order_state_color} style="background-color:{$order.order_state_color|escape:'html':'UTF-8'}; border-color:{$order.order_state_color|escape:'html':'UTF-8'};"{/if}>
|
||||
{$order.order_state|escape:'html':'UTF-8'}
|
||||
{if $order.current_state|in_array:$overbooking_order_states}
|
||||
{l s='Order Not Confirmed'}
|
||||
{else}
|
||||
{$order.order_state|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
@@ -76,7 +76,15 @@
|
||||
{foreach from=$order_history item=state name="orderStates"}
|
||||
<tr class="{if $smarty.foreach.orderStates.first}first_item{elseif $smarty.foreach.orderStates.last}last_item{/if} {if $smarty.foreach.orderStates.index % 2}alternate_item{else}item{/if}">
|
||||
<td class="step-by-step-date">{dateFormat date=$state.date_add full=0}</td>
|
||||
<td><span{if isset($state.color) && $state.color} style="background-color:{$state.color|escape:'html':'UTF-8'}; border-color:{$state.color|escape:'html':'UTF-8'};"{/if} class="label{if isset($state.color) && Tools::getBrightness($state.color) > 128} dark{/if}">{$state.ostate_name|escape:'html':'UTF-8'}</span></td>
|
||||
<td>
|
||||
<span{if isset($state.color) && $state.color} style="background-color:{$state.color|escape:'html':'UTF-8'}; border-color:{$state.color|escape:'html':'UTF-8'};"{/if} class="label{if isset($state.color) && Tools::getBrightness($state.color) > 128} dark{/if}">
|
||||
{if $state.id_order_state|in_array:$overbooking_order_states}
|
||||
{l s='Order Not Confirmed'}
|
||||
{else}
|
||||
{$state.ostate_name|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user