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

Loading…
Cancel
Save