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); 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) { 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"));