updated services modal design and fixed product line price issue

This commit is contained in:
Shreesh Arora
2023-03-20 12:40:18 +05:30
parent 66bc212ad4
commit 2e034cc402
6 changed files with 138 additions and 89 deletions

View File

@@ -182,9 +182,11 @@
<td class="text-center">
<span class="extra_service_show">
{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}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{if (isset($data['extra_demands']) && $data['extra_demands']) || (isset($data['additional_services']) && $data['additional_services'])}
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">
<i class="icon icon-lg icon-info-circle"></i>
</a>
{/if}
</span>
<span class="extra_service_edit" style="display: none;">
<a href="#" data-toggle="modal" data-target="#rooms_type_extra_demands" date_from="{$data['date_from']}" date_to="{$data['date_to']}" id_product="{$data['id_product']}" id_room="{$data['id_room']}" id_order="{$order->id}" class="open_room_extra_services" id_htl_booking="{$data['id']}" edit_orde_line="0">

View File

@@ -32,10 +32,6 @@
{include file='controllers/orders/_room_services_block.tpl'}
</div>
</div>
<div class="modal-footer">
</div>
{* Css for handling extra demands changes *}
<style type="text/css">
@@ -44,10 +40,6 @@
padding-bottom: 0px;}
#rooms_type_extra_demands .modal-title {
margin: 0px;}
#rooms_type_extra_demands .demand_edit_badge {
font-size: 14px;}
/* #rooms_extra_demands .room_ordered_demands td, #rooms_extra_demands .room_demand_detail { */
/* font-size: 14px;} */
#rooms_extra_demands .demand_header {
padding: 10px;
color: #333;

View File

@@ -28,6 +28,13 @@
{* Already selected room demands *}
<div class="col-sm-12 room_ordered_demands table-responsive">
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th>{l s='Price'}</th>
<th class="text-right">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{if isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
@@ -54,15 +61,25 @@
<div class="col-sm-12 room_demands_container">
<div class="room_demand_detail">
{if isset($roomTypeDemands) && $roomTypeDemands}
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
<div class="row room_demand_block">
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<table class="table">
<thead>
<tr>
<th></th>
<th>{l s='Name'}</th>
<th>{l s='Option'}</th>
<th class="text-right">{l s='Price'}</th>
</tr>
</thead>
<tbody>
{foreach $roomTypeDemands as $idGlobalDemand => $demand}
<tr class="room_demand_block">
<td>
<input id_cart_booking="{$roomDemand['id']}" value="{$idGlobalDemand|escape:'html':'UTF-8'}" type="checkbox" class="id_room_type_demand" {if isset($roomDemand['selected_global_demands']) && $roomDemand['selected_global_demands'] && ($idGlobalDemand|in_array:$roomDemand['selected_global_demands'])}checked{/if} />
</div>
<div class="col-xs-10 demand_adv_option_block">
<p>{$demand['name']|escape:'html':'UTF-8'}</p>
</td>
<td>
{$demand['name']|escape:'html':'UTF-8'}
</td>
<td class="demand_adv_option_block">
{if isset($demand['adv_option']) && $demand['adv_option']}
<select class="id_option">
{foreach $demand['adv_option'] as $idOption => $option}
@@ -74,16 +91,19 @@
{/foreach}
</select>
{else}
{l s='--'}
<input type="hidden" class="id_option" value="0" />
{/if}
</div>
</div>
</div>
<div class="col-xs-6">
<p><span class="pull-right extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span></p>
</div>
</div>
{/foreach}
</td>
<td class="text-right">
<span class="extra_demand_option_price">{if isset($selected_adv_option) && isset($demand['adv_option'][$selected_adv_option]['price'])}{convertPrice price = $demand['adv_option'][$selected_adv_option]['price']|escape:'html':'UTF-8'}{else}{convertPrice price = $demand['price']|escape:'html':'UTF-8'}{/if}</span>
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<i class="icon-warning"></i> {l s='No facilities available for this room.'}
{/if}
</div>
<button type="button" id="save_room_demands" class="btn btn-success pull-right"><i class="icon-save"></i> {l s='Save'}</button>
@@ -91,17 +111,25 @@
{elseif isset($extraDemands) && $extraDemands}
{foreach $extraDemands as $roomDemand}
<div class="row room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="col-sm-12 room_demand_block">
<p>
<span>{$demand['name']}</span>
<span class="pull-right">{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</span>
</p>
</div>
{/foreach}
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th>{l s='Price'}</th>
</tr>
</thead>
<tbody>
{foreach $roomDemand['extra_demands'] as $demand}
<tr class="room_demand_block">
<td>{$demand['name']}</td>
<td>{displayPrice price=$demand['total_price_tax_excl'] currency=$orderCurrency}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/foreach}
{else}
{l s='No facilities available!'}
{l s='No facilities selected!'}
{/if}
</div>

View File

@@ -28,19 +28,31 @@
{* Already selected room services *}
<div class="col-sm-12 room_ordered_services table-responsive">
<table class="table">
<thead>
<tr>
<th>{l s='Name'}</th>
<th>{l s='Quantity'}</th>
<th>{l s='Price'}</th>
<th class="text-center">{l s='Options'}</th>
<th class="text-right">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{if isset($additionalServices) && $additionalServices}
{foreach $additionalServices['additional_services'] as $service}
<tr class="room_demand_block">
<td>
<div>{$service['name']|escape:'html':'UTF-8'}</div>
{if $service['allow_multiple_quantity']}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
</div>
{/if}
</td>
<td>
{if $service['allow_multiple_quantity']}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
</div>
{/if}
</td>
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
<td class="text-center">
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
@@ -48,7 +60,6 @@
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</td>
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
<td><a class="btn btn-danger pull-right del_room_additional_service" data-id_room_type_service_product_order_detail="{$service['id_room_type_service_product_order_detail']}" href="#"><i class="icon-trash"></i></a></td>
</tr>
{/foreach}
@@ -65,32 +76,42 @@
<form id="add_room_services_form" class="col-sm-12 room_services_container">
<div class="room_demand_detail">
{if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
{foreach $roomTypeServiceProducts as $product}
<div class="row room_demand_block">
<div class="col-xs-6">
<div class="row">
<div class="col-xs-2">
<table class="table">
<thead>
<tr>
<th></th>
<th>{l s='Name'}</th>
<th>{l s='Quantity'}</th>
<th class="text-right">{l s='Price'}</th>
</tr>
</thead>
<tbody>
{foreach $roomTypeServiceProducts as $product}
<tr class="room_demand_block">
<td>
<input data-id_booking_detail="{$id_booking_detail}" value="{$product['id_product']|escape:'html':'UTF-8'}" name="selected_service[]" type="checkbox" class="id_room_type_service"/>
</div>
<div class="col-xs-10">
<p>{$product['name']|escape:'html':'UTF-8'}</p>
</td>
<td>
{$product['name']|escape:'html':'UTF-8'}
</td>
<td>
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" id="qty_{$product['id_product']|escape:'html':'UTF-8'}" name="service_qty[{$product['id_product']|escape:'html':'UTF-8'}]" data-id-product="{$product.id_product|escape:'html':'UTF-8'}" value="1">
</div>
{else}
{l s='--'}
{/if}
</div>
</div>
</div>
<div class="col-xs-6">
<p>
<span class="pull-right">{convertPrice price=$product.price_tax_incl}</span>
</p>
</div>
</div>
{/foreach}
</td>
<td class="text-right">
{convertPrice price=$product.price_tax_exc}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
<i class="icon-warning"></i> {l s='No services available to select, All services already added.'}
<i class="icon-warning"></i> {l s='No services available to add to this room.'}
{/if}
</div>
<input type="hidden" name="id_booking_detail" value="{$id_booking_detail}">
@@ -98,33 +119,38 @@
</form>
{elseif isset($additionalServices) && $additionalServices}
<div class="row room_demand_detail">
{foreach $additionalServices['additional_services'] as $service}
<div class="col-sm-12 room_demand_block">
<div class="row">
<div class="col-xs-8">
<span class="pull-right">
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</span>
<div>{$service['name']|escape:'html':'UTF-8'}</div>
{if $service['allow_multiple_quantity']}
<div class="quantity">{l s='Qty:'}&nbsp;{$service['quantity']|escape:'html':'UTF-8'}</div>
<table class="table room_demand_detail">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
<th class="text-center">{l s='Options'}</th>
<th>{l s='Price'}</th>
</tr>
</thead>
</tbody>
{foreach $additionalServices['additional_services'] as $service}
<tr class="room_demand_block">
<td>
{$service['id_product']|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&amp;id_product={$service['id_product']|escape:'html':'UTF-8'}&amp;updateproduct"><i class="icon-external-link-sign"></i></a>
</td>
<td>{$service['name']|escape:'html':'UTF-8'}</td>
<td class="text-center">
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>
{/if}
</div>
<div class="col-xs-4">
<span class="pull-right">{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}</span>
</div>
</div>
</div>
{/foreach}
</div>
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span>
{/if}
</td>
<td>
{displayPrice price=$service['total_price_tax_excl'] currency=$orderCurrency}
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='No services available!'}
{l s='No services selected!'}
{/if}
</div>

View File

@@ -4628,6 +4628,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars = array();
$objOrder = new Order($idOrder);
$smartyVars['orderCurrency'] = $objOrder->id_currency;
$smartyVars['link'] = $this->context->link;
$objBookingDemand = new HotelBookingDetail();
$htlBookingDetail = $objBookingDemand->getRowByIdOrderIdProductInDateRange(

View File

@@ -82,7 +82,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`product_id` = rsod.`id_product` AND od.`id_order` = '.(int)$idOrder.')';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = rsod.`id_order_detail`)';
$sql .= ' WHERE rsod.`id_order` = '.(int)$idOrder;
if (!is_null($autoAddToCart)) {
@@ -204,7 +204,7 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel
}
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = hbd.`id_order_detail`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = rsod.`id_order_detail`)';
$sql .= ' WHERE rsod.`id_order` = '.(int)$idOrder.' AND hbd.`id_product`='.(int) $roomTypeIdProduct .' AND hbd.`date_from` = \''.pSQL($dateFrom).'\' AND hbd.`date_to` = \''.pSQL($dateTo).'\' AND hbd.`id_room`='.(int) $idRoom;
if ($getTotalPrice) {