Browse Source

Merge pull request 'dev-wahyu' (#164) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#164
pull/3/head
ibnu 1 year ago
parent
commit
89872df1cc
  1. 4
      app/Helpers/MasterFunctionsHelper.php
  2. 12
      app/Http/Controllers/ProjectController.php

4
app/Helpers/MasterFunctionsHelper.php

@ -427,6 +427,8 @@ class MasterFunctionsHelper
$potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN";
}
$lastReal = $tempPercentageReal[count($tempPercentageReal) - 1];
$totalBCWP = $lastReal * $totalBCWP;
$dataResponse = array(
"date" => $tempDate,
"percentage" => $tempPercentage,
@ -720,6 +722,8 @@ class MasterFunctionsHelper
$potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN";
}
$lastReal = $tempPercentageReal[count($tempPercentageReal) - 1];
$totalBCWP = $lastReal * $totalBCWP;
$dataResponse = array(
"date" => $tempDate,
"percentage" => $tempPercentage,

12
app/Http/Controllers/ProjectController.php

@ -445,6 +445,18 @@ class ProjectController extends Controller
$gantt = MasterFunctionsHelper::getLatestGantt($id);
$result->projectManager = User::where('id', $result->pm_id)->value('name');
$result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $gantt['last_gantt_id'])->first();
// dd($result->header->start_date);
$ganttId = $gantt['last_gantt_id'];
$startDate = Activity::where('version_gantt_id', $ganttId)
->orderBy('start_date')
->value('start_date');
$endDate = Activity::where('version_gantt_id', $ganttId)
->orderByDesc('end_date')
->value('end_date');
$result->header->start_date = $startDate;
$result->header->end_date = $endDate;
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$gantt], 200);
}

Loading…
Cancel
Save