{l s='Total (Tax incl.)'}
diff --git a/classes/Cart.php b/classes/Cart.php
index 6fef5ee79..e3b4d1e42 100644
--- a/classes/Cart.php
+++ b/classes/Cart.php
@@ -3772,6 +3772,15 @@ class CartCore extends ObjectModel
}
$objHotelAdvancedPayment = new HotelAdvancedPayment();
+ $total_rooms_with_services_without_discount_te = $total_rooms + $total_demands + $total_additional_services + $total_additional_services_auto_add;
+ $total_rooms_with_services_without_discount_ti = $total_rooms_wt + $total_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt;
+
+ $cart_total_without_discount_te = $total_rooms_with_services_without_discount_te + $convenience_fee;
+ $cart_total_without_discount_ti = $total_rooms_with_services_without_discount_ti + $convenience_fee_wt;
+ $total_tax_without_discount = $cart_total_without_discount_ti - $cart_total_without_discount_te;
+ if ($total_tax_without_discount < 0) {
+ $total_tax_without_discount = 0;
+ }
$summary = array(
'delivery' => $delivery,
@@ -3814,6 +3823,11 @@ class CartCore extends ObjectModel
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' =>!$total_shipping && !count($this->getDeliveryAddressesWithoutCarriers(true, $errors)),
'carrier' => new Carrier($this->id_carrier, $id_lang),
+ 'total_rooms_with_services_without_discount_te' => $total_rooms_with_services_without_discount_te,
+ 'total_rooms_with_services_without_discount_ti' => $total_rooms_with_services_without_discount_ti,
+ 'cart_total_without_discount_te' => $cart_total_without_discount_te,
+ 'cart_total_without_discount_ti' => $cart_total_without_discount_ti,
+ 'total_tax_without_discount' => $total_tax_without_discount
);
$hook = Hook::exec('actionCartSummary', $summary, null, true);
diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php
index a41e558b0..f084284e3 100644
--- a/classes/PaymentModule.php
+++ b/classes/PaymentModule.php
@@ -1090,15 +1090,16 @@ abstract class PaymentModuleCore extends Module
$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 = ($additional_service_price_tax_incl - $additional_service_price_tax_excl);
-
// convenience fee price
$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);
+ $total_convenience_fee_tax = $total_convenience_fee_ti - $total_convenience_fee_te;
// 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));
+ $total_order_tax = $room_tax + $additional_service_tax + $total_convenience_fee_tax;
$idOrderHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
$objHotelBranchInfo = new HotelBranchInformation($idOrderHotel, $order->id_lang);
@@ -1153,11 +1154,12 @@ abstract class PaymentModuleCore extends Module
'{discounts_txt}' => $cart_rules_list_txt,
'{total_paid}' => Tools::displayPrice($order->total_paid, $this->context->currency, false),
'{total_products}' => Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $order->total_products : $order->total_products_wt, $this->context->currency, false),
- '{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
+ '{total_discounts}' => Tools::displayPrice(-$order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),
// '{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false),
'{total_tax_paid}' => Tools::displayPrice(($order->total_paid_tax_incl - $order->total_paid_tax_excl), $this->context->currency, false),
+ '{total_order_tax}' => Tools::displayPrice(($total_order_tax), $this->context->currency, false),
// additional data
'{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),
diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php
index 89f340ded..f8a6a1c15 100644
--- a/classes/pdf/HTMLTemplateInvoice.php
+++ b/classes/pdf/HTMLTemplateInvoice.php
@@ -561,7 +561,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$footer['total_convenience_fee_ti'] = 0;
if ($idsOrderDetail = array_column($order_details, 'id_order_detail')) {
$footer['room_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
- $footer['room_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
+ $footer['room_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
// $footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
// $footer['service_products_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE);
$footer['additional_service_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTE;
@@ -569,7 +569,14 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$footer['total_convenience_fee_te'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);
$footer['total_convenience_fee_ti'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);
}
+
$footer['total_paid_real'] = $this->order_invoice->getTotalPaid();
+ $footer['total_without_discount_te'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl'];
+ $footer['total_without_discount_ti'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl'];
+ $footer['total_tax_without_discount'] = $footer['total_without_discount_ti'] - $footer['total_without_discount_te'];
+ if ($footer['total_tax_without_discount'] < 0) {
+ $footer['total_tax_without_discount'] = 0;
+ }
$data = array(
'cart_htl_data' => $cart_htl_data,
@@ -591,6 +598,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_,
'round_type' => $round_type,
'legal_free_text' => $legal_free_text,
+ 'total_without_discount_te' => $total_without_discount_te,
+ 'total_without_discount_ti' => $total_without_discount_ti,
+ 'total_tax_without_discount' => $total_tax_without_discount
);
if (Tools::getValue('debug')) {
diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php
index abc2a05b7..4747d5ee6 100644
--- a/controllers/front/OrderConfirmationController.php
+++ b/controllers/front/OrderConfirmationController.php
@@ -394,6 +394,10 @@ class OrderConfirmationControllerCore extends FrontController
$orderTotalInfo['total_paid'] += $objCartOrder->total_paid;
$orderTotalInfo['total_paid_real'] += $objCartOrder->total_paid_real;
}
+
+ $totalTaxIncl = $orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_convenience_fee_ti'] + $orderTotalInfo['total_auto_add_services_ti'] + $orderTotalInfo['total_demands_price_ti'];
+ $totalTaxExcl = $orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_convenience_fee_te'] + $orderTotalInfo['total_auto_add_services_te'] + $orderTotalInfo['total_demands_price_te'];
+ $orderTotalInfo['total_tax_without_discount'] = $totalTaxIncl - $totalTaxExcl;
}
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html
index a5d8bfafa..763525bea 100755
--- a/mails/en/order_conf.html
+++ b/mails/en/order_conf.html
@@ -135,11 +135,6 @@
-
- |
- {discounts}
- |
-
|
|
-
-
-
-
-
- | |
-
-
- Discounts
-
- |
- |
-
-
- |
-
-
-
- | |
-
-
- {total_discounts}
-
- |
- |
-
-
- |
-
@@ -274,7 +240,35 @@
| |
- {total_tax_paid}
+ {total_order_tax}
+
+ |
+ |
+
+
+ |
+
+
+
+
+
+ | |
+
+
+ Discounts
+
+ |
+ |
+
+
+ |
+
+
+
+ | |
+
+
+ {total_discounts}
|
|
diff --git a/mails/en/order_conf.txt b/mails/en/order_conf.txt
index 7cbc6220f..eadc90767 100644
--- a/mails/en/order_conf.txt
+++ b/mails/en/order_conf.txt
@@ -25,15 +25,15 @@ Total Rooms Cost
Total Extra Services Cost
{total_extra_demands_te}
-Discounts
-{total_discounts}
-
Total Rooms Tax
{total_tax_paid}
Extra Services Tax
{extra_demands_tax}
+Discounts
+{total_discounts}
+
Final Booking Amount
{total_paid}
diff --git a/mails/en/order_conf_admin.html b/mails/en/order_conf_admin.html
index fb2340f07..09bc78bdd 100755
--- a/mails/en/order_conf_admin.html
+++ b/mails/en/order_conf_admin.html
@@ -149,11 +149,6 @@
{extra_demands_details_html}
-
- |
- {discounts}
- |
-
|
|
-
-
-
-
- | |
-
-
- Discounts
-
- |
- |
-
-
- |
-
-
-
- | |
-
-
- {total_discounts}
-
- |
- |
-
-
- |
-
@@ -286,7 +253,35 @@
| |
- {total_tax_paid}
+ {total_order_tax}
+
+ |
+ |
+
+
+ |
+
+
+
+
+
+ | |
+
+
+ Discounts
+
+ |
+ |
+
+
+ |
+
+
+
+ | |
+
+
+ {total_discounts}
|
|
diff --git a/mails/en/order_conf_admin.txt b/mails/en/order_conf_admin.txt
index 3ee04fb3a..4647a2889 100644
--- a/mails/en/order_conf_admin.txt
+++ b/mails/en/order_conf_admin.txt
@@ -32,8 +32,6 @@ Total Rooms Cost
Total Extra Services Cost
{total_extra_demands_te}
-Discounts
-{total_discounts}
Total Rooms Tax
{total_tax_paid}
@@ -41,6 +39,9 @@ Total Rooms Tax
Extra Services Tax
{extra_demands_tax}
+Discounts
+{total_discounts}
+
Final Booking Amount
{total_paid}
diff --git a/mails/en/order_conf_cart_rules.tpl b/mails/en/order_conf_cart_rules.tpl
index 742554d72..7a1a683b0 100644
--- a/mails/en/order_conf_cart_rules.tpl
+++ b/mails/en/order_conf_cart_rules.tpl
@@ -13,7 +13,7 @@
|
-
+ |
|
-{/foreach}
\ No newline at end of file
+{/foreach}
diff --git a/mails/en/overbooking.html b/mails/en/overbooking.html
index 9980442e1..d005296c1 100755
--- a/mails/en/overbooking.html
+++ b/mails/en/overbooking.html
@@ -137,11 +137,6 @@
-
- |
- {discounts}
- |
-
@@ -199,34 +194,6 @@
-
-
-
-
- | |
-
-
- Discounts
-
- |
- |
-
-
- |
-
-
-
- | |
-
-
- {total_discounts}
-
- |
- |
-
-
- |
-
@@ -275,7 +242,35 @@
| |
- {total_tax_paid}
+ {total_order_tax}
+
+ |
+ |
+
+
+ |
+
+
+
+
+
+ | |
+
+
+ Discounts
+
+ |
+ |
+
+
+ |
+
+
+
+ | |
+
+
+ {total_discounts}
|
|
diff --git a/mails/en/overbooking.txt b/mails/en/overbooking.txt
index bc18d9515..f4ad32eb3 100644
--- a/mails/en/overbooking.txt
+++ b/mails/en/overbooking.txt
@@ -23,8 +23,6 @@ Total
{extra_demands_details_text}
-{discounts}
-
Total Rooms Cost
{total_products}
diff --git a/mails/en/overbooking_admin.html b/mails/en/overbooking_admin.html
index 4804802dd..d06ff9a18 100755
--- a/mails/en/overbooking_admin.html
+++ b/mails/en/overbooking_admin.html
@@ -152,13 +152,6 @@
{extra_demands_details_html}
-
- |
-
- |
-
|
|
-
-
-
-
- | |
-
-
- Discounts
-
- |
- |
-
-
- |
-
-
-
- | |
-
-
- {total_discounts}
-
- |
- |
-
-
- |
-
@@ -291,7 +256,35 @@
| |
- {total_tax_paid}
+ {total_order_tax}
+
+ |
+ |
+
+
+ |
+
+
+
+
+
+ | |
+
+
+ Discounts
+
+ |
+ |
+
+
+ |
+
+
+
+ | |
+
+
+ {total_discounts}
|
|
diff --git a/pdf/invoice.total-tab.tpl b/pdf/invoice.total-tab.tpl
index 4de340a56..13d58257a 100644
--- a/pdf/invoice.total-tab.tpl
+++ b/pdf/invoice.total-tab.tpl
@@ -52,16 +52,6 @@
{/if}
- {if $footer.product_discounts_tax_excl > 0}
-
- |
- {l s='Total Discounts' pdf='true'}
- |
-
- - {displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_excl}
- |
-
- {/if}
{* {if isset($footer.product_taxes) && $footer.product_taxes}
|
@@ -108,21 +98,30 @@
{l s='Total (Tax excl.)' pdf='true'}
|
- {displayPrice currency=$order->id_currency price=$footer.total_paid_tax_excl}
+ {displayPrice currency=$order->id_currency price=$footer.total_without_discount_te}
|
- {if $footer.total_taxes > 0}
+ {if $footer.total_tax_without_discount > 0}
|
{l s='Total Tax' pdf='true'}
|
- {displayPrice currency=$order->id_currency price=$footer.total_taxes}
+ {displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}
|
{/if}
-
+ {if $footer.product_discounts_tax_incl > 0}
+
+ |
+ {l s='Total Discounts' pdf='true'}
+ |
+
+ - {displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_incl}
+ |
+
+ {/if}
|
{l s='Final Booking Amount' pdf='true'}
diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl
index d08dcc0c8..f1c9c9e9c 100644
--- a/themes/hotel-reservation-theme/order-confirmation.tpl
+++ b/themes/hotel-reservation-theme/order-confirmation.tpl
@@ -349,21 +349,6 @@
|
{/if}
- {if $order->total_discounts > 0}
-
- |
-
- {l s='Total Vouchers'}
- |
-
- {if $priceDisplay && $use_tax}
- {displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts_te'] * -1) currency=$objOrderCurrency convert=1}
- {else}
- {displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts'] * -1) currency=$objOrderCurrency convert=1}
- {/if}
- |
-
- {/if}
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
|
@@ -391,9 +376,24 @@
{l s='Total Tax'}
- {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax'] currency=$objOrderCurrency convert=1}
+ {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}
|
+ {if $order->total_discounts > 0}
+
+ |
+
+ {l s='Total Vouchers'}
+ |
+
+ {if $priceDisplay && $use_tax}
+ {displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts_te'] * -1) currency=$objOrderCurrency convert=1}
+ {else}
+ {displayWtPriceWithCurrency price=($orderTotalInfo['total_discounts'] * -1) currency=$objOrderCurrency convert=1}
+ {/if}
+ |
+
+ {/if}
|
diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl
index 563f44879..b2f89be2e 100644
--- a/themes/hotel-reservation-theme/order-detail.tpl
+++ b/themes/hotel-reservation-theme/order-detail.tpl
@@ -262,6 +262,7 @@
{assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
{assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $total_demands_price_te)}
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $total_demands_price_ti)}
+ {assign var=total_tax_without_discount value=(($room_price_tax_incl - $room_price_tax_excl) + ($additional_service_price_tax_incl - $additional_service_price_tax_excl ))}
{if $priceDisplay && $use_tax && $room_price_tax_excl}
|
| {l s='Total rooms cost (tax excl.)'} |
@@ -278,14 +279,6 @@
{/if}
- {if $order->total_discounts > 0}
-
- | {l s='Total Vouchers'} |
-
- -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}
- |
-
- {/if}
{if $priceDisplay && $use_tax && $total_convenience_fee_te}
| {l s='Total Convenience Fees (tax excl.)'} |
@@ -305,9 +298,18 @@
| {l s='Total Tax'} |
- {displayWtPriceWithCurrency price=($order->total_paid - $order->total_paid_tax_excl) currency=$currency}
+ {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
|
+
+ {if $order->total_discounts > 0}
+
+ | {l s='Total Vouchers'} |
+
+ -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}
+ |
+
+ {/if}
| {l s='Final Booking Total'} |
@@ -648,6 +650,7 @@
{assign var=room_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
{assign var=additional_service_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $total_demands_price_te)}
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $total_demands_price_ti)}
+ {assign var=total_tax_without_discount value=(($room_price_tax_incl - $room_price_tax_excl) + ($additional_service_price_tax_incl - $additional_service_price_tax_excl ))}
{if $priceDisplay && $use_tax && $room_price_tax_excl}
|
| {l s='Total rooms cost (tax excl.)'} |
@@ -664,14 +667,6 @@
{/if}
- {if $order->total_discounts > 0}
-
- | {l s='Total Vouchers'} |
-
- -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}
- |
-
- {/if}
{if $priceDisplay && $use_tax && $total_convenience_fee_te}
| {l s='Total Convenience Fees (tax excl.)'} |
@@ -691,9 +686,17 @@
| {l s='Total Tax'} |
- {displayWtPriceWithCurrency price=($order->total_paid - $order->total_paid_tax_excl) currency=$currency}
+ {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
|
+ {if $order->total_discounts > 0}
+
+ | {l s='Total Vouchers'} |
+
+ -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1}
+ |
+
+ {/if}
| {l s='Final Booking Total'} |
diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl
index b34e73cab..3f342c077 100644
--- a/themes/hotel-reservation-theme/order-opc.tpl
+++ b/themes/hotel-reservation-theme/order-opc.tpl
@@ -301,7 +301,7 @@
{if $show_taxes}
{l s='Total tax'}
- {displayPrice price=($total_tax)}
+ {displayPrice price=($total_tax_without_discount)}
{/if}
| | | | | | |