Fixed: Removed the refunded and cancelled rooms from the due amount KPI filter and optimized code

This commit is contained in:
vishalsingh.qlo325
2024-10-09 18:39:18 +05:30
parent 97fd75dfbd
commit ade48a4322
3 changed files with 8 additions and 8 deletions

View File

@@ -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;

View File

@@ -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')
);
}

View File

@@ -80,7 +80,7 @@
<ul class="stats-list">
<li>
<span class="item-label">
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}&amp;orderFilter_hbd!is_refunded=0&amp;orderFilter_hbd!is_cancelled=0&amp;orderFilter_amount_due%5B0%5D={$minValue}" target="_blank">
<a href="{$link->getAdminLink("AdminOrders")|escape:"html":"UTF-8"}&amp;submitFilterorder=1&amp;orderFilter_hbd!is_refunded=0&amp;orderFilter_hbd!is_cancelled=0&amp;orderFilter_amount_due%5B0%5D={$min_due_amount}" target="_blank">
<span>{l s="Bookings (not paid)" mod='dashactivity'}</span>
</a>
</span>