Skip to content

Commit

Permalink
Merge pull request #627 from shreesh-webkul/qlo-mail
Browse files Browse the repository at this point in the history
Fixed: Order summary in order confirmation page and order confirmation e-mail
  • Loading branch information
rohit053 authored Mar 22, 2023
2 parents 0f79701 + b03eb40 commit 2d0d892
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 88 deletions.
34 changes: 23 additions & 11 deletions classes/PaymentModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1039,18 +1039,19 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_
$normal_products_data_html = $this->getEmailTemplateContent('hotel-service-product-data.tpl', Mail::TYPE_TEXT, $orderServiceProducts);
$normal_products_data_txt = $this->getEmailTemplateContent('hotel-service-product-data-text.tpl', Mail::TYPE_TEXT, $orderServiceProducts);


// total room price
$room_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, true);
$room_price_tax_incl = $order->getTotalProductsWithTaxes(false, true);
$room_tax = ($order->getTotalProductsWithTaxes(false, true) - $order->getTotalProductsWithoutTaxes(false, true));
$room_price_tax_excl += $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
$room_price_tax_incl += $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
$service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE));

// extra services
$additional_service_price_tax_excl = ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']);
$additional_service_price_tax_incl = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']);
$additional_service_tax = (($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_ti']) - ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $cart_booking_data['total_extra_demands_te']));

// convenience fee price
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
$room_price_tax_incl -= $total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
Expand All @@ -1060,9 +1061,10 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_
0,
1,
1,
1
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$room_price_tax_excl -= $total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
Expand All @@ -1072,8 +1074,18 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_
0,
1,
0,
1
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$additional_service_price_tax_excl = $additional_service_price_tax_excl - $total_convenience_fee_te;
$additional_service_price_tax_incl = $additional_service_price_tax_incl - $total_convenience_fee_ti;
$room_price_tax_excl = $room_price_tax_excl + $additional_service_price_tax_excl;
$room_price_tax_incl = $room_price_tax_incl + $additional_service_price_tax_incl;

// service products
// $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
// $service_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
// $service_products_tax = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) - $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE));

$data = array(
'{cart_booking_data_html}' => $cart_booking_data_html,
Expand Down Expand Up @@ -1144,9 +1156,9 @@ public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_
'{room_price_tax_excl}' => Tools::displayPrice($room_price_tax_excl, $this->context->currency, false),
'{room_price_tax_incl}' => Tools::displayPrice($room_price_tax_incl, $this->context->currency, false),
'{room_tax}' => Tools::displayPrice($room_tax, $this->context->currency, false),
'{service_products_price_tax_excl}' => Tools::displayPrice($service_products_price_tax_excl, $this->context->currency, false),
'{service_products_price_tax_incl}' => Tools::displayPrice($service_products_price_tax_incl, $this->context->currency, false),
'{service_products_tax}' => Tools::displayPrice($service_products_tax, $this->context->currency, false),
// '{service_products_price_tax_excl}' => Tools::displayPrice($service_products_price_tax_excl, $this->context->currency, false),
// '{service_products_price_tax_incl}' => Tools::displayPrice($service_products_price_tax_incl, $this->context->currency, false),
// '{service_products_tax}' => Tools::displayPrice($service_products_tax, $this->context->currency, false),
'{additional_service_price_tax_excl}' => Tools::displayPrice($additional_service_price_tax_excl, $this->context->currency, false),
'{additional_service_price_tax_incl}' => Tools::displayPrice($additional_service_price_tax_incl, $this->context->currency, false),
'{additional_service_tax}' => Tools::displayPrice($additional_service_tax, $this->context->currency, false),
Expand Down
60 changes: 5 additions & 55 deletions mails/en/order_conf_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,28 +149,6 @@
{extra_demands_details_html}
</td>
</tr>
<tr>
<td colspan="9" style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
<tr>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Image</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Name</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Unit Price</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Qty</th>
<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="17%">Total</th>
</tr>
<tbody>
<tr>
<td colspan="5" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
&nbsp;&nbsp;{normal_products_data_html}
</td>
</tr>
</tbody>
</table>
</font>
</td>
</tr>
<tr>
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
&nbsp;&nbsp;{discounts}
Expand All @@ -196,35 +174,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_products}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr class="conf_body">
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
<table class="table" style="width:100%;border-collapse:collapse">
<tr>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Total Extra Services Cost</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
</tr>
</table>
</td>
<td bgcolor="#f8f8f8" align="right" colspan="5" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
<table class="table" style="width:100%;border-collapse:collapse">
<tr>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_extra_demands_te}
{room_price_tax_excl}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
Expand Down Expand Up @@ -267,7 +217,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Total Rooms Tax</strong>
<strong>Total Convenience Fees</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
Expand All @@ -280,7 +230,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{total_tax_paid}
{total_convenience_fee_te}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
Expand All @@ -295,7 +245,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<strong>Extra Services Tax</strong>
<strong>Total Tax</strong>
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
Expand All @@ -308,7 +258,7 @@
<td width="10" style="color:#333;padding:0">&nbsp;</td>
<td align="right" style="color:#333;padding:0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
{extra_demands_tax}
{total_tax_paid}
</font>
</td>
<td width="10" style="color:#333;padding:0">&nbsp;</td>
Expand Down
42 changes: 20 additions & 22 deletions themes/hotel-reservation-theme/order-confirmation.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -326,28 +326,26 @@
</td>
</tr>
{/if}
{if isset($cart_htl_data)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$currency}</span>
</td>
</tr>
{else}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$currency}</span>
</td>
</tr>
{/if}
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$currency}</span>
</td>
</tr>
{else if $orderTotalInfo['total_convenience_fee_ti']}
<tr class="item">
<td colspan="3"></td>
<td colspan="3">
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td colspan="2">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$currency}</span>
</td>
</tr>
{/if}
<tr class="item">
<td colspan="3"></td>
Expand Down

0 comments on commit 2d0d892

Please sign in to comment.