From 6f70ea1273f28a2616ceeab0bd2be053126407c1 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Tue, 25 Feb 2025 09:07:13 +0100 Subject: [PATCH] Added new Dashboard Features --- .../DashboardNew/DashboardNewController.php | 17 +++++++++++++++-- public/js/pages/DashboardNew/DashboardNew.js | 14 +++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/application/DashboardNew/DashboardNewController.php b/application/DashboardNew/DashboardNewController.php index c79e9ef35..7e928201f 100644 --- a/application/DashboardNew/DashboardNewController.php +++ b/application/DashboardNew/DashboardNewController.php @@ -270,6 +270,14 @@ class DashboardNewController extends mfBaseController { $timeline_ont_installiert_300[0][$key]['value'] += $ont_installiert_300_base_value_before_history; } + $provider_bestellt_500 = $countFunction([">status_code" => "499", " "899"]); + $timeline_provider_bestellt_500 = $this->getTimeline('weekly-provider-bestellt', $campaign_ids, $gemeinde_ids); + $provider_bestellt_500_base_value_before_history = $provider_bestellt_500 - $timeline_provider_bestellt_500[0][count($timeline_provider_bestellt_500[0]) - 1]['value']; + + foreach ($timeline_provider_bestellt_500[0] as $key => $value) { + $timeline_provider_bestellt_500[0][$key]['value'] += $provider_bestellt_500_base_value_before_history; + } + self::returnJson([ 'type' => 'default', 'order_max_home_addrdb' => $order_max_homes, @@ -289,10 +297,11 @@ class DashboardNewController extends mfBaseController { 'ont_installiert_300' => $ont_installiert_300, 'vollanschluss_dokumentiert_350' => $countFunction(["status_code" => ["350","500"], "type" => "order"]), 'vorsorge_dokumentiert_351' => $countFunction(["status_code" => ["351","500"], "type" => "provision"]), - 'provider_bestellt_500' => $countFunction(["status_code" => "500"]), + 'provider_bestellt_500' => $provider_bestellt_500, 'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids), 'timeline_leerrohr' => $timeline_baufortschritt_140, - 'timeline_ont_installed' => $timeline_ont_installiert_300 + 'timeline_ont_installed' => $timeline_ont_installiert_300, + 'timeline_provider_bestellt' => $timeline_provider_bestellt_500 ]); @@ -384,6 +393,10 @@ class DashboardNewController extends mfBaseController { $params['add-where'] = " AND ph.`create` <= UNIX_TIMESTAMP('" . $date . " 23:59:59')"; $value = PreorderModel::countHistoryStatus($params, 500); break; + case 'weekly-provider-bestellt': + $params['add-where'] = " AND ph.`create` <= UNIX_TIMESTAMP('" . $date . " 23:59:59')"; + $value = PreorderModel::countHistoryStatus($params, 500); + break; } $newData = [ diff --git a/public/js/pages/DashboardNew/DashboardNew.js b/public/js/pages/DashboardNew/DashboardNew.js index e7ebf9043..c182186d4 100644 --- a/public/js/pages/DashboardNew/DashboardNew.js +++ b/public/js/pages/DashboardNew/DashboardNew.js @@ -359,7 +359,7 @@ Vue.component('dashboard-default', { data: dashboardData.timeline[0].filter(item => { return selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1])) }), - color: 'rgb(75, 192, 192)', + color: 'rgb(156, 237, 138)', fill: true, yAxisID: 'y', order: 3 @@ -367,7 +367,7 @@ Vue.component('dashboard-default', { { label: 'Leerrohr', data: dashboardData.timeline_leerrohr[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))), - color: 'rgb(255, 99, 132)', + color: 'rgb(245, 185, 2)', fill: false, yAxisID: 'y', order: 2 @@ -375,7 +375,15 @@ Vue.component('dashboard-default', { { label: 'ONT installiert', data: dashboardData.timeline_ont_installed[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))), - color: 'rgb(54, 162, 235)', + color: 'rgb(75, 192, 192)', + fill: false, + yAxisID: 'y', + order: 1 + }, + { + label: 'Provider bestellt', + data: dashboardData.timeline_provider_bestellt[0].filter(item => selectedTimeframe === 'all' || moment(item.date).isAfter(moment().subtract(selectedTimeframe.split(' ')[0], selectedTimeframe.split(' ')[1]))), + color: 'rgb(11, 179, 108)', fill: false, yAxisID: 'y', order: 1