Browse Source

Merge pull request 'dev-wahyu' (#306) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#306
pull/1/head
farhantock 11 months ago
parent
commit
95be6d8769
  1. 8
      app/Helpers/MasterFunctionsHelper.php
  2. 4
      app/Http/Controllers/ProjectController.php

8
app/Helpers/MasterFunctionsHelper.php

@ -560,15 +560,13 @@ class MasterFunctionsHelper
// if (new \DateTime($loopDay) < $today) { // if (new \DateTime($loopDay) < $today) {
// $statusCutOfDate = true; // $statusCutOfDate = true;
// } // }
if (new \DateTime($loopDay) == new \DateTime($loopDay . ' Friday')) {
$progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek, 2); $progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek,2);
if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) { if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) {
// $tempPercentageReal[] = round($tempTtlPercentActual, 2); // $tempPercentageReal[] = round($tempTtlPercentActual, 2);
$progressActualKomulatifWeek[] += round($tmpProgressActualWeek, 2); $progressActualKomulatifWeek[] += round($tmpProgressActualWeek, 2);
} }
$dateWeek[] = [$loopDay]; $dateWeek[] = [$loopDay];
}
// $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek; // $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek;
foreach ($dataPlanM as $keyPlanM) { foreach ($dataPlanM as $keyPlanM) {
# hitung untuk persentase progress planning # hitung untuk persentase progress planning
@ -1442,15 +1440,13 @@ class MasterFunctionsHelper
$dataActivityPlan = []; $dataActivityPlan = [];
$dataActivityActual = []; $dataActivityActual = [];
$today = date('Y-m-d'); $today = date('Y-m-d');
if (new \DateTime($loopDay) == new \DateTime($loopDay . ' Friday')) {
$progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek, 2); $progressPlanKomulatifWeek[] += round($tmpProgressPlanWeek,2);
if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) { if (new \DateTime($loopDay . ' Friday') <= new \DateTime($today . ' Friday')) {
// $tempPercentageReal[] = round($tempTtlPercentActual, 2); // $tempPercentageReal[] = round($tempTtlPercentActual, 2);
$progressActualKomulatifWeek[] += round($tmpProgressActualWeek, 2); $progressActualKomulatifWeek[] += round($tmpProgressActualWeek, 2);
} }
$dateWeek[] = [$loopDay]; $dateWeek[] = [$loopDay];
}
// $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek; // $progressPlanKomulatifWeek[] += $tmpProgressPlanWeek;
// if (count($dataPlanM) > 0 && count($dataPlanM[0]) > 0) { // if (count($dataPlanM) > 0 && count($dataPlanM[0]) > 0) {
foreach ($dataPlanM as $keyPlanM) { foreach ($dataPlanM as $keyPlanM) {

4
app/Http/Controllers/ProjectController.php

@ -626,11 +626,13 @@ class ProjectController extends Controller
$plannedEnd = Activity::where('version_gantt_id', $ganttId) $plannedEnd = Activity::where('version_gantt_id', $ganttId)
->orderByDesc('planned_end') ->orderByDesc('planned_end')
->value('planned_end'); ->value('planned_end');
if (isset($result->header)) {
$result->header->start_date = $startDate; $result->header->start_date = $startDate;
$result->header->end_date = $maxEndDate->end_date; $result->header->end_date = $maxEndDate->end_date;
$result->header->planned_start = $plannedStart; $result->header->planned_start = $plannedStart;
$result->header->planned_end = $plannedEnd; $result->header->planned_end = $plannedEnd;
return response()->json(['status' => 'success', 'code' => 200, 'data' => $result, 'gantt' => $ganttId], 200); }
return response()->json(['status'=>'success','code'=> 200,'data'=>$result, 'gantt'=>$ganttId], 200);
} }
public function getOverdueActivities(Request $request) public function getOverdueActivities(Request $request)

Loading…
Cancel
Save