Added: Configurable options to show or hide tourism tax from price summary on front office and back office
Co-authored-by: Name <sumit201@webkul.in>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -994,6 +994,18 @@
|
||||
</configuration>
|
||||
<configuration id="PS_CUSTOMER_GUEST_MAX_LIMIT" name="PS_CUSTOMER_GUEST_MAX_LIMIT">
|
||||
<value>5</value>
|
||||
</configuration>
|
||||
<configuration id="QLO_USE_TOURISM_TAX" name="QLO_USE_TOURISM_TAX">
|
||||
<value>0</value>
|
||||
</configuration>
|
||||
<configuration id="QLO_TOURISM_TAX_GROSSED_UP" name="QLO_TOURISM_TAX_GROSSED_UP">
|
||||
<value>0</value>
|
||||
</configuration>
|
||||
<configuration id="QLO_TOURISM_TAX_SHOW_SEPARATE" name="QLO_TOURISM_TAX_SHOW_SEPARATE">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
<configuration id="QLO_TOURISM_TAX_SHOW_SEPARATE_DOCS" name="QLO_TOURISM_TAX_SHOW_SEPARATE_DOCS">
|
||||
<value>1</value>
|
||||
</configuration>
|
||||
</entities>
|
||||
</entity_configuration>
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
/*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
var CALCULATION_TYPE_PERCENTAGE = 1;
|
||||
@@ -1114,8 +1114,6 @@ class HotelHelper
|
||||
Configuration::updateValue('PS_MIN_BOOKING_OFFSET', 0);
|
||||
|
||||
Configuration::updateValue('HTL_FEATURE_PRICING_PRIORITY', 'specific_date;special_day;date_range');
|
||||
Configuration::updateValue('QLO_USE_TOURISM_TAX', 0);
|
||||
Configuration::updateValue('QLO_TOURISM_TAX_GROSSED_UP', 0);
|
||||
Configuration::updateValue('WK_GOOGLE_ACTIVE_MAP', 0);
|
||||
Configuration::updateValue('WK_MAP_HOTEL_ACTIVE_ONLY', 1);
|
||||
|
||||
|
||||
@@ -622,8 +622,6 @@ class HotelReservationSystem extends Module
|
||||
'QLO_HEADER_SLIDER_AUTO_PLAY',
|
||||
'QLO_HEADER_SLIDER_INTERVAL',
|
||||
'QLO_HEADER_SLIDER_ANIM_TYPE',
|
||||
'QLO_USE_TOURISM_TAX',
|
||||
'QLO_TOURISM_TAX_GROSSED_UP',
|
||||
);
|
||||
foreach ($configKeys as $key) {
|
||||
if (!Configuration::deleteByName($key)) {
|
||||
|
||||
@@ -255,17 +255,24 @@
|
||||
<td class="grey small bold" width="70%">{l s='Total (Tax excl.)' pdf='true'}</td>
|
||||
<td class="white right small bold" width="30%">{displayPrice currency=$order->id_currency price=$footer.total_without_discount_te}</td>
|
||||
</tr>
|
||||
{if $footer.total_tax_without_discount > 0}
|
||||
<tr>
|
||||
<td class="grey small bold" width="70%">{l s='Room and Service Tax' pdf='true'}</td>
|
||||
<td class="white right small bold" width="30%">{displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($footer.total_tourism_tax) && $footer.total_tourism_tax > 0}
|
||||
{if (!isset($footer.show_tourism_tax_separately) || $footer.show_tourism_tax_separately) && isset($footer.total_tourism_tax) && $footer.total_tourism_tax > 0}
|
||||
{if $footer.total_tax_without_discount > 0}
|
||||
<tr>
|
||||
<td class="grey small bold" width="70%">{l s='Room and Service Tax' pdf='true'}</td>
|
||||
<td class="white right small bold" width="30%">{displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="grey small bold" width="70%">{l s='Total Tourism Tax' pdf='true'}</td>
|
||||
<td class="white right small bold" width="30%">{displayPrice currency=$order->id_currency price=$footer.total_tourism_tax}</td>
|
||||
</tr>
|
||||
{else}
|
||||
{if ($footer.total_tax_without_discount + $footer.total_tourism_tax) > 0}
|
||||
<tr>
|
||||
<td class="grey small bold" width="70%">{l s='Total Taxes' pdf='true'}</td>
|
||||
<td class="white right small bold" width="30%">{displayPrice currency=$order->id_currency price=($footer.total_tax_without_discount + $footer.total_tourism_tax)}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($footer.product_discounts_tax_incl) && $footer.product_discounts_tax_incl > 0}
|
||||
<tr>
|
||||
|
||||
@@ -106,25 +106,36 @@
|
||||
{displayPrice currency=$order->id_currency price=$footer.total_without_discount_te}
|
||||
</td>
|
||||
</tr>
|
||||
{if $footer.total_tax_without_discount > 0}
|
||||
<tr class="bold">
|
||||
<td class="grey">
|
||||
{l s='Room and Service Tax' pdf='true'}
|
||||
</td>
|
||||
<td class="white">
|
||||
{displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($footer.total_tourism_tax) && $footer.total_tourism_tax > 0}
|
||||
<tr>
|
||||
<td class="grey">
|
||||
{l s='Total Tourism Tax' pdf='true'}
|
||||
</td>
|
||||
<td class="white">
|
||||
{displayPrice currency=$order->id_currency price=$footer.total_tourism_tax}
|
||||
</td>
|
||||
</tr>
|
||||
{if (!isset($footer.show_tourism_tax_separately) || $footer.show_tourism_tax_separately) && isset($footer.total_tourism_tax) && $footer.total_tourism_tax > 0}
|
||||
{if $footer.total_tax_without_discount > 0}
|
||||
<tr class="bold">
|
||||
<td class="grey">
|
||||
{l s='Room and Service Tax' pdf='true'}
|
||||
</td>
|
||||
<td class="white">
|
||||
{displayPrice currency=$order->id_currency price=$footer.total_tax_without_discount}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="grey">
|
||||
{l s='Total Tourism Tax' pdf='true'}
|
||||
</td>
|
||||
<td class="white">
|
||||
{displayPrice currency=$order->id_currency price=$footer.total_tourism_tax}
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
{if ($footer.total_tax_without_discount + $footer.total_tourism_tax) > 0}
|
||||
<tr class="bold">
|
||||
<td class="grey">
|
||||
{l s='Total Taxes' pdf='true'}
|
||||
</td>
|
||||
<td class="white">
|
||||
{displayPrice currency=$order->id_currency price=($footer.total_tax_without_discount + $footer.total_tourism_tax)}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $footer.product_discounts_tax_incl > 0}
|
||||
|
||||
@@ -90,16 +90,21 @@
|
||||
{hook h='displayBeforeCartTotalTax'}
|
||||
{/block}
|
||||
{if $show_taxes}
|
||||
<p class="cart_total_tax">
|
||||
<span>{l s='Room and Service Tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=($total_tax_without_discount)}</span>
|
||||
</p>
|
||||
{/if}
|
||||
{if $show_taxes && isset($total_tourism_tax) && $total_tourism_tax > 0}
|
||||
<p class="cart_total_tourism_tax">
|
||||
<span>{l s='Total Tourism Tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=$total_tourism_tax}</span>
|
||||
</p>
|
||||
{if (!isset($show_tourism_tax_separately) || $show_tourism_tax_separately) && isset($total_tourism_tax) && $total_tourism_tax > 0}
|
||||
<p class="cart_total_tax">
|
||||
<span>{l s='Room and Service Tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=($total_tax_without_discount)}</span>
|
||||
</p>
|
||||
<p class="cart_total_tourism_tax">
|
||||
<span>{l s='Total Tourism Tax'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=$total_tourism_tax}</span>
|
||||
</p>
|
||||
{else}
|
||||
<p class="cart_total_tax">
|
||||
<span>{l s='Total Taxes'}</span>
|
||||
<span class="cart_total_values">{displayPrice price=($total_tax_without_discount + $total_tourism_tax)}</span>
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
<p class="total_discount_block {if $total_discounts == 0}unvisible{/if}">
|
||||
<span>
|
||||
|
||||
@@ -469,15 +469,15 @@
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Room and Service Tax'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{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}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Room and Service Tax'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=$orderTotalInfo['total_tax_without_discount'] currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Tourism Tax'}</strong>
|
||||
@@ -486,6 +486,15 @@
|
||||
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_tourism_tax'] currency=$objOrderCurrency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Taxes'}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span class="price-discount">{displayWtPriceWithCurrency price=($orderTotalInfo['total_tax_without_discount'] + $orderTotalInfo['total_tourism_tax']) currency=$objOrderCurrency convert=1}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $order->total_discounts > 0}
|
||||
<tr class="item">
|
||||
|
||||
@@ -373,20 +373,27 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Room and Service Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{if (!isset($show_tourism_tax_separately) || $show_tourism_tax_separately) && isset($total_tourism_tax) && $total_tourism_tax > 0}
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Room and Service Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if isset($total_tourism_tax) && $total_tourism_tax > 0}
|
||||
<tr class="item">
|
||||
<td>{l s='Total Tourism Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=$total_tourism_tax currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Total Taxes'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount + $total_tourism_tax) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $order->total_discounts > 0}
|
||||
@@ -801,19 +808,26 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Room and Service Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{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}
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Room and Service Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="item">
|
||||
<td>{l s='Total Tourism Tax'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=$total_tourism_tax currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{else}
|
||||
<tr class="totalprice item">
|
||||
<td>{l s='Total Taxes'}</td>
|
||||
<td class="text-right">
|
||||
<span class="price">{displayWtPriceWithCurrency price=($total_tax_without_discount + $total_tourism_tax) currency=$currency}</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $order->total_discounts > 0}
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user