Skip to content

Commit

Permalink
Merge pull request #1202 from shreesh-webkul/gli-2278
Browse files Browse the repository at this point in the history
Fixed: service not visible in booking when service is deleted from catalog after order
  • Loading branch information
rohit053 authored Sep 11, 2024
2 parents 4232591 + e2bfb59 commit 1330109
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
{if $service['allow_multiple_quantity']}
<div class="qty_container">
<input type="number" class="form-control qty" min="1" data-id_product="{$service['id_product']|escape:'html':'UTF-8'}" value="{$service['quantity']|escape:'html':'UTF-8'}">
<p style="display:{if $service['quantity'] > $service['max_quantity']}block{else}none{/if}; margin-top: 4px;">
<span class="label label-warning">{l s='Maximum allowed quantity: %s' sprintf=$service['max_quantity']}</span>
</p>
{if $service['max_quantity']}
<p style="display:{if $service['quantity'] > $service['max_quantity']}block{else}none{/if}; margin-top: 4px;">
<span class="label label-warning">{l s='Maximum allowed quantity: %s' sprintf=$service['max_quantity']}</span>
</p>
{/if}
</div>
{else}
--
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4994,7 +4994,7 @@ public function ajaxProcessEditRoomOnOrder()
&& count($orderServiceProduct['additional_services'])
) {
foreach ($orderServiceProduct['additional_services'] as $serviceProduct) {
if (Product::getProductPriceCalculation($serviceProduct['id_product']) == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
if ($serviceProduct['price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
$newNumDays = HotelHelper::getNumberOfDays($new_date_from, $new_date_to);
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail((int) $serviceProduct['id_room_type_service_product_order_detail']);
$unitPriceTaxExcl = $objRoomTypeServiceProductOrderDetail->unit_price_tax_excl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getroomTypeServiceProducts(

$sql = 'SELECT rsod.*';
if (!$getTotalPrice) {
$sql .= ', hbd.`id_product` as `room_type_id_product`, od.`product_allow_multiple_quantity`, hbd.`id_room`, hbd.`adults`, hbd.`children`';
$sql .= ', hbd.`id_product` as `room_type_id_product`, od.`product_allow_multiple_quantity`, od.`product_price_calculation_method`, hbd.`id_room`, hbd.`adults`, hbd.`children`';
}
$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`)';
Expand Down Expand Up @@ -152,6 +152,7 @@ public function getroomTypeServiceProducts(
'product_tax' => $product_tax,
'product_tax_label' => $product_tax_label,
'allow_multiple_quantity' => $product['product_allow_multiple_quantity'],
'price_calculation_method' => $product['product_price_calculation_method'],
'total_price_tax_excl' => $product['total_price_tax_excl'],
'total_price_tax_incl' => $product['total_price_tax_incl'],
);
Expand All @@ -175,6 +176,7 @@ public function getroomTypeServiceProducts(
'name' => $product['name'],
'quantity' => $product['quantity'],
'allow_multiple_quantity' => $product['product_allow_multiple_quantity'],
'price_calculation_method' => $product['product_price_calculation_method'],
'product_tax' => $product_tax,
'product_tax_label' => $product_tax_label,
'total_price_tax_excl' => $product['total_price_tax_excl'],
Expand Down Expand Up @@ -213,7 +215,7 @@ public function getSelectedServicesForRoom(
INNER 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` = rsod.`id_order_detail`)';
$sql .= ' INNER JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rsod.`id_product`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = rsod.`id_product`)';

$sql .= ' WHERE hbd.`id` = '.(int)$idHotelBookingDetail;

Expand Down

0 comments on commit 1330109

Please sign in to comment.