|
|
@ -223,17 +223,27 @@ class MasterFunctionsHelper { |
|
|
|
->first(); |
|
|
|
->first(); |
|
|
|
$dataTempReport [$w]['percentage'] = ($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
$dataTempReport [$w]['percentage'] = ($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
// $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
// $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){ |
|
|
|
// if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){ |
|
|
|
if($checkStatusActivity->status_activity == 'done'){ |
|
|
|
if($checkStatusActivity->status_activity == 'done'){ |
|
|
|
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
$sumPercentageActual+=$keyActualM->bobot_planning; |
|
|
|
|
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
$sumPercentageActual+=(($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning)*(95/100); |
|
|
|
if($keyActualM->qty/$sumVolActual->ttl_qty_plan >= 1){ |
|
|
|
|
|
|
|
$sumPercentageActual+=(($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning)*(95/100); |
|
|
|
|
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
|
|
|
|
// $sumPercentageActual = $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// }else if($checkStatusActivity->status_activity == 'done'){ |
|
|
|
// }else { |
|
|
|
// $sumPercentageActual+=0; |
|
|
|
// if($checkStatusActivity->status_activity == 'done'){ |
|
|
|
}else{ |
|
|
|
// $sumPercentageActual+=($keyActualM->qty/$keyActualM->qty)*$keyActualM->bobot_planning; |
|
|
|
$sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
// }else{ |
|
|
|
} |
|
|
|
// $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$totalACWP += $keyActualM->biaya_actual/$keyActualM->duration; |
|
|
|
$totalACWP += $keyActualM->biaya_actual/$keyActualM->duration; |
|
|
|
} catch (\DivisionByZeroError $e) { |
|
|
|
} catch (\DivisionByZeroError $e) { |
|
|
@ -246,7 +256,7 @@ class MasterFunctionsHelper { |
|
|
|
$arr_ActualM[] = array( |
|
|
|
$arr_ActualM[] = array( |
|
|
|
'date'=>$dt->format("Y-m-d"), |
|
|
|
'date'=>$dt->format("Y-m-d"), |
|
|
|
'percentPlan'=>$sumPercentagePlan, |
|
|
|
'percentPlan'=>$sumPercentagePlan, |
|
|
|
'percentActual'=>$sumPercentageActual, |
|
|
|
'percentActual'=> $sumPercentageActual, |
|
|
|
'plan'=>$dataTempPlan, |
|
|
|
'plan'=>$dataTempPlan, |
|
|
|
'actual'=>$dataTempReport, |
|
|
|
'actual'=>$dataTempReport, |
|
|
|
); |
|
|
|
); |
|
|
@ -254,12 +264,19 @@ class MasterFunctionsHelper { |
|
|
|
$tempTtlPercentPlan+= $sumPercentagePlan; |
|
|
|
$tempTtlPercentPlan+= $sumPercentagePlan; |
|
|
|
$tempTtlPercentActual+= $sumPercentageActual; |
|
|
|
$tempTtlPercentActual+= $sumPercentageActual; |
|
|
|
|
|
|
|
|
|
|
|
if($tempTtlPercentPlan >= 100 || $tempTtlPercentActual >= 100){ |
|
|
|
// if($tempTtlPercentPlan >= 100 || $tempTtlPercentActual >= $keyGantt['progress'];){ |
|
|
|
if($tempTtlPercentActual >= 100) |
|
|
|
// if($tempTtlPercentActual >= 100) |
|
|
|
$tempTtlPercentActual = 100; |
|
|
|
// $tempTtlPercentActual = 100; |
|
|
|
|
|
|
|
// if($tempTtlPercentPlan >= 100) |
|
|
|
|
|
|
|
// $tempTtlPercentPlan = 100; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($tempTtlPercentActual >= $keyGantt['progress']) |
|
|
|
|
|
|
|
$tempTtlPercentActual = $keyGantt['progress']; |
|
|
|
if($tempTtlPercentPlan >= 100) |
|
|
|
if($tempTtlPercentPlan >= 100) |
|
|
|
$tempTtlPercentPlan = 100; |
|
|
|
$tempTtlPercentPlan = 100; |
|
|
|
} |
|
|
|
// $sumPercentageActual > $keyGantt['progress'] ? $keyGantt['progress'] : $sumPercentageActual |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
$currentACWP += $totalACWP; |
|
|
|
$currentACWP += $totalACWP; |
|
|
|
$currentBCWP += $totalBCWP; |
|
|
|
$currentBCWP += $totalBCWP; |
|
|
@ -304,8 +321,8 @@ class MasterFunctionsHelper { |
|
|
|
$dataResponse = array( |
|
|
|
$dataResponse = array( |
|
|
|
"date" =>$tempDate, |
|
|
|
"date" =>$tempDate, |
|
|
|
"percentage" =>$tempPercentage, |
|
|
|
"percentage" =>$tempPercentage, |
|
|
|
"percentagePlan" => $tempPercentagePlan, |
|
|
|
"percentagePlan" => $tempPercentagePlan, |
|
|
|
"percentageReal" => $tempPercentageReal, |
|
|
|
"percentageReal" => $tempPercentageReal, |
|
|
|
"data_details" =>$arr_ActualM, |
|
|
|
"data_details" =>$arr_ActualM, |
|
|
|
"budget_control" =>array("current_budget"=> $totalRencanaBudget, |
|
|
|
"budget_control" =>array("current_budget"=> $totalRencanaBudget, |
|
|
|
"acwp" => round($totalACWP,0), |
|
|
|
"acwp" => round($totalACWP,0), |
|
|
|