From 8a26f1bcb1fda04baff94b29fdc78b56a6627777 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Fri, 27 Oct 2023 11:35:11 +0700 Subject: [PATCH 1/3] add parent select --- app/Http/Controllers/DashboardBoDController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/DashboardBoDController.php b/app/Http/Controllers/DashboardBoDController.php index ebdf8a3..78c614f 100644 --- a/app/Http/Controllers/DashboardBoDController.php +++ b/app/Http/Controllers/DashboardBoDController.php @@ -304,7 +304,7 @@ class DashboardBoDController extends Controller { $year = $this->interpolateYear($year); - $divisions = Divisi::select('id', 'name', 'color') + $divisions = Divisi::select('id', 'name', 'parent', 'color') ->with('children') ->whereNull('parent') ->get(); From 7cd6e4ef307e0bf8db72822b4fd65649b4eede72 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Fri, 27 Oct 2023 13:19:07 +0700 Subject: [PATCH 2/3] rollback --- app/Http/Controllers/DashboardBoDController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/DashboardBoDController.php b/app/Http/Controllers/DashboardBoDController.php index 78c614f..ebdf8a3 100644 --- a/app/Http/Controllers/DashboardBoDController.php +++ b/app/Http/Controllers/DashboardBoDController.php @@ -304,7 +304,7 @@ class DashboardBoDController extends Controller { $year = $this->interpolateYear($year); - $divisions = Divisi::select('id', 'name', 'parent', 'color') + $divisions = Divisi::select('id', 'name', 'color') ->with('children') ->whereNull('parent') ->get(); From 2923ec649f9122cc7d5f5353738f27a26d4e2004 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 1 Nov 2023 16:00:55 +0700 Subject: [PATCH 3/3] update estimated finish --- app/Http/Controllers/ProjectController.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 39042ec..6540e1a 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -45,7 +45,7 @@ class ProjectController extends Controller { $this->validate($request, [ 'nama' => 'required', - 'mulai_proyek' => 'required', + 'mulai_proyek' => 'required', 'akhir_proyek' => 'required', 'rencana_biaya' => 'required', 'type_proyek_id' => 'required' @@ -519,12 +519,12 @@ class ProjectController extends Controller if (isset($s_curve)) { $result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->first(); $actualStartExist = Activity::where('proyek_id', $id)->whereNotNull('actual_start')->exists(); - $actualEndExist = Activity::where('proyek_id', $id)->whereNotNull('actual_end')->exists(); + $actualEndExist = Activity::where('proyek_id', $id)->exists(); $query = Activity::where('proyek_id', $id); } else { $result->header = Activity::whereNull('parent_id')->where("proyek_id", $id)->where("version_gantt_id", $ganttId)->first(); $actualStartExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_start')->exists(); - $actualEndExist = Activity::where('version_gantt_id', $ganttId)->whereNotNull('actual_end')->exists(); + $actualEndExist = Activity::where('version_gantt_id', $ganttId)->exists(); $query = Activity::where('version_gantt_id', $ganttId); } @@ -533,11 +533,10 @@ class ProjectController extends Controller } else { $startDate = $query->orderBy('start_date')->value('start_date'); } - - if ($actualEndExist) { - $endDate = $query->orderByDesc('actual_end')->value('end_date'); - } else { - $endDate = $query->orderByDesc('end_date')->value('end_date'); + if($actualEndExist) + { + $maxEndDate = $query->max('id'); + $endDate = $query->where('id',$maxEndDate)->first()->end_date; } $plannedStart = Activity::where('version_gantt_id', $ganttId)