Merge pull request #708 from shreesh-webkul/mail_upd
Fix: Incorrect order summary in confirmation mail
This commit is contained in:
@@ -1044,47 +1044,19 @@ abstract class PaymentModuleCore extends Module
|
||||
$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 = $order->getTotalProductsWithoutTaxes(false, true) + $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM);
|
||||
$room_price_tax_incl = $order->getTotalProductsWithTaxes(false, true) + $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM);
|
||||
$room_tax = ($room_price_tax_incl - $room_price_tax_excl);
|
||||
|
||||
// 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_price_tax_excl = ($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0) + $cart_booking_data['total_extra_demands_te']);
|
||||
$additional_service_price_tax_incl = ($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0) + $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();
|
||||
$total_convenience_fee_ti = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
Product::PRICE_ADDITION_TYPE_INDEPENDENT
|
||||
);
|
||||
$total_convenience_fee_te = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
|
||||
$order->id,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
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;
|
||||
$total_convenience_fee_ti = $order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT);
|
||||
$total_convenience_fee_te = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT);
|
||||
|
||||
// service products
|
||||
// $service_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
|
||||
@@ -1659,8 +1631,11 @@ abstract class PaymentModuleCore extends Module
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
} else {
|
||||
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
|
||||
|
||||
@@ -1762,8 +1737,11 @@ abstract class PaymentModuleCore extends Module
|
||||
);
|
||||
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = ($cart_htl_data[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = ($data_v['total_price_tax_incl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti']);
|
||||
$cart_htl_data[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = ($data_v['total_price_tax_excl'] + $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te']);
|
||||
|
||||
$result['total_extra_demands_te'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
|
||||
$result['total_extra_demands_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
|
||||
@@ -1771,11 +1749,13 @@ abstract class PaymentModuleCore extends Module
|
||||
$result['total_additional_services_ti'] += $cart_htl_data[$type_key]['date_diff'][$date_join]['additional_services_price_ti'];
|
||||
}
|
||||
}
|
||||
// calculate averages now
|
||||
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
|
||||
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
|
||||
}
|
||||
}
|
||||
// calculate averages now
|
||||
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
|
||||
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$result['cart_htl_data'] = $cart_htl_data;
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{convertPrice price=$rm_v['avg_paid_unit_price_tax_incl']}
|
||||
{convertPrice price=$rm_v['avg_paid_unit_price_tax_excl']}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
@@ -114,7 +114,7 @@
|
||||
<td width="10"> </td>
|
||||
<td align="right" class="text-center">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{convertPrice price=$rm_v['amount_tax_incl']}
|
||||
{convertPrice price=$rm_v['amount_tax_excl']}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
|
||||
@@ -168,6 +168,34 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" 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"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Extra Services Cost </strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" align="right" 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"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{additional_service_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
|
||||
@@ -151,7 +151,9 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="9" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
|
||||
{discounts}
|
||||
<table class="table" style="width:100%;border-collapse:collapse">
|
||||
{discounts}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="conf_body">
|
||||
@@ -182,6 +184,34 @@
|
||||
</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"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
<strong>Extra Services Cost</strong>
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </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"> </td>
|
||||
<td align="right" style="color:#333;padding:0">
|
||||
<font size="2" face="Open-sans, sans-serif" color="#555454">
|
||||
{additional_service_price_tax_excl}
|
||||
</font>
|
||||
</td>
|
||||
<td width="10" style="color:#333;padding:0"> </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">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{foreach $list as $cart_rule}
|
||||
<tr class="conf_body">
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<td bgcolor="#f8f8f8" 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"></td>
|
||||
@@ -13,7 +13,7 @@
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
|
||||
<td bgcolor="#f8f8f8" 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"></td>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user