From 95b78bda1d61ce0a6afc95b1e38771ebafb21917 Mon Sep 17 00:00:00 2001 From: wahyu Date: Mon, 23 Oct 2023 14:28:21 +0700 Subject: [PATCH] zero division handling --- app/Helpers/MasterFunctionsHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/MasterFunctionsHelper.php b/app/Helpers/MasterFunctionsHelper.php index 20ca4fb..1bed1bb 100644 --- a/app/Helpers/MasterFunctionsHelper.php +++ b/app/Helpers/MasterFunctionsHelper.php @@ -375,7 +375,7 @@ class MasterFunctionsHelper // } - $totalACWP += $keyActualM->biaya_actual / $keyActualM->duration; + $totalACWP += $keyActualM->duration > 0 ? $keyActualM->biaya_actual / $keyActualM->duration : 0; } catch (\DivisionByZeroError $e) { return response()->json(['message' => $e->getMessage()]); }