Browse Source

Fix progress

pull/3/head
Wahyu Ramadhan 1 year ago
parent
commit
39a8fd6b40
  1. 12
      app/Helpers/MasterFunctionsHelper.php

12
app/Helpers/MasterFunctionsHelper.php

@ -99,11 +99,8 @@ class MasterFunctionsHelper {
$maxDate = Project::select('akhir_proyek')->where('id', $request->project_id)->first();
$begin = new \DateTime($minDate->mulai_proyek. ' Monday');
$begin->modify('last Monday');
$end = new \DateTime($maxDate->akhir_proyek. ' Friday');
$end->modify('next Friday');
$end->modify('next Friday');
$interval = new \DateInterval('P7D');
@ -118,13 +115,14 @@ class MasterFunctionsHelper {
$dates = [];
$tempProgress = 0;
$tempPlanning = 0;
array_push($progressData, round($tempProgress, 2));
array_push($planningData, round($tempPlanning, 2));
foreach($period as $p){
array_push($progressData, $tempProgress);
array_push($planningData, $tempPlanning);
array_push($dates, $p->format("Y-m-d"));
$tempProgress += $avgProgress;
$tempPlanning += $avgPlanning;
array_push($progressData, round($tempProgress, 2));
array_push($planningData, round($tempPlanning, 2));
array_push($dates, $p->format("Y-m-d"));
}
$dataResponse = array(

Loading…
Cancel
Save