diff --git a/classes/pdf/HTMLTemplateBookingVoucher.php b/classes/pdf/HTMLTemplateBookingVoucher.php
index a05a632b2..03cf50a15 100644
--- a/classes/pdf/HTMLTemplateBookingVoucher.php
+++ b/classes/pdf/HTMLTemplateBookingVoucher.php
@@ -310,6 +310,7 @@ class HTMLTemplateBookingVoucherCore extends HTMLTemplate
$totalTourismTax = OrderTaxDetail::getOrderTourismTaxTotal((int) $this->order->id);
$footer['total_tax_without_discount'] = max(0, $totalWithoutDiscountTaxIncl - $footer['total_without_discount_te'] - $totalTourismTax);
$footer['total_tourism_tax'] = $totalTourismTax;
+ $footer['show_tourism_tax_separately'] = (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE_DOCS');
$grandTotal = max(0.0, $totalWithoutDiscountTaxIncl - $productDiscountsTaxIncl);
$footer['product_discounts_tax_incl'] = $productDiscountsTaxIncl;
$footer['total_paid_tax_incl'] = $grandTotal;
diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php
index ceddfd2f0..7c9494d8b 100644
--- a/classes/pdf/HTMLTemplateInvoice.php
+++ b/classes/pdf/HTMLTemplateInvoice.php
@@ -618,6 +618,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
if ($footer['total_tax_without_discount'] < 0) {
$footer['total_tax_without_discount'] = 0;
}
+ $footer['show_tourism_tax_separately'] = (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE_DOCS');
$data = array(
'cart_htl_data' => $cart_htl_data,
diff --git a/controllers/admin/AdminTaxesController.php b/controllers/admin/AdminTaxesController.php
index 1f2433087..a087c0252 100644
--- a/controllers/admin/AdminTaxesController.php
+++ b/controllers/admin/AdminTaxesController.php
@@ -143,7 +143,23 @@ class AdminTaxesControllerCore extends AdminController
if (Configuration::get('QLO_USE_TOURISM_TAX') || Tools::getValue('QLO_USE_TOURISM_TAX')) {
$this->fields_options['general']['fields']['QLO_TOURISM_TAX_GROSSED_UP'] = array(
'title' => $this->l('Include tourism tax in displayed prices'),
- 'desc' => $this->l('When enabled, tourism tax is included in displayed prices. The applicable tourism tax is always shown as a separate line if applicable.'),
+ 'desc' => $this->l('When enabled, tourism tax is included in displayed prices. Whether the applicable tourism tax is also shown as a separate line depends on the settings below.'),
+ 'validation' => 'isBool',
+ 'cast' => 'intval',
+ 'type' => 'bool',
+ );
+
+ $this->fields_options['general']['fields']['QLO_TOURISM_TAX_SHOW_SEPARATE'] = array(
+ 'title' => $this->l('Show tourism tax separately in price summary'),
+ 'desc' => $this->l('When enabled, tourism tax is shown as its own line, separate from the room/service tax, on the cart summary, order confirmation, and order detail pages.'),
+ 'validation' => 'isBool',
+ 'cast' => 'intval',
+ 'type' => 'bool',
+ );
+
+ $this->fields_options['general']['fields']['QLO_TOURISM_TAX_SHOW_SEPARATE_DOCS'] = array(
+ 'title' => $this->l('Show tourism tax separately on invoices / booking vouchers'),
+ 'desc' => $this->l('When enabled, tourism tax is shown as its own line, separate from the room/service tax, on the invoice and booking voucher totals.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool',
@@ -1134,7 +1150,7 @@ class AdminTaxesControllerCore extends AdminController
parent::setMedia();
if ($this->display == 'edit' || $this->display == 'add') {
$this->addCSS(_MODULE_DIR_ . 'hotelreservationsystem/views/css/HotelReservationAdmin.css');
- $this->addJs(_MODULE_DIR_ . 'hotelreservationsystem/views/js/TourismTaxForm.js');
+ $this->addJs(_PS_JS_DIR_ . 'admin/tourism_tax_form.js');
}
}
diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php
index 0839f9a28..13b9c41fa 100644
--- a/controllers/front/GuestTrackingController.php
+++ b/controllers/front/GuestTrackingController.php
@@ -557,6 +557,7 @@ class GuestTrackingControllerCore extends FrontController
'guestInformations' => (array)$customer,
'view_on_map' => Configuration::get('WK_GOOGLE_ACTIVE_MAP'),
'total_tourism_tax' => isset($total_tourism_tax) ? $total_tourism_tax : 0,
+ 'show_tourism_tax_separately' => (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE'),
));
}
diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php
index 3babfaa6c..cd3de3304 100644
--- a/controllers/front/OrderConfirmationController.php
+++ b/controllers/front/OrderConfirmationController.php
@@ -415,6 +415,7 @@ class OrderConfirmationControllerCore extends FrontController
}
}
+ $orderTotalInfo['show_tourism_tax_separately'] = (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE');
$this->context->smarty->assign('orderTotalInfo', $orderTotalInfo);
$this->context->smarty->assign('orders_has_invoice', $orders_has_invoice);
}
diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php
index 805cac5ba..d357211a4 100644
--- a/controllers/front/OrderDetailController.php
+++ b/controllers/front/OrderDetailController.php
@@ -403,6 +403,7 @@ class OrderDetailControllerCore extends FrontController
'total_convenience_fee_ti' => $total_convenience_fee_ti,
'total_convenience_fee_te' => $total_convenience_fee_te,
'total_tourism_tax' => $totalTourismTax,
+ 'show_tourism_tax_separately' => (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE'),
'any_back_order' => $anyBackOrder,
'shw_bo_msg' => Configuration::get('WK_SHOW_MSG_ON_BO'),
'back_ord_msg' => Configuration::get('WK_BO_MESSAGE'),
diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php
index d445b6e4c..3fa526a22 100644
--- a/controllers/front/ParentOrderController.php
+++ b/controllers/front/ParentOrderController.php
@@ -406,6 +406,7 @@ class ParentOrderControllerCore extends FrontController
}
}
$this->context->smarty->assign($summary);
+ $this->context->smarty->assign('show_tourism_tax_separately', (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE'));
$this->context->smarty->assign(array(
'HOOK_SHOPPING_CART' => Hook::exec('displayShoppingCartFooter', $summary),
'HOOK_SHOPPING_CART_EXTRA' => Hook::exec('displayShoppingCart', $summary)
@@ -476,6 +477,7 @@ class ParentOrderControllerCore extends FrontController
}
$this->context->smarty->assign($summary);
+ $this->context->smarty->assign('show_tourism_tax_separately', (bool) Configuration::get('QLO_TOURISM_TAX_SHOW_SEPARATE'));
$this->context->smarty->assign(array(
'token_cart' => Tools::getToken(false),
'isLogged' => $this->isLogged,
diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml
index b5cb8b5c2..6c7728f25 100644
--- a/install/data/xml/configuration.xml
+++ b/install/data/xml/configuration.xml
@@ -994,6 +994,18 @@
- {l s='Room and Service Tax'} - {displayPrice price=($total_tax_without_discount)} -
- {/if} - {if $show_taxes && isset($total_tourism_tax) && $total_tourism_tax > 0} -- {l s='Total Tourism Tax'} - {displayPrice price=$total_tourism_tax} -
+ {if (!isset($show_tourism_tax_separately) || $show_tourism_tax_separately) && isset($total_tourism_tax) && $total_tourism_tax > 0} ++ {l s='Room and Service Tax'} + {displayPrice price=($total_tax_without_discount)} +
++ {l s='Total Tourism Tax'} + {displayPrice price=$total_tourism_tax} +
+ {else} ++ {l s='Total Taxes'} + {displayPrice price=($total_tax_without_discount + $total_tourism_tax)} +
+ {/if} {/if}
diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl
index 74450385f..a6714f68b 100644
--- a/themes/hotel-reservation-theme/order-confirmation.tpl
+++ b/themes/hotel-reservation-theme/order-confirmation.tpl
@@ -469,15 +469,15 @@
{/if}
-
-
- {if isset($orderTotalInfo['total_tourism_tax']) && $orderTotalInfo['total_tourism_tax'] > 0}
+ {if (!isset($orderTotalInfo['show_tourism_tax_separately']) || $orderTotalInfo['show_tourism_tax_separately']) && isset($orderTotalInfo['total_tourism_tax']) && $orderTotalInfo['total_tourism_tax'] > 0}
+
- {l s='Room and Service Tax'}
-
-
- {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}
-
-
+
+ {l s='Room and Service Tax'}
+
+
+ {displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}
+
+
+ {else}
+
{l s='Total Tourism Tax'}
@@ -486,6 +486,15 @@
{displayWtPriceWithCurrency price=$orderTotalInfo['total_tourism_tax'] currency=$objOrderCurrency}
+
{/if}
{if $order->total_discounts > 0}
+ {l s='Total Taxes'}
+
+
+ {displayWtPriceWithCurrency price=($orderTotalInfo['total_tax_without_discount'] + $orderTotalInfo['total_tourism_tax']) currency=$objOrderCurrency convert=1}
+
+
diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl
index 6a00a6ce3..7ee617deb 100644
--- a/themes/hotel-reservation-theme/order-detail.tpl
+++ b/themes/hotel-reservation-theme/order-detail.tpl
@@ -373,20 +373,27 @@
{/if}
-
-
+ {if (!isset($show_tourism_tax_separately) || $show_tourism_tax_separately) && isset($total_tourism_tax) && $total_tourism_tax > 0}
+ {l s='Room and Service Tax'}
-
- {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
-
-
+
- {if isset($total_tourism_tax) && $total_tourism_tax > 0}
{l s='Room and Service Tax'}
+
+ {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
+
+
+ {else}
+ {l s='Total Tourism Tax'}
{displayWtPriceWithCurrency price=$total_tourism_tax currency=$currency}
+
{/if}
{if $order->total_discounts > 0}
@@ -801,19 +808,26 @@
{/if}
- {l s='Total Taxes'}
+
+ {displayWtPriceWithCurrency price=($total_tax_without_discount + $total_tourism_tax) currency=$currency}
+
+
-
- {if isset($total_tourism_tax) && $total_tourism_tax > 0}
+ {if (!isset($show_tourism_tax_separately) || $show_tourism_tax_separately) && isset($total_tourism_tax) && $total_tourism_tax > 0}
+ {l s='Room and Service Tax'}
-
- {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
-
-
+
{l s='Room and Service Tax'}
+
+ {displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}
+
+
+ {else}
+ {l s='Total Tourism Tax'}
{displayWtPriceWithCurrency price=$total_tourism_tax currency=$currency}
+
{/if}
{if $order->total_discounts > 0}
{l s='Total Taxes'}
+
+ {displayWtPriceWithCurrency price=($total_tax_without_discount + $total_tourism_tax) currency=$currency}
+
+