Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added: Total rooms column in refund request list and detail page in back-officee #1327

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ public function __construct()

$this->_orderWay = 'DESC';
if ($idOrder = Tools::getValue('id_order')) {
$this->_select .= ', orsl.`name` as `status_name`, ors.`color`';
$this->_select .= ', orsl.`name` as `status_name`, ors.`color`, COUNT(ordrd.`id_order_return_detail`) as num_rooms';
$this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state ors ON (ors.`id_order_return_state` = a.`state`)';
$this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state_lang orsl ON (orsl.`id_order_return_state` = a.`state` AND orsl.`id_lang` = '.(int)$this->context->language->id.')';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ordrd ON (a.`id_order_return` = ordrd.`id_order_return`)';
$this->_where = ' AND a.`id_order`='. (int)$idOrder;
$this->_group = '';
$this->_group = 'GROUP BY a.`id_order_return`';
} else {
$this->_select .= ', ord.`total_paid_tax_incl` AS total_order, os.`id_order_state`, os.`color`, COUNT(IF(a.`state` = '.(int) Configuration::get('PS_ORS_PENDING').', 1, NULL)) AS total_pending_requests, SUM(a.`refunded_amount`) AS refunded_amount';
$this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_state os ON (os.`id_order_state` = ord.`current_state`)';
Expand Down Expand Up @@ -79,6 +80,11 @@ public function __construct()
'havingFilter' => true,
'callback' => 'setCustomerLink',
);
$this->fields_list['num_rooms'] = array(
'title' => $this->l('Total Rooms'),
'align' => 'center',
'havingFilter' => true,
);
$this->fields_list['refunded_amount'] = array(
'title' => $this->l('Refunded Amount'),
'align' => 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@
{displayPrice price=$orderTotalPaid currency=$orderInfo['id_currency']}
</div>
</div>
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Total rooms' mod='hotelreservationsystem'} :</strong>
</div>
<div class="col-sm-9">
{$refundReqBookings|count}
</div>
</div>
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Way of payment' mod='hotelreservationsystem'} :</strong>
Expand Down