From ade48a4322c933b5dc721224e0aa426fc461007e Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 9 Oct 2024 18:39:18 +0530 Subject: [PATCH] Fixed: Removed the refunded and cancelled rooms from the due amount KPI filter and optimized code --- controllers/admin/AdminOrdersController.php | 12 ++++++------ modules/dashactivity/dashactivity.php | 2 +- .../views/templates/hook/dashboard_zone_one.tpl | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 295a9de47..e80fe1fa4 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -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; diff --git a/modules/dashactivity/dashactivity.php b/modules/dashactivity/dashactivity.php index e852bfedb..fb39c250f 100644 --- a/modules/dashactivity/dashactivity.php +++ b/modules/dashactivity/dashactivity.php @@ -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') ); } diff --git a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl index 9dfcac099..90acecce1 100644 --- a/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl +++ b/modules/dashactivity/views/templates/hook/dashboard_zone_one.tpl @@ -80,7 +80,7 @@