Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Overbooking issues in QloApps and added new configurations for overbooking handling #895

Merged
merged 9 commits into from
Mar 17, 2024
6 changes: 6 additions & 0 deletions admin/themes/default/sass/controllers/_order.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion admin/themes/default/sass/modules/_variables.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion admin/themes/default/sass/partials/_content.sass
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
93 changes: 93 additions & 0 deletions admin/themes/default/template/controllers/orders/_overbookings.tpl
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @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'}&amp;vieworder&amp;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'}&amp;vieworder&amp;id_order={$data['id_order']}&amp;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}
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
* @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'}&amp;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')}&amp;id_product={$data['id_product']|escape:'html':'UTF-8'}&amp;updateproduct">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
</td>
<td>
<a href="{$link->getAdminLink('AdminAddHotel')}&amp;id={$data['id_hotel']|escape:'html':'UTF-8'}&amp;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'}&amp;vieworder&amp;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'}&amp;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}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,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">
Expand Down
Loading