diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index eb70448..6d75174 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/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, diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 3d22495..ffbe3fa 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/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); }