|
|
@ -36,7 +36,8 @@ class MasterFunctionsHelper |
|
|
|
return json_decode($output); |
|
|
|
return json_decode($output); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function countDays($ganttId, $start, $end){ |
|
|
|
public static function countDays($ganttId, $start, $end) |
|
|
|
|
|
|
|
{ |
|
|
|
$dayOffs = VersionGantt::where('id', $ganttId)->first()->config_dayoff; |
|
|
|
$dayOffs = VersionGantt::where('id', $ganttId)->first()->config_dayoff; |
|
|
|
$diff = date_diff($start, $end); |
|
|
|
$diff = date_diff($start, $end); |
|
|
|
$endCount = clone $end; |
|
|
|
$endCount = clone $end; |
|
|
@ -206,7 +207,7 @@ class MasterFunctionsHelper |
|
|
|
$end = new \DateTime($maxDate . ' Friday'); |
|
|
|
$end = new \DateTime($maxDate . ' Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */// should be using this but its bugged |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */ // should be using this but its bugged |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$actualMaxDate = DB::table('assign_material_to_activity as ama') |
|
|
|
$actualMaxDate = DB::table('assign_material_to_activity as ama') |
|
|
@ -514,7 +515,7 @@ class MasterFunctionsHelper |
|
|
|
$end = new \DateTime($maxDate); |
|
|
|
$end = new \DateTime($maxDate); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
$end->modify('next Friday'); |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */// should be using this but its bugged |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */ // should be using this but its bugged |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// $maxDate = DB::table('assign_material_to_activity as ama') |
|
|
|
// $maxDate = DB::table('assign_material_to_activity as ama') |
|
|
@ -673,7 +674,7 @@ class MasterFunctionsHelper |
|
|
|
$sumPercentageActual += $keyActualM->bobot_planning / $reportCount; |
|
|
|
$sumPercentageActual += $keyActualM->bobot_planning / $reportCount; |
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if ( $actual >= 1 || (int) $sumVolActual->ttl_qty_plan == (int) $sumReportActual) { |
|
|
|
if ($actual >= 1 || (int) $sumVolActual->ttl_qty_plan == (int) $sumReportActual) { |
|
|
|
$sumPercentageActual += ($actual * $keyActualM->bobot_planning) * (95 / 100); |
|
|
|
$sumPercentageActual += ($actual * $keyActualM->bobot_planning) * (95 / 100); |
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -712,9 +713,6 @@ class MasterFunctionsHelper |
|
|
|
// if ($tempTtlPercentPlan >= 100) |
|
|
|
// if ($tempTtlPercentPlan >= 100) |
|
|
|
// $tempTtlPercentPlan = 100; |
|
|
|
// $tempTtlPercentPlan = 100; |
|
|
|
|
|
|
|
|
|
|
|
if ($tempTtlPercentPlan >= 100) |
|
|
|
|
|
|
|
$tempTtlPercentPlan = 100; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$currentACWP += $totalACWP; |
|
|
|
$currentACWP += $totalACWP; |
|
|
|
$currentBCWP += $totalBCWP; |
|
|
|
$currentBCWP += $totalBCWP; |
|
|
|
|
|
|
|
|
|
|
@ -820,7 +818,7 @@ class MasterFunctionsHelper |
|
|
|
if (isset($dataPayload['end_date'])) { |
|
|
|
if (isset($dataPayload['end_date'])) { |
|
|
|
$maxDate = $dataPayload['end_date']; |
|
|
|
$maxDate = $dataPayload['end_date']; |
|
|
|
$end = new \DateTime($maxDate); |
|
|
|
$end = new \DateTime($maxDate); |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */// should be using this but its bugged |
|
|
|
/* $interval = \DateInterval::createFromDateString('1 day'); */ // should be using this but its bugged |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
$interval = new \DateInterval('P7D'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// $maxDate = DB::table('assign_material_to_activity as ama') |
|
|
|
// $maxDate = DB::table('assign_material_to_activity as ama') |
|
|
@ -1009,5 +1007,4 @@ class MasterFunctionsHelper |
|
|
|
|
|
|
|
|
|
|
|
return $dataFinal; |
|
|
|
return $dataFinal; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|