Browse Source

update dashboard bod

pull/3/head
wahyu 1 year ago
parent
commit
4e69d7c35c
  1. 2
      app/Helpers/MasterFunctionsHelper.php
  2. 6
      app/Http/Controllers/DashboardBoDController.php

2
app/Helpers/MasterFunctionsHelper.php

@ -310,7 +310,7 @@ class MasterFunctionsHelper
->groupBy('activity_id') ->groupBy('activity_id')
->first(); ->first();
$weekCount = $keyPlanM->duration / 7; $weekCount = $keyPlanM->duration / 7;
$weeklyPlan = $sumVolPlan->ttl_qty_plan / $weekCount; $weeklyPlan = $weekCount > 0 ? $sumVolPlan->ttl_qty_plan / $weekCount : 0;
$weeklyProgress = $weeklyPlan / $sumVolPlan->ttl_qty_plan * $keyPlanM->bobot_planning; $weeklyProgress = $weeklyPlan / $sumVolPlan->ttl_qty_plan * $keyPlanM->bobot_planning;
$dataTempPlan[$x]['activity_id'] = $keyPlanM->id; $dataTempPlan[$x]['activity_id'] = $keyPlanM->id;
$dataTempPlan[$x]['bobot_planning'] = $keyPlanM->bobot_planning; $dataTempPlan[$x]['bobot_planning'] = $keyPlanM->bobot_planning;

6
app/Http/Controllers/DashboardBoDController.php

@ -136,6 +136,9 @@ class DashboardBoDController extends Controller
foreach ($projects as $index => $project) { foreach ($projects as $index => $project) {
$project->scurve = MasterFunctionsHelper::getSCurve($project->id); $project->scurve = MasterFunctionsHelper::getSCurve($project->id);
$selisihProgress = 0; $selisihProgress = 0;
$planningProgress = 0;
$actualProgress = 0;
if ($project->scurve && $project->scurve[0]) { if ($project->scurve && $project->scurve[0]) {
$planningArray = $project->scurve[0]['data']['percentagePlan']; $planningArray = $project->scurve[0]['data']['percentagePlan'];
$actualArray = $project->scurve[0]['data']['percentageReal']; $actualArray = $project->scurve[0]['data']['percentageReal'];
@ -178,6 +181,9 @@ class DashboardBoDController extends Controller
foreach ($projects as $project) { foreach ($projects as $project) {
$project->scurve = MasterFunctionsHelper::getSCurve($project->id); $project->scurve = MasterFunctionsHelper::getSCurve($project->id);
$selisihProgress = 0; $selisihProgress = 0;
$planningProgress = 0;
$actualProgress = 0;
if ($project->scurve && $project->scurve[0]) { if ($project->scurve && $project->scurve[0]) {
$planningArray = $project->scurve[0]['data']['percentagePlan']; $planningArray = $project->scurve[0]['data']['percentagePlan'];
$actualArray = $project->scurve[0]['data']['percentageReal']; $actualArray = $project->scurve[0]['data']['percentageReal'];

Loading…
Cancel
Save