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. 24
      app/Http/Controllers/ProjectController.php

8
app/Helpers/MasterFunctionsHelper.php

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

24
app/Http/Controllers/ProjectController.php

@ -620,17 +620,19 @@ class ProjectController extends Controller
// }
$plannedStart = Activity::where('version_gantt_id', $ganttId)
->orderBy('planned_start')
->value('planned_start');
$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;
return response()->json(['status' => 'success', 'code' => 200, 'data' => $result, 'gantt' => $ganttId], 200);
$plannedStart = Activity::where('version_gantt_id', $ganttId)
->orderBy('planned_start')
->value('planned_start');
$plannedEnd = Activity::where('version_gantt_id', $ganttId)
->orderByDesc('planned_end')
->value('planned_end');
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);
}
public function getOverdueActivities(Request $request)

Loading…
Cancel
Save