diff --git a/admin/themes/default/template/controllers/slip/_booking_amount_desc.tpl b/admin/themes/default/template/controllers/slip/_booking_amount_desc.tpl index e59d4a5d2..55724e56d 100644 --- a/admin/themes/default/template/controllers/slip/_booking_amount_desc.tpl +++ b/admin/themes/default/template/controllers/slip/_booking_amount_desc.tpl @@ -20,8 +20,5 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} -{l s='Total room price:'} -
-{l s='Total service price:'} -
-{l s='Total order amount:'} -
{l s='Total credit slip amount for this order:'} -
- + diff --git a/admin/themes/default/template/controllers/slip/_booking_room_service_total_desc.tpl b/admin/themes/default/template/controllers/slip/_booking_room_service_total_desc.tpl new file mode 100644 index 000000000..fa10c1929 --- /dev/null +++ b/admin/themes/default/template/controllers/slip/_booking_room_service_total_desc.tpl @@ -0,0 +1,25 @@ +{** +* 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 +*} + +{l s='Total room price:'} -
+{l s='Total service price:'} -
+{l s='Total room booking price:'} -
diff --git a/admin/themes/default/template/controllers/slip/_order_info_desc.tpl b/admin/themes/default/template/controllers/slip/_order_info_desc.tpl index c7fd0a15e..8ca874966 100644 --- a/admin/themes/default/template/controllers/slip/_order_info_desc.tpl +++ b/admin/themes/default/template/controllers/slip/_order_info_desc.tpl @@ -24,3 +24,5 @@ + + diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index 9f541dbc6..f4be19d7f 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -189,6 +189,9 @@ public function initPageHeaderToolbar() 'required' => true, 'hint' => $this->l('Select a room to generate the credit slip for'), 'col' => 3, + 'desc' => $this->context->smarty->fetch( + _PS_ADMIN_DIR_ . '/themes/default/template/controllers/slip/_booking_room_service_total_desc.tpl' + ), 'options' => array( 'query' => array(), 'id' => 'id', @@ -598,7 +601,9 @@ public function initPageHeaderToolbar() 'bookings' => $bookingDetails, 'currency' => $currency, 'total_slip_amount' => $totalSlipAmount, - 'slip_ids' => $slipIds + 'slip_ids' => $slipIds, + 'order_total_amount' => (float) $objOrder->total_paid, + 'order_total_paid' => (float) $objOrder->total_paid_real ))); } diff --git a/js/admin/slips.js b/js/admin/slips.js index 7adb16cb9..13e2d42d0 100644 --- a/js/admin/slips.js +++ b/js/admin/slips.js @@ -137,6 +137,10 @@ $(document).ready(function() { $('#booking-total-slip-amount').text('-'); $('#booking-slip-ids').html(''); $('#booking-slip-ids-wrapper').hide(); + $('#order-total-amount').text('-'); + $('#order-total-amount-wrapper').hide(); + $('#order-total-paid').text('-'); + $('#order-total-paid-wrapper').hide(); return; } @@ -162,6 +166,14 @@ $(document).ready(function() { currencySign = response.currency.sign; var totalSlipAmount = parseFloat(response.total_slip_amount || 0); $('#booking-total-slip-amount').text(currencySign + ' ' + totalSlipAmount.toFixed(2)); + + var orderTotalAmount = parseFloat(response.order_total_amount || 0); + $('#order-total-amount').text(currencySign + ' ' + orderTotalAmount.toFixed(2)); + $('#order-total-amount-wrapper').show(); + + var orderTotalPaid = parseFloat(response.order_total_paid || 0); + $('#order-total-paid').text(currencySign + ' ' + orderTotalPaid.toFixed(2)); + $('#order-total-paid-wrapper').show(); var slipIds = response.slip_ids || []; if (slipIds.length) { var links = slipIds.map(function (id) {