Browse Source

Merge pull request 'update curva' (#254) from dev-ibnu into staging

Reviewed-on: ordo/adw-backend#254
pull/3/head
farhantock 1 year ago
parent
commit
92e226d330
  1. 30
      app/Helpers/MasterFunctionsHelper.php

30
app/Helpers/MasterFunctionsHelper.php

@ -932,7 +932,7 @@ class MasterFunctionsHelper
->groupBy('activity_id') ->groupBy('activity_id')
->first(); ->first();
$weekCount = $keyPlanM->duration / $keyPlanM->duration; // jadiin perhari (1) $weekCount = 1; // jadiin perhari (1)
$weeklyPlan = $sumVolPlan->ttl_qty_plan / $weekCount; $weeklyPlan = $sumVolPlan->ttl_qty_plan / $weekCount;
$weeklyProgress = $weeklyPlan / $sumVolPlan->ttl_qty_plan * $keyPlanM->bobot_planning; $weeklyProgress = $weeklyPlan / $sumVolPlan->ttl_qty_plan * $keyPlanM->bobot_planning;
@ -1056,9 +1056,9 @@ class MasterFunctionsHelper
$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) { // if ($tempTtlPercentPlan >= 100 && $tempTtlPercentActual >= 100) {
break; // 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);
@ -1092,20 +1092,22 @@ class MasterFunctionsHelper
$totalBCWP = $lastReal * $dataProject->rencana_biaya / 100; $totalBCWP = $lastReal * $dataProject->rencana_biaya / 100;
$dataResponse = array( $dataResponse = array(
"date" => $tempDate, "date" => $tempDate,
"start" => $begin,
"end" => $end,
"percentage" => $tempPercentage, "percentage" => $tempPercentage,
"percentagePlan" => $tempPercentagePlan, "percentagePlan" => $tempPercentagePlan,
"percentageReal" => $tempPercentageReal, "percentageReal" => $tempPercentageReal,
"data_details" => $arr_ActualM, "data_details" => $arr_ActualM,
"budget_control" => array( // "budget_control" => array(
"current_budget" => $totalRencanaBudget, // "current_budget" => $totalRencanaBudget,
"acwp" => round($totalACWP, 0), // "acwp" => round($totalACWP, 0),
"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,
) // )
); );
$dataFinal[] = array( $dataFinal[] = array(

Loading…
Cancel
Save