Browse Source

Merge pull request 'staging' (#258) from staging into master

Reviewed-on: ordo/adw-backend#258
pull/1/head
ibnu 1 year ago
parent
commit
6fb409a864
  1. 8
      app/Helpers/MasterFunctionsHelper.php

8
app/Helpers/MasterFunctionsHelper.php

@ -739,6 +739,8 @@ class MasterFunctionsHelper
'plan' => $dataTempPlan,
'actual' => $dataTempReport,
);
$today = new DateTime();
$date = new DateTime($dt->format("Y-m-d"));
if (isset($dataPayload['period']) && $dataPayload['period'] == 'week') {
$tempTtlPercentPlan += $sumPercentagePlan;
$tempTtlPercentActual += $sumPercentageActual;
@ -749,16 +751,20 @@ class MasterFunctionsHelper
$tempPercentage[] = array(round($tempTtlPercentPlan, 2), round($tempTtlPercentActual, 2));
$tempPercentagePlan[] = round($tempTtlPercentPlan, 2);
$tempPercentagePlanWhr[] = ["weekly period", $tempPercentagePlan];
if ($date < $today) {
$tempPercentageReal[] = round($tempTtlPercentActual, 2);
}
if ($tempTtlPercentPlan >= 100 && $tempTtlPercentActual >= 100) {
break;
}
} else {
$tempPercentage[] = array(round($sumPercentagePlan, 2), round($sumPercentageActual, 2));
$tempPercentagePlan[] = round($sumPercentagePlan, 2);
if ($date < $today) {
$tempPercentageReal[] = round($sumPercentageActual, 2);
}
}
}
try {
if (round($totalACWP, 0) > $totalRencanaBudget) {
@ -783,8 +789,6 @@ class MasterFunctionsHelper
}
$lastReal = $tempPercentageReal[count($tempPercentageReal) - 1];
$totalBCWP = $lastReal * $dataProject->rencana_biaya / 100;
array_pop($tempPercentageReal);
array_pop($tempPercentageReal);
$dataResponse = array(
"date" => $tempDate,
"percentage" => $tempPercentage,

Loading…
Cancel
Save