From b8784cf6ffbf0e8da4fd64c820d0561916b3e999 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 16 Aug 2023 13:27:46 +0700 Subject: [PATCH 1/3] Fix type milestone --- app/Http/Controllers/ActivityController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 5158b05..6124751 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -216,7 +216,9 @@ class ActivityController extends Controller $data['created_by'] = $this->currentName; $max = Activity::where('version_gantt_id', $request->version_gantt_id)->max('sortorder'); $data['sortorder'] = $max + 1; - $data['type_activity'] = "task"; + if (!isset($data['type_activity'])) { + $data['type_activity'] = "task"; + } $parent = $data['parent_id'] ?? null; if ($parent) { From e56c4597d275da9f3d1b8c67536b20a655de0dda Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 16 Aug 2023 13:53:39 +0700 Subject: [PATCH 2/3] Fix sync report --- app/Http/Controllers/ProjectController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index e2d25ce..32eaeec 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -340,7 +340,10 @@ class ProjectController extends Controller public static function setSyncDate($activity_id, $activity, $report) { $status = AssignMaterial::select('status_activity')->where('activity_id', $activity_id)->first(); - if (isset($status->status_activity) && $status->status_activity != 'done') { + if (!isset($status->status_activity)) { + $status->status_activity = 'open'; + } + if ($status->status_activity != 'done') { $minDate = date_create($report->report_date); $maxDate = date_create($report->report_date); date_add($maxDate, date_interval_create_from_date_string($activity->duration . " days")); From c7ef95542519a74a080e3e91e3889c44af4627f5 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 16 Aug 2023 14:38:04 +0700 Subject: [PATCH 3/3] Fix period range --- app/Helpers/MasterFunctionsHelper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 0a817d5..07e2c74 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -201,7 +201,6 @@ class MasterFunctionsHelper ->max("a.planned_end"); // plan date overlapped with assign_material_to_activity's, it should be m_activity' $maxDate = max(new \DateTime($plannedMaxDate), new \DateTime($actualMaxDate)); $end = $maxDate; - $end->modify('last month'); $interval = new \DateInterval('P7D'); } $period = new \DatePeriod($begin, $interval, $end);