Browse Source

s-curve iterate breaker

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
976c4ae778
  1. 15
      app/Http/Controllers/ProjectController.php

15
app/Http/Controllers/ProjectController.php

@ -355,6 +355,9 @@ class ProjectController extends Controller
foreach ($allGantt as $keyGantt) { foreach ($allGantt as $keyGantt) {
$dataProject = Project::find($keyGantt['proyek_id']); $dataProject = Project::find($keyGantt['proyek_id']);
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first(); $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first();
if(isset($dataPayload['end_date']) && $dataPayload['end_date'] > $dataProject->akhir_proyek){
$dataPayload['end_date'] = $dataProject->akhir_proyek;
}
if($dataHeader){ if($dataHeader){
$totalRencanaBudget = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya"); $totalRencanaBudget = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya");
@ -501,6 +504,14 @@ class ProjectController extends Controller
if(isset($dataPayload['period']) && $dataPayload['period'] == 'week'){ if(isset($dataPayload['period']) && $dataPayload['period'] == 'week'){
$tempTtlPercentPlan+= $sumPercentagePlan; $tempTtlPercentPlan+= $sumPercentagePlan;
$tempTtlPercentActual+= $sumPercentageActual; $tempTtlPercentActual+= $sumPercentageActual;
if($tempTtlPercentPlan >= 100 || $tempTtlPercentActual >= 100){
if($tempTtlPercentActual >= 100)
$tempTtlPercentActual = 100;
if($tempTtlPercentPlan >= 100)
$tempTtlPercentPlan = 100;
}
$currentACWP += $totalACWP; $currentACWP += $totalACWP;
$currentBCWP += $totalBCWP; $currentBCWP += $totalBCWP;
@ -508,6 +519,9 @@ class ProjectController extends Controller
$tempPercentagePlan[] = round($tempTtlPercentPlan, 2); $tempPercentagePlan[] = round($tempTtlPercentPlan, 2);
$tempPercentagePlanWhr[] = ["weekly period", $tempPercentagePlan]; $tempPercentagePlanWhr[] = ["weekly period", $tempPercentagePlan];
$tempPercentageReal[] = round($tempTtlPercentActual, 2); $tempPercentageReal[] = round($tempTtlPercentActual, 2);
if($tempTtlPercentPlan >= 100 && $tempTtlPercentActual >= 100){
break;
}
}else{ }else{
$tempPercentage[] = array(round($sumPercentagePlan,2), round($sumPercentageActual,2)); $tempPercentage[] = array(round($sumPercentagePlan,2), round($sumPercentageActual,2));
$tempPercentagePlan[] = round($sumPercentagePlan, 2); $tempPercentagePlan[] = round($sumPercentagePlan, 2);
@ -517,7 +531,6 @@ class ProjectController extends Controller
} }
/* print_r($tempDate); exit(); */ /* print_r($tempDate); exit(); */
try { try {
if(round($totalACWP,0) > $totalRencanaBudget){ if(round($totalACWP,0) > $totalRencanaBudget){
$estimatedCost = round($totalACWP,0)+0; $estimatedCost = round($totalACWP,0)+0;

Loading…
Cancel
Save