Browse Source

Merge pull request 'update dashboard bod' (#238) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#238
Reviewed-by: ardhi <ardhi@mail.com>
pull/3/head
ardhi 11 months ago
parent
commit
e0c1679493
  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