From deb3a45cadb3d1633c3e418359e68e46f3ff4cb3 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 25 Sep 2024 11:42:47 +0530 Subject: [PATCH 01/11] Fixed: The incorrect cart summary on the book now page in the adminoffice, due to convenience fee and cart rule --- .../default/template/controllers/orders/form.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index c5ad9795a..e8fdad6e3 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -708,7 +708,7 @@ $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank)); $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax - jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); @@ -1213,7 +1213,7 @@ $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax - jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); @@ -2130,6 +2130,12 @@ *} +
+
+ {l s='Convenience fees (Tax excl.)'}
+ +
+
{l s='Total vouchers (Tax excl.)'}
@@ -2142,12 +2148,6 @@
-
-
- {l s='Convenience fees (Tax excl.)'}
- -
-
{l s='Total taxes'}
From cc5a1d4cacf92abae3f77659f0948a414f28de4a Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 3 Oct 2024 17:30:54 +0530 Subject: [PATCH 02/11] Updated: the price breakdown in the admin orders while creating the order --- .../template/controllers/orders/form.tpl | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index e8fdad6e3..80955674c 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -705,10 +705,11 @@ } function updateCartSummaryData(jsonSummary) { - $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank)); - $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank)); + var totalRooms = jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add; + $('#total_rooms').html(formatCurrency(parseFloat(totalRooms), currency_format, currency_sign, currency_blank)); + $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(totalRooms + jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); @@ -1211,11 +1212,12 @@ shipping_price_selected_carrier = jsonSummary.summary.total_shipping; - $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts_tax_exc), currency_format, currency_sign, currency_blank)); + var totalRooms = jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add; + $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price_without_tax), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(totalRooms + jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); - $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add), currency_format, currency_sign, currency_blank)); + $('#total_rooms').html(formatCurrency(parseFloat(totalRooms), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); @@ -2136,24 +2138,24 @@
+
+
+ {l s='Total (Tax excl.)'}
+ +
+
+
+
+ {l s='Total taxes'}
+ +
+
- {l s='Total vouchers (Tax excl.)'}
+ {l s='Total vouchers'}
-
-
- {l s='Total (Tax excl.)'}
- -
-
-
-
- {l s='Total taxes'}
- -
-
{l s='Total (Tax incl.)'}
From ab59b310a0b4e95f1d98ed060802120e510083ce Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 3 Oct 2024 19:28:11 +0530 Subject: [PATCH 03/11] Added: New variables in cart summary to display the price more correctly --- .../default/template/controllers/orders/form.tpl | 15 ++++++--------- classes/Cart.php | 13 +++++++++++++ themes/hotel-reservation-theme/order-opc.tpl | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 80955674c..e6ee2c41d 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -387,7 +387,6 @@ let haserror = false if ($(this).hasClass('num_children')) { max_child_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_children').val(); - console.log(no_children_allowed_txt); if (elementVal > max_child_in_room) { $(this).val(max_child_in_room); if (elementVal == 1) { @@ -705,13 +704,12 @@ } function updateCartSummaryData(jsonSummary) { - var totalRooms = jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add; - $('#total_rooms').html(formatCurrency(parseFloat(totalRooms), currency_format, currency_sign, currency_blank)); + $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_services_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(totalRooms + jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); - $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); + $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); $('#payment_amount').val(jsonSummary.summary.total_price); @@ -1212,12 +1210,11 @@ shipping_price_selected_carrier = jsonSummary.summary.total_shipping; - var totalRooms = jsonSummary.summary.total_rooms + jsonSummary.summary.total_extra_demands + jsonSummary.summary.total_additional_services + jsonSummary.summary.total_additional_services_auto_add; $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); - $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(totalRooms + jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); + $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); - $('#total_rooms').html(formatCurrency(parseFloat(totalRooms), currency_format, currency_sign, currency_blank)); + $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_services_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); diff --git a/classes/Cart.php b/classes/Cart.php index 6fef5ee79..f12bc6823 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -3772,6 +3772,14 @@ class CartCore extends ObjectModel } $objHotelAdvancedPayment = new HotelAdvancedPayment(); + $total_rooms_services_tax_excl_without_discount = $total_rooms + $total_demands + $total_additional_services + $total_additional_services_auto_add; + $total_rooms_services_tax_incl_without_discount = $total_rooms_wt + $total_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt; + $total_tax_excl_without_discount = $total_rooms_services_tax_excl_without_discount + $convenience_fee; + $total_tax_incl_without_discount = $total_rooms_services_tax_incl_without_discount + $convenience_fee_wt; + $total_tax_without_discount = $total_tax_incl_without_discount - $total_tax_excl_without_discount; + if ($total_tax_without_discount < 0) { + $total_tax_without_discount = 0; + } $summary = array( 'delivery' => $delivery, @@ -3814,6 +3822,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_services_tax_excl_without_discount' => $total_rooms_services_tax_excl_without_discount, + 'total_rooms_services_tax_incl_without_discount' => $total_rooms_services_tax_incl_without_discount, + 'total_tax_excl_without_discount' => $total_tax_excl_without_discount, + 'total_tax_incl_without_discount' => $total_tax_incl_without_discount, + 'total_tax_without_discount' => $total_tax_without_discount ); $hook = Hook::exec('actionCartSummary', $summary, null, true); 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}

From 94931cf5b1bfc4ca471cac2c77c9de1bce6741c6 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 13:13:50 +0530 Subject: [PATCH 04/11] Fixed: wrong price break down in the invoices and the emails of the order --- classes/PaymentModule.php | 5 ++- classes/pdf/HTMLTemplateInvoice.php | 10 +++++ mails/en/order_conf.html | 59 ++++++++++++++--------------- mails/en/order_conf.txt | 6 +-- mails/en/order_conf_admin.html | 58 ++++++++++++++-------------- mails/en/order_conf_admin.txt | 5 ++- mails/en/overbooking.html | 58 ++++++++++++++-------------- mails/en/overbooking.txt | 4 +- mails/en/overbooking_admin.html | 58 ++++++++++++++-------------- 9 files changed, 138 insertions(+), 125 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 9c2cfb082..924a08d27 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -1090,16 +1090,18 @@ 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; + $data = array( '{cart_booking_data_html}' => $cart_booking_data_html, '{cart_booking_data_text}' => $cart_booking_data_text, @@ -1155,6 +1157,7 @@ abstract class PaymentModuleCore extends Module '{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 75d696ffd..c806dac74 100644 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -570,7 +570,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_tax_excl_without_discount'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl']; + $footer['total_tax_incl_without_discount'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl']; + $footer['total_tax_without_discount'] = $footer['total_tax_incl_without_discount'] - $footer['total_tax_excl_without_discount']; + if ($footer['total_tax_without_discount'] < 0) { + $footer['total_tax_without_discount'] = 0; + } $data = array( 'cart_htl_data' => $cart_htl_data, @@ -592,6 +599,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_, 'round_type' => $round_type, 'legal_free_text' => $legal_free_text, + 'total_tax_excl_without_discount' => $total_tax_excl_without_discount, + 'total_tax_incl_without_discount' => $total_tax_incl_without_discount, + 'total_tax_without_discount' => $total_tax_without_discount ); if (Tools::getValue('debug')) { diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index c5990d109..d15f92248 100755 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -197,35 +197,6 @@ - - - - - - - - - -
  - - Discounts - -  
- - - - - - - - -
  - - {total_discounts} - -  
- - @@ -274,7 +245,35 @@ + + +
  - {total_tax_paid} + {total_order_tax} + +  
+ + + + + + + + + + +
  + + Discounts + +  
+ + + + + + diff --git a/mails/en/order_conf.txt b/mails/en/order_conf.txt index 2f6384972..643cf195d 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 c6e2a41a1..599c0dd70 100755 --- a/mails/en/order_conf_admin.html +++ b/mails/en/order_conf_admin.html @@ -210,34 +210,6 @@
  + + {total_discounts}  
- - - - - - - - -
  - - Discounts - -  
- - - - - - - - -
  - - {total_discounts} - -  
- - @@ -286,7 +258,35 @@ + + +
  - {total_tax_paid} + {total_order_tax} + +  
+ + + + + + + + + + +
  + + Discounts + +  
+ + + + + + diff --git a/mails/en/order_conf_admin.txt b/mails/en/order_conf_admin.txt index 3ba3031df..3156e658c 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/overbooking.html b/mails/en/overbooking.html index 95631ee77..14174a248 100755 --- a/mails/en/overbooking.html +++ b/mails/en/overbooking.html @@ -199,34 +199,6 @@ - - - - + + + + - - - - + + + +
  + + {total_discounts}  
- - - - - - -
  - - Discounts - -  
-
- - - - - - -
  - - {total_discounts} - -  
-
@@ -275,7 +247,35 @@ + + +
  - {total_tax_paid} + {total_order_tax} + +  
+
+ + + + + + +
  + + Discounts + +  
+
+ + + + diff --git a/mails/en/overbooking.txt b/mails/en/overbooking.txt index 6a8f8975a..fa07d8743 100644 --- a/mails/en/overbooking.txt +++ b/mails/en/overbooking.txt @@ -23,14 +23,14 @@ Total {extra_demands_details_text} -{discounts} - Total Rooms Cost {total_products} Total Extra Services Cost {total_extra_demands_te} +{discounts} + Discounts {total_discounts} diff --git a/mails/en/overbooking_admin.html b/mails/en/overbooking_admin.html index 505142081..3cc40689d 100755 --- a/mails/en/overbooking_admin.html +++ b/mails/en/overbooking_admin.html @@ -215,34 +215,6 @@
  + + {total_discounts}  
- - - - - - -
  - - Discounts - -  
-
- - - - - - -
  - - {total_discounts} - -  
-
@@ -291,7 +263,35 @@ + + +
  - {total_tax_paid} + {total_order_tax} + +  
+
+ + + + + + +
  + + Discounts + +  
+
+ + + + From 58454ab99cddd9a9b9b766170a44890ff9d32f2f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 13:36:57 +0530 Subject: [PATCH 05/11] udpated: price breakdown in order-confirmation and order-detail pages --- .../front/OrderConfirmationController.php | 4 ++ .../order-confirmation.tpl | 32 +++++++-------- .../hotel-reservation-theme/order-detail.tpl | 39 ++++++++++--------- 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index 2b5709135..88256e6b6 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -391,6 +391,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']; + $totalTaxExcl = $orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_convenience_fee_te']; + $orderTotalInfo['total_tax_without_discount'] = $totalTaxIncl - $totalTaxExcl; } $this->context->smarty->assign('orderTotalInfo', $orderTotalInfo); diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl index d1408fb15..68f4e94fa 100644 --- a/themes/hotel-reservation-theme/order-confirmation.tpl +++ b/themes/hotel-reservation-theme/order-confirmation.tpl @@ -347,21 +347,6 @@ {/if} - {if $order->total_discounts > 0} - - - - - - {/if} {if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']} @@ -389,9 +374,24 @@ {l s='Total Tax'} + {if $order->total_discounts > 0} + + + + + + {/if} @@ -278,14 +279,6 @@ {/if} - {if $order->total_discounts > 0} - - - - - {/if} {if $priceDisplay && $use_tax && $total_convenience_fee_te} @@ -305,9 +298,18 @@ + + {if $order->total_discounts > 0} + + + + + {/if} @@ -664,14 +667,6 @@ {/if} - {if $order->total_discounts > 0} - - - - - {/if} {if $priceDisplay && $use_tax && $total_convenience_fee_te} @@ -691,9 +686,17 @@ + {if $order->total_discounts > 0} + + + + + {/if} {/if} - {if $footer.product_discounts_tax_excl > 0} - - - - - {/if} {* {if isset($footer.product_taxes) && $footer.product_taxes} {if $footer.total_taxes > 0} @@ -117,12 +107,21 @@ {l s='Total Tax' pdf='true'} {/if} - + {if $footer.product_discounts_tax_incl > 0} + + + + + {/if} - {if $footer.total_taxes > 0} + {if $footer.total_tax_without_discount > 0}
  + + {total_discounts}  
- {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} -
- {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax'] currency=$objOrderCurrency convert=1} + {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}
+ {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} +
diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 281019490..f90d49cd5 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.)'}
{l s='Total Vouchers'} - -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1} -
{l s='Total Convenience Fees (tax excl.)'}
{l s='Total Tax'} - {displayWtPriceWithCurrency price=($order->total_paid - $order->total_paid_tax_excl) currency=$currency} + {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
{l s='Total Vouchers'} + -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1} +
{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.)'}
{l s='Total Vouchers'} - -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1} -
{l s='Total Convenience Fees (tax excl.)'}
{l s='Total Tax'} - {displayWtPriceWithCurrency price=($order->total_paid - $order->total_paid_tax_excl) currency=$currency} + {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
{l s='Total Vouchers'} + -{displayWtPriceWithCurrency price=$order->total_discounts currency=$currency convert=1} +
{l s='Final Booking Total'} From 932f48f4af80c2c6b5a04d51fbc0b959aa8ad349 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 16:53:02 +0530 Subject: [PATCH 06/11] fixed: udpated the price break up for the invoices and udpated the names of the variables used --- .../template/controllers/orders/form.tpl | 8 +++--- classes/Cart.php | 19 +++++++------- classes/pdf/HTMLTemplateInvoice.php | 12 ++++----- pdf/invoice.total-tab.tpl | 25 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index e6ee2c41d..26ab6fa01 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -704,10 +704,10 @@ } function updateCartSummaryData(jsonSummary) { - $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_services_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); + $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_with_services_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_without_discount_te), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); @@ -1212,9 +1212,9 @@ $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); - $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_services_tax_excl_without_discount), currency_format, currency_sign, currency_blank)); + $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_with_services_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); diff --git a/classes/Cart.php b/classes/Cart.php index f12bc6823..e3b4d1e42 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -3772,11 +3772,12 @@ class CartCore extends ObjectModel } $objHotelAdvancedPayment = new HotelAdvancedPayment(); - $total_rooms_services_tax_excl_without_discount = $total_rooms + $total_demands + $total_additional_services + $total_additional_services_auto_add; - $total_rooms_services_tax_incl_without_discount = $total_rooms_wt + $total_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt; - $total_tax_excl_without_discount = $total_rooms_services_tax_excl_without_discount + $convenience_fee; - $total_tax_incl_without_discount = $total_rooms_services_tax_incl_without_discount + $convenience_fee_wt; - $total_tax_without_discount = $total_tax_incl_without_discount - $total_tax_excl_without_discount; + $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; } @@ -3822,10 +3823,10 @@ 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_services_tax_excl_without_discount' => $total_rooms_services_tax_excl_without_discount, - 'total_rooms_services_tax_incl_without_discount' => $total_rooms_services_tax_incl_without_discount, - 'total_tax_excl_without_discount' => $total_tax_excl_without_discount, - 'total_tax_incl_without_discount' => $total_tax_incl_without_discount, + '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 ); diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index c806dac74..22772d50a 100644 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -562,7 +562,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; @@ -572,9 +572,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate } $footer['total_paid_real'] = $this->order_invoice->getTotalPaid(); - $footer['total_tax_excl_without_discount'] = $footer['room_price_tax_excl'] + $footer['total_convenience_fee_te'] + $footer['additional_service_price_tax_excl']; - $footer['total_tax_incl_without_discount'] = $footer['room_price_tax_incl'] + $footer['total_convenience_fee_ti'] + $footer['additional_service_price_tax_incl']; - $footer['total_tax_without_discount'] = $footer['total_tax_incl_without_discount'] - $footer['total_tax_excl_without_discount']; + $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; } @@ -599,8 +599,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_, 'round_type' => $round_type, 'legal_free_text' => $legal_free_text, - 'total_tax_excl_without_discount' => $total_tax_excl_without_discount, - 'total_tax_incl_without_discount' => $total_tax_incl_without_discount, + 'total_without_discount_te' => $total_without_discount_te, + 'total_without_discount_ti' => $total_without_discount_ti, 'total_tax_without_discount' => $total_tax_without_discount ); diff --git a/pdf/invoice.total-tab.tpl b/pdf/invoice.total-tab.tpl index 4de340a56..09fb2d2fe 100644 --- a/pdf/invoice.total-tab.tpl +++ b/pdf/invoice.total-tab.tpl @@ -52,16 +52,6 @@
- {l s='Total Discounts' pdf='true'} - - - {displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_excl} -
@@ -108,7 +98,7 @@ {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}
- {displayPrice currency=$order->id_currency price=$footer.total_taxes} + {displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}
+ {l s='Total Discounts' pdf='true'} + + - {displayPrice currency=$order->id_currency price=$footer.product_discounts_tax_incl} +
{l s='Final Booking Amount' pdf='true'} From 2817eea256802f7d91c8058baf8252c0785d1818 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 17:54:25 +0530 Subject: [PATCH 07/11] Fixed invoce tax dispay condition --- pdf/invoice.total-tab.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdf/invoice.total-tab.tpl b/pdf/invoice.total-tab.tpl index 09fb2d2fe..13d58257a 100644 --- a/pdf/invoice.total-tab.tpl +++ b/pdf/invoice.total-tab.tpl @@ -101,7 +101,7 @@ {displayPrice currency=$order->id_currency price=$footer.total_without_discount_te}
{l s='Total Tax' pdf='true'} From 30b0af46f5852811c8b86afcd4741d8120e5dfef Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 19:07:43 +0530 Subject: [PATCH 08/11] Fixed: the design of the emails is not correct for the orders haqveing cart rules --- mails/en/order_conf.html | 26 +++++++++++++------------- mails/en/order_conf_cart_rules.tpl | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index d15f92248..14597e8c3 100755 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -136,12 +136,12 @@ - - -
+   {discounts}
+ @@ -154,7 +154,7 @@
 
+ @@ -170,7 +170,7 @@ - -
 
+ @@ -183,7 +183,7 @@
 
+ @@ -198,7 +198,7 @@ - -
 
+ @@ -211,7 +211,7 @@
 
+ @@ -226,7 +226,7 @@ - -
 
+ @@ -239,7 +239,7 @@
 
+ @@ -254,7 +254,7 @@ - -
 
+ @@ -267,7 +267,7 @@
 
+ @@ -282,7 +282,7 @@ - - - -{/foreach} \ No newline at end of file +{/foreach} From 01a1455effaf503ea75908769885b6b43813f524 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 19:15:24 +0530 Subject: [PATCH 09/11] Fixed: removed wrong variable useage --- admin/themes/default/template/controllers/orders/form.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 26ab6fa01..105e6b608 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -707,7 +707,7 @@ $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_with_services_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_without_discount_te), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.cart_total_without_discount_te), currency_format, currency_sign, currency_blank)); // $('#total_service_products').html(formatCurrency(parseFloat(jsonSummary.summary.total_service_products), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); @@ -1212,7 +1212,7 @@ $('#total_vouchers').html(formatCurrency(parseFloat(jsonSummary.summary.total_discounts), currency_format, currency_sign, currency_blank)); $('#total_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_tax_without_discount), currency_format, currency_sign, currency_blank)); - $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_without_discount_te), currency_format, currency_sign, currency_blank)); + $('#total_without_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.cart_total_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_with_taxes').html(formatCurrency(parseFloat(jsonSummary.summary.total_price), currency_format, currency_sign, currency_blank)); $('#total_rooms').html(formatCurrency(parseFloat(jsonSummary.summary.total_rooms_with_services_without_discount_te), currency_format, currency_sign, currency_blank)); $('#total_convenience_fees').html(formatCurrency(parseFloat(jsonSummary.summary.convenience_fee), currency_format, currency_sign, currency_blank)); From e765fbff2b88403967840132f2428e6c8c1db667 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 20:18:48 +0530 Subject: [PATCH 10/11] Added: Missing auto added service tax in the order confirmation page --- controllers/front/OrderConfirmationController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index 599174763..2cb4b02e7 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -395,8 +395,8 @@ class OrderConfirmationControllerCore extends FrontController $orderTotalInfo['total_paid_real'] += $objCartOrder->total_paid_real; } - $totalTaxIncl = $orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_convenience_fee_ti']; - $totalTaxExcl = $orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_convenience_fee_te']; + $totalTaxIncl = $orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_convenience_fee_ti'] + $orderTotalInfo['total_auto_add_services_ti']; + $totalTaxExcl = $orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_convenience_fee_te'] + $orderTotalInfo['total_auto_add_services_te']; $orderTotalInfo['total_tax_without_discount'] = $totalTaxIncl - $totalTaxExcl; } From bbe583c8e148389bb4267e5df25f3fc896a6fa88 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 4 Oct 2024 21:04:11 +0530 Subject: [PATCH 11/11] Added demands tax on order-confirmation page, updated the mails and removed non required information --- classes/PaymentModule.php | 2 +- .../front/OrderConfirmationController.php | 4 +-- mails/en/order_conf.html | 29 ++++++++----------- mails/en/order_conf_admin.html | 5 ---- mails/en/overbooking.html | 5 ---- mails/en/overbooking.txt | 2 -- mails/en/overbooking_admin.html | 7 ----- 7 files changed, 15 insertions(+), 39 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index bf9a25cc3..f084284e3 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -1154,7 +1154,7 @@ 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), diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index 2cb4b02e7..4747d5ee6 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -395,8 +395,8 @@ class OrderConfirmationControllerCore extends FrontController $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']; - $totalTaxExcl = $orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_convenience_fee_te'] + $orderTotalInfo['total_auto_add_services_te']; + $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; } diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index 4e161584f..763525bea 100755 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -135,13 +135,8 @@
 
+ @@ -295,7 +295,7 @@
 
+ 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 @@
 
+ @@ -27,4 +27,4 @@
- - - - -
-   {discounts} -
+ @@ -154,7 +149,7 @@
 
+ @@ -170,7 +165,7 @@ - -
 
+ @@ -183,7 +178,7 @@
 
+ @@ -198,7 +193,7 @@ - -
 
+ @@ -211,7 +206,7 @@
 
+ @@ -226,7 +221,7 @@ - -
 
+ @@ -239,7 +234,7 @@
 
+ @@ -254,7 +249,7 @@ - -
 
+ @@ -267,7 +262,7 @@
 
+ @@ -282,7 +277,7 @@ - -
 
+ @@ -295,7 +290,7 @@
 
+ diff --git a/mails/en/order_conf_admin.html b/mails/en/order_conf_admin.html index ea4218d6a..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} -
diff --git a/mails/en/overbooking.html b/mails/en/overbooking.html index 08122b12f..d005296c1 100755 --- a/mails/en/overbooking.html +++ b/mails/en/overbooking.html @@ -137,11 +137,6 @@
- - -
-   {discounts} -
diff --git a/mails/en/overbooking.txt b/mails/en/overbooking.txt index a9e93ab66..f4ad32eb3 100644 --- a/mails/en/overbooking.txt +++ b/mails/en/overbooking.txt @@ -29,8 +29,6 @@ Total Rooms Cost Total Extra Services Cost {total_extra_demands_te} -{discounts} - Discounts {total_discounts} diff --git a/mails/en/overbooking_admin.html b/mails/en/overbooking_admin.html index e2d0257c3..d06ff9a18 100755 --- a/mails/en/overbooking_admin.html +++ b/mails/en/overbooking_admin.html @@ -152,13 +152,6 @@ {extra_demands_details_html} - - -
- -   {discounts} -
-