From 20326961e36d5204f38f0594d92b29b877affbbd Mon Sep 17 00:00:00 2001 From: wahyu Date: Fri, 22 Dec 2023 11:07:02 +0700 Subject: [PATCH 1/2] fix open scurve error --- app/Http/Controllers/ProjectController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 104b128..b4d963d 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -581,10 +581,12 @@ class ProjectController extends Controller $plannedEnd = Activity::where('version_gantt_id', $ganttId) ->orderByDesc('planned_end') ->value('planned_end'); - $result->header->start_date = $startDate; - $result->header->end_date = $maxEndDate->end_date; - $result->header->planned_start = $plannedStart; - $result->header->planned_end = $plannedEnd; + if (isset($result->header)) { + $result->header->start_date = $startDate; + $result->header->end_date = $maxEndDate->end_date; + $result->header->planned_start = $plannedStart; + $result->header->planned_end = $plannedEnd; + } return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$ganttId], 200); } From d87899eddad4c84c02a9a180a86f0a8c6af5a15a Mon Sep 17 00:00:00 2001 From: wahyu Date: Wed, 27 Dec 2023 10:49:59 +0700 Subject: [PATCH 2/2] scurve daily --- app/Helpers/MasterFunctionsHelper.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index b2ff5f7..be83cf1 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -556,7 +556,6 @@ class MasterFunctionsHelper // if (new \DateTime($loopDay) < $today) { // $statusCutOfDate = true; // } - if (new \DateTime($loopDay) == new \DateTime($loopDay . ' Friday')){ $progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek,2); if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) { @@ -564,7 +563,6 @@ class MasterFunctionsHelper $progressActualKomulatifWeek[] += round($tmpProgressActualWeek,2); } $dateWeek[] = [$loopDay]; - } // $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek; foreach ($dataPlanM as $keyPlanM) { # hitung untuk persentase progress planning @@ -1436,7 +1434,6 @@ class MasterFunctionsHelper $dataActivityPlan = []; $dataActivityActual = []; $today = date('Y-m-d'); - if (new \DateTime($loopDay) == new \DateTime($loopDay . ' Friday')){ $progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek,2); if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) { @@ -1444,7 +1441,6 @@ class MasterFunctionsHelper $progressActualKomulatifWeek[] += round($tmpProgressActualWeek,2); } $dateWeek[] = [$loopDay]; - } // $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek; // if (count($dataPlanM) > 0 && count($dataPlanM[0]) > 0) { foreach ($dataPlanM as $keyPlanM) {