updated: Merge Room Status and Rooms Detail section

This commit is contained in:
azhar bhat
2026-07-09 13:47:13 +05:30
parent a000f7e711
commit e2569442d1
4 changed files with 72 additions and 117 deletions

View File

@@ -24,26 +24,25 @@
*}
<tr class="product-line-row" data-id_htl_booking="{$data.id|escape:'html':'UTF-8'}" data-id_room="{$data.id_room}" data-id_product="{$data.id_product}" data-id_hotel="{$data.id_hotel}" data-date_from="{$data.date_from}" data-date_to="{$data.date_to}" data-product_price="{$data.unit_amt_tax_incl}" data-id_order_detail="{$data.id_order_detail}">
<td>
<td class="center">
<p>{$data.room_num}</p>
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$data.id_product}&amp;updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
{if $data.is_back_order}
<span class="overbooked_room">{l s='overbooked'}</span>
{/if}
</td>
<td><img src="{$data.image_link}" title="{l s='Room image'}"></td>
<td>
<p><a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$data.id_product}&amp;updateproduct" target="_blank"><span>{$data.room_type}</span></a></p>
</td>
<td>
<td class="center"><img src="{$data.image_link}" title="{l s='Room image'}"></td>
<td class="center">
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
{dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date}
<p>{dateFormat date=$data.date_from full=$is_full_date}</p>
<p>{l s='to'}</p>
<p>{dateFormat date=$data.date_to full=$is_full_date}</p>
</td>
<td>
<td class="center">
<p>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}</p>
{if $data['children']}
<div class="dropdown">
<a data-toggle="dropdown">
<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>
</a>
<a data-toggle="dropdown"><span>{$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}</span></a>
<div class="dropdown-menu well well-sm">
<label>{l s='Children Ages'}</label>
{if isset($data['child_ages']) && $data['child_ages']}
@@ -59,19 +58,41 @@
{/if}
</div>
</div>
{else}
{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}
{/if}
</td>
<td>
<td class="center">
<p>
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
<span class="text-danger room_status">{dateFormat date=$data['check_in'] full=1}</span>
{else}
--
{/if}
</p>
<p>
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
<span class="text-success room_status">{dateFormat date=$data['check_out'] full=1}</span>
{else}
--
{/if}
</p>
</td>
<td class="center">
{if $data['booking_type'] == $ALLOTMENT_MANUAL}
{l s='Manual'} &nbsp;{if $data['comment'] != ''}<a class="manual_allotment_comment" href="#" data-id_hotel_booking_detail="{$data['id']}"><i class="icon-info-circle"></i></a>{/if}
{else}
{l s='Auto'}
{/if}
</td>
<td class="center">
<p>
<span class="room_type_current_price">
{convertPriceWithCurrency price=$data['total_price_tax_excl'] currency=$currency->id}
</span>
</p>
<p class="help-block">{l s='Per day price:'} {convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}</p>
<p class="help-block">{convertPriceWithCurrency price=$data['paid_unit_price_tax_excl'] currency=$currency->id}/{l s='day'}</p>
</td>
<td>
<td class="center">
{convertPriceWithCurrency price=($data['extra_demands_price_te'] + $data['additional_services_price_te'] + $data['convenience_fee_te'] + $data['additional_services_price_auto_add_te']) currency=$currency->id}
{if $data['extra_demands']|count || $data['additional_services']|count}
<a class="open_room_extra_services" href="#" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" id_htl_booking="{$data['id']}">
@@ -79,14 +100,14 @@
</a>
{/if}
</td>
<td>
<td class="center">
{convertPriceWithCurrency price=($data['total_room_tax']) currency=$currency->id}
</td>
<td>
<td class="center">
{convertPriceWithCurrency price=($data['total_room_price_ti']) currency=$currency->id}
</td>
{if (isset($refundReqBookings) && $refundReqBookings)}
<td>
<td class="center">
{if $data.id|in_array:$refundReqBookings}
{if $data.is_cancelled}
<span class="badge badge-danger">{l s='Cancelled'}</span>
@@ -99,7 +120,7 @@
<span>--</span>
{/if}
</td>
<td>
<td class="center">
{if $data.is_refunded && isset($data.refund_info) && $data.refund_info}
{convertPriceWithCurrency price=$data.refund_info.refunded_amount currency=$currency->id}
{else}
@@ -108,7 +129,7 @@
</td>
{/if}
{if ($can_edit && !$order->hasBeenDelivered())}
<td class="product_action">
<td class="product_action center">
<div class="btn-group">
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}
<button href="#" class="btn btn-default delete_room_line">
@@ -130,6 +151,22 @@
{l s='Reallocate/Swap Room'}
</a>
</li>
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
{else}
<li>
<a href="#" class="open_room_status_form" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}" data-check_in="{$data['check_in']}" data-check_out="{$data['check_out']}">
<i class="icon-clock-o"></i>
{l s='Room Status'}
</a>
</li>
{/if}
<li>
<a href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<i class="icon-file-text"></i>
{l s='Upload Docs'}
<span class="badge badge-info">{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if}</span>
</a>
</li>
<li>
<a href="#" class="delete_room_line">
<i class="icon-trash"></i>

View File

@@ -27,21 +27,22 @@
<table class="table" id="customer_cart_details">
<thead>
<tr>
<th><span class="title_box">{l s='Room No.'}</span></th>
<th><span class="title_box">{l s='Image'}</th>
<th><span class="title_box">{l s='Room Type'}</span></th>
<th><span class="title_box">{l s='Duration'}</span></th>
<th class="fixed-width-lg"><span class="title_box">{l s='Occupancy'}</span></th>
<th><span class="title_box">{l s='Room Price (Tax excl.)'}</span></th>
<th><span class="title_box">{l s='Extra Services/Fee (Tax excl.)'}</span></th>
<th><span class="title_box">{l s='Total Tax'}</span></th>
<th><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Room name'}">{l s='Room'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Room image'}">{l s='Image'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Booking check-in and check-out dates'}">{l s='Duration'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Number of adults and children'}">{l s='Occupancy'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Guest check-in and check-out date/time'}">{l s='Check-in/Check-out'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Manual or automatic room allotment'}">{l s='Allotment'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Room Price (Tax excl.)'}">{l s='Room Price (TE)'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Extra Services/Fee (Tax excl.)'}">{l s='Services (TE)'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Total tax applied on this room booking'}">{l s='Total Tax'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Total Price (Tax incl.)'}">{l s='Total Price (TI)'}</span></th>
{if (isset($refundReqBookings) && $refundReqBookings)}
<th><span class="title_box">{l s='Refund/Cancel Status'}</span></th>
<th><span class="title_box">{l s='Refunded amount'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Refund or cancellation status of this room booking'}">{l s='Refund/Cancel'}</span></th>
<th class="center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Amount refunded for this room booking'}">{l s='Refunded amount'}</span></th>
{/if}
{if ($can_edit && !$order->hasBeenDelivered())}
<th class="fixed-width-md"><span class="title_box">{l s='Actions'}</th>
<th class="fixed-width-md center"><span class="title_box help-tooltip" data-toggle="tooltip" title="" data-original-title="{l s='Room Actions'}">{l s='Actions'}</span></th>
{/if}
</tr>
</thead>

View File

@@ -88,90 +88,6 @@
<div class="row">
<div class="col-lg-7">
{if isset($htl_booking_order_data) && $htl_booking_order_data}
<div class="panel">
<div class="panel-heading order_status_heading">
<i class="icon-bed"></i> &nbsp;{l s='Rooms Status'}
</div>
<div class="panel-content">
<div class="row">
<div class="col-lg-12 table-responsive" id="room_status_info_wrapper">
<table class="table">
<thead>
<tr>
<th>{l s='Room'}</th>
<th>{l s='Duration'}</th>
<th>{l s='Check-In'}</th>
<th>{l s='Check-Out'}</th>
<th>{l s='Allotment'}</th>
<th>{l s='Action'}</th>
</tr>
</thead>
<tbody>
{if isset($htl_booking_order_data) && $htl_booking_order_data}
{foreach from=$htl_booking_order_data item=data}
<tr>
<td>
{$data['room_num']}<br>
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&amp;id_product={$data['id_product']}&amp;updateproduct" target="_blank">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
</td>
<td>
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
{dateFormat date=$data['date_from'] full=$is_full_date} - {dateFormat date=$data['date_to'] full=$is_full_date}
</td>
<td>
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
<span class="text-danger room_status">{l s='Checked in on'}<br>{dateFormat date=$data['check_in'] full=1}</span>
{else}
--
{/if}
</td>
<td>
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
<span class="text-success room_status">{l s='Checked out on'}<br>{dateFormat date=$data['check_out'] full=1}</span>
{else}
--
{/if}
</td>
<td>
{if $data['booking_type'] == $ALLOTMENT_MANUAL}
{l s='Manual'} &nbsp;{if $data['comment'] != ''}<a class="manual_allotment_comment" href="#" data-id_hotel_booking_detail="{$data['id']}"><i class="icon-info-circle"></i></a>{/if}
{else}
{l s='Auto'}
{/if}
</td>
<td>
<a title="{l s='Upload/Check guest documents'}" class="btn btn-default" href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
<span class="badge badge-info">{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if}</span> <i class="icon-file-text"></i>
</a>
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
{elseif $can_edit}
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}" data-check_in="{$data['check_in']}" data-check_out="{$data['check_out']}">
<i class="icon-pencil"></i> {l s='Edit'}
</a>
{/if}
</td>
</tr>
{/foreach}
{else}
<tr>
<td class="list-empty hidden-print" colspan="6">
<div class="list-empty-msg">
<i class="icon-warning-sign list-empty-icon"></i>
{l s='No rooms found'}
</div>
</td>
</tr>
{/if}
</tbody>
</table>
</div>
</div>
</div>
</div>
{/if}
<div class="panel">
<div class="panel-heading">
<i class="icon-file"></i> &nbsp;{l s='Order'}

View File

@@ -3580,6 +3580,7 @@ class AdminOrdersControllerCore extends AdminController
$order_detail_data[$key]['amt_with_qty_tax_incl'] = $value['total_price_tax_incl'];
$order_detail_data[$key]['room_type_info'] = $objHotelRoomType->getRoomTypeInfoByIdProduct($value['id_product']);
$order_detail_data[$key]['total_room_tax'] = $order_detail_data[$key]['total_room_price_ti'] - $order_detail_data[$key]['total_room_price_te'];
$order_detail_data[$key]['num_checkin_documents'] = HotelBookingDocument::getCountByIdHtlBooking($value['id']);
if (isset($value['refund_info'])
&& $value['refund_info']['refunded']