Fixed: Removed the refunded and cancelled rooms from the due amount KPI filter and optimized code
This commit is contained in:
@@ -301,13 +301,13 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'optional' => true,
|
||||
),
|
||||
'is_refunded' => array(
|
||||
'title' => $this->l('Refunded'),
|
||||
'title' => $this->l('Refunded rooms'),
|
||||
'filter_key' => 'hbd!is_refunded',
|
||||
'type'=>'bool',
|
||||
'displayed' => false,
|
||||
),
|
||||
'is_cancelled' => array(
|
||||
'title' => $this->l('Cancelled'),
|
||||
'title' => $this->l('Cancelled rooms'),
|
||||
'filter_key' => 'hbd!is_cancelled',
|
||||
'type'=>'bool',
|
||||
'displayed' => false,
|
||||
@@ -2521,7 +2521,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Total Due Amount', null, null, false);
|
||||
$minValue = ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1');
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_amount_due%5B0%5D='.$minValue;
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!is_cancelled=0&orderFilter_amount_due%5B0%5D='.$minValue;
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_due_amount';
|
||||
$helper->tooltip = $this->l('Total due amount of all the orders created.', null, null, false);
|
||||
$this->kpis[] = $helper;
|
||||
@@ -2533,7 +2533,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color1';
|
||||
$helper->title = $this->l('Arrivals', null, null, false);
|
||||
$helper->subtitle = $this->l('Today', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_ALLOTED.'&orderFilter_hbd!date_from[]='.pSQL(date('Y-m-d')).'&orderFilter_hbd!date_from[]='.pSQL(date('Y-m-d'));
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_ALLOTED.'&orderFilter_hbd!date_from[]='.pSQL(date('Y-m-d')).'&orderFilter_hbd!date_from[]='.pSQL(date('Y-m-d'));
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=today_arrivals';
|
||||
$helper->tooltip = $this->l('Total number of arrivals for today.', null, null, false);
|
||||
$this->kpis[] = $helper;
|
||||
@@ -2545,7 +2545,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Departures', null, null, false);
|
||||
$helper->subtitle = $this->l('Today', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d')).'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d'));
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d')).'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d'));
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=today_departures';
|
||||
$helper->tooltip = $this->l('Total number of departures for today.', null, null, false);
|
||||
$this->kpis[] = $helper;
|
||||
@@ -2558,7 +2558,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('Stay Overs', null, null, false);
|
||||
$helper->subtitle = $this->l('Today', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d', strtotime('+ 1 days'))).'&orderFilter_hbd!date_to[]=';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminOrders').'&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!id_status='.HotelBookingDetail::STATUS_CHECKED_IN.'&orderFilter_hbd!date_to[]='.pSQL(date('Y-m-d', strtotime('+ 1 days'))).'&orderFilter_hbd!date_to[]=';
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=today_stay_over';
|
||||
$helper->tooltip = $this->l('Total number of stay overs for today.', null, null, false);
|
||||
$this->kpis[] = $helper;
|
||||
|
||||
@@ -536,7 +536,7 @@ class Dashactivity extends Module
|
||||
'DASHACTIVITY_CART_ABANDONED_MIN' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MIN', Configuration::get('DASHACTIVITY_CART_ABANDONED_MIN')),
|
||||
'DASHACTIVITY_CART_ABANDONED_MAX' => Tools::getValue('DASHACTIVITY_CART_ABANDONED_MAX', Configuration::get('DASHACTIVITY_CART_ABANDONED_MAX')),
|
||||
'DASHACTIVITY_VISITOR_ONLINE' => Tools::getValue('DASHACTIVITY_VISITOR_ONLINE', Configuration::get('DASHACTIVITY_VISITOR_ONLINE')),
|
||||
'minValue' => ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1')
|
||||
'min_due_amount' => ('0.' . str_repeat('0', (Configuration::get('PS_PRICE_DISPLAY_PRECISION') - 1)) . '1')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<ul class="stats-list">
|
||||
<li>
|
||||
<span class="item-label">
|
||||
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}&orderFilter_hbd!is_refunded=0&orderFilter_hbd!is_cancelled=0&orderFilter_amount_due%5B0%5D={$minValue}" target="_blank">
|
||||
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}&submitFilterorder=1&orderFilter_hbd!is_refunded=0&orderFilter_hbd!is_cancelled=0&orderFilter_amount_due%5B0%5D={$min_due_amount}" target="_blank">
|
||||
<span>{l s="Bookings (not paid)" mod='dashactivity'}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user