From e56c4597d275da9f3d1b8c67536b20a655de0dda Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Wed, 16 Aug 2023 13:53:39 +0700 Subject: [PATCH] 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"));