Browse Source

disable some calc

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
a58c43dfdc
  1. 48
      app/Http/Controllers/ProjectController.php

48
app/Http/Controllers/ProjectController.php

@ -531,27 +531,27 @@ 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; */
}else{ /* }else{ */
$estimatedCost = ($totalRencanaBudget+0); /* $estimatedCost = ($totalRencanaBudget+0); */
} /* } */
} catch (\DivisionByZeroError $e) { /* } catch (\DivisionByZeroError $e) { */
return response()->json([ /* return response()->json([ */
'message' => $e->getMessage(), /* 'message' => $e->getMessage(), */
"line" => 566, /* "line" => 566, */
'gantt' => $keyGantt, /* 'gantt' => $keyGantt, */
]); /* ]); */
} /* } */
$estimatedCost = $totalACWP > $totalRencanaBudget ? $totalACWP : $totalRencanaBudget; /* $estimatedCost = $totalACWP > $totalRencanaBudget ? $totalACWP : $totalRencanaBudget; */
$costDeviation = $totalRencanaBudget - $estimatedCost; /* $costDeviation = $totalRencanaBudget - $estimatedCost; */
if($costDeviation > 0){ /* if($costDeviation > 0){ */
$potential = "SAVING"; /* $potential = "SAVING"; */
} else { /* } else { */
$potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN"; /* $potential = $costDeviation == 0 ? "ON BUDGET" : "OVERRUN"; */
} /* } */
$dataResponse = array( $dataResponse = array(
"date" =>$tempDate, "date" =>$tempDate,
@ -564,9 +564,9 @@ class ProjectController extends Controller
"bcwp" => round($totalBCWP,0), "bcwp" => round($totalBCWP,0),
"rem_to_complete" => ($totalRencanaBudget - round($totalACWP,0)), "rem_to_complete" => ($totalRencanaBudget - round($totalACWP,0)),
"add_cost_to_complete" => 0, "add_cost_to_complete" => 0,
"estimated_at_completion" => $estimatedCost, /* "estimated_at_completion" => $estimatedCost, */
"cost_deviation" => $costDeviation, /* "cost_deviation" => $costDeviation, */
"potential" => $potential, /* "potential" => $potential, */
) )
); );

Loading…
Cancel
Save