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}