From 0c487fc05b2d731bb4400d90c717956ddd3cc168 Mon Sep 17 00:00:00 2001 From: wahyu Date: Tue, 24 Oct 2023 15:50:55 +0700 Subject: [PATCH] handling plan overflow --- app/Helpers/MasterFunctionsHelper.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 1bed1bb..add9de1 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -708,6 +708,9 @@ class MasterFunctionsHelper $tempTtlPercentPlan += $sumPercentagePlan; $tempTtlPercentActual += $sumPercentageActual; + if ($tempTtlPercentPlan >= 100) + $tempTtlPercentPlan = 100; + $currentACWP += $totalACWP; $currentBCWP += $totalBCWP; @@ -715,6 +718,9 @@ class MasterFunctionsHelper $tempPercentagePlan[] = round($tempTtlPercentPlan, 2); $tempPercentagePlanWhr[] = ["weekly period", $tempPercentagePlan]; $tempPercentageReal[] = round($tempTtlPercentActual, 2); + if ($tempTtlPercentPlan >= 100 && $tempTtlPercentActual >= 100) { + break; + } } else { $tempPercentage[] = array(round($sumPercentagePlan, 2), round($sumPercentageActual, 2)); $tempPercentagePlan[] = round($sumPercentagePlan, 2);