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

Added: Info for convenience fees products and taxes breakup in admin order detail page. #1169

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions admin/themes/default/sass/controllers/_order.sass
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,20 @@
right: 0
left: unset
font-size: 14px

#order-details-price
.icon-bold
font-weight: 600
#convenience_services, #order_tax_details
.panel
.table
tr
&:last-child td
border-bottom: none
td
background-color: #F5F8F9
padding: 10px
background-color: #F5F8F9
// Adding transparent border for display while printing screen
border: solid 1px transparent
border-radius: 0
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
<div class="col-lg-4 col-sm-6 col-xs-12 pull-right">
<div class="panel panel-total">
<div class="table-responsive">
<table class="table">
<table class="table" id="order-details-price">
{* Assign order price *}
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
{assign var=order_product_price value=($order->total_products)}
Expand Down Expand Up @@ -889,50 +889,82 @@

{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
<tr id="total_products">
<td class="text-right">{l s='Convenience Fee (Tax excl.)'}</td>
<td class="amount text-right nowrap">
{displayPrice price=$convenience_fee_price_tax_excl currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}

{if $room_price_tax_excl}
<tr id="total_tax_order">
<td class="text-right">{l s='Total Rooms Tax'}</td>
<td class="text-right nowrap">
{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
<tr id="total_tax_order">
<td class="text-right">{l s='Extra services Tax'}</td>
<td class="text-right nowrap">
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) currency=$currency->id}
<td class="text-right">
{l s='Convenience Fee (Tax excl.)'}
{if isset($booking_auto_added_services) && count($booking_auto_added_services)}
<span role="button" id="view_convenience_services" class="pull-left"><i class="icon-angle-down icon-bold"></i><i class="icon-angle-up icon-bold" style="display:none;"></i></span>
{/if}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
<tr id="total_products">
<td class="text-right">{l s='Convenience Fee Tax'}</td>
<td class="amount text-right nowrap">
{displayPrice price=($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl) currency=$currency->id}
{displayPrice price=$convenience_fee_price_tax_excl currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{if isset($booking_auto_added_services) && count($booking_auto_added_services)}
<tr id="convenience_services" style="display:none;">
<td colspan="3" class="panel">
<table class="table table-responsive">
<tbody>
{foreach $booking_auto_added_services as $service}
<tr>
<td class="text-left"><span>{$service.name}</span></td>
<td class="text-right"><span>{displayPrice price=$service.total_price_tax_excl currency=$currency->id}</span></td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
{/if}
{/if}

{* {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} *}
<tr id="total_taxes">
<td class="text-right"><strong>{l s='Total Taxes'}</strong>
<td class="text-right">
<strong>{l s='Total Taxes'} </strong>
{if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0}
<span role="button" id="view_order_tax_details" class="pull-left"><i class="icon-angle-down icon-bold"></i><i class="icon-angle-up icon-bold" style="display:none;"></i></span>
{/if}
</td>
<td class="amount text-right nowrap" ><strong>{displayPrice price=(($order->total_paid_tax_incl + $order->total_discounts_tax_incl) - ($order->total_paid_tax_excl + $order->total_discounts_tax_excl)) currency=$currency->id}</strong>
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{if ($order->total_paid_tax_incl - $order->total_paid_tax_excl) > 0}
<tr id="order_tax_details" style="display:none;">
<td colspan="3" class="panel">
<table class="table table-responsive">
<tbody>
{if $room_price_tax_excl}
<tr>
<td class="text-left">{l s='Total Rooms Tax'}</td>
<td class="text-right">
{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}
</td>
</tr>
{/if}
{if isset($additional_service_price_tax_incl) && (($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) > 0}
<tr>
<td class="text-left">{l s='Extra services Tax'}</td>
<td class="text-right nowrap">
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl)) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}
{if isset($convenience_fee_price_tax_excl) && $convenience_fee_price_tax_excl > 0}
<tr id="total_products">
<td class="text-left">{l s='Convenience Fee Tax'}</td>
<td class="amount text-right nowrap">
{displayPrice price=($convenience_fee_price_tax_incl - $convenience_fee_price_tax_excl) currency=$currency->id}
</td>
<td class="partial_refund_fields current-edit" style="display:none;"></td>
</tr>
{/if}
</tbody>
</table>
</td>
</tr>
{/if}
{* {/if} *}
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
<td class="text-right"><strong>{l s='Total Booking Amount'}</strong></td>
Expand Down
30 changes: 30 additions & 0 deletions controllers/admin/AdminOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,7 @@ public function renderView()
$totalDemandsPriceTE = 0;
$totalDemandsPriceTI = 0;
$totalRefundedRooms = 0;
$bookingAutoAddedServices = array();
if ($order_detail_data = $objBookingDetail->getOrderFormatedBookinInfoByIdOrder($order->id)) {
$objBookingDemand = new HotelBookingDemands();
$objHotelRoomType = new HotelRoomType();
Expand Down Expand Up @@ -2882,6 +2883,34 @@ public function renderView()
$order_detail_data = array();
}

if ($orderedRooms = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
0,
0,
0,
0,
0,
null,
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
)) {
foreach($orderedRooms as $orderedRoom) {
if (isset($orderedRoom['additional_services']) && $orderedRoom['additional_services']) {
foreach ($orderedRoom['additional_services'] as $service) {
if (isset($bookingAutoAddedServices[$service['id_product']])) {
$bookingAutoAddedServices[$service['id_product']]['total_price_tax_excl'] += $service['total_price_tax_excl'];
} else {
$bookingAutoAddedServices[$service['id_product']]['name'] = $service['name'];
$bookingAutoAddedServices[$service['id_product']]['total_price_tax_excl'] = $service['total_price_tax_excl'];
}
}
}
}
}


$objOrderReturn = new OrderReturn();
$refundedAmount = 0;
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1, 0, 1)) {
Expand Down Expand Up @@ -3037,6 +3066,7 @@ public function renderView()
'ROOM_STATUS_CHECKED_IN' => HotelBookingDetail::STATUS_CHECKED_IN,
'ROOM_STATUS_CHECKED_OUT' => HotelBookingDetail::STATUS_CHECKED_OUT,
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
'booking_auto_added_services' => $bookingAutoAddedServices,
);

return parent::renderView();
Expand Down
10 changes: 10 additions & 0 deletions js/admin/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ var ajaxQueries = new Array();
$(document).ready(function() {
// Init all events
init();
$(document).on('click', '#view_convenience_services', function(e) {
$('#convenience_services').toggle(100);
$('#view_convenience_services .icon-angle-up').toggle();
$('#view_convenience_services .icon-angle-down').toggle();
});
$(document).on('click', '#view_order_tax_details', function(e) {
$('#order_tax_details').toggle(100);
$('#view_order_tax_details .icon-angle-up').toggle();
$('#view_order_tax_details .icon-angle-down').toggle();
});

$(document).on('click', '.delete-voucher', function(e) {
if (!confirm(txt_confirm)) {
Expand Down