From 348e56c7986c0ce3ba7a5bc29a20b8088986d6ab Mon Sep 17 00:00:00 2001 From: Muhammad Sulaiman Yusuf Date: Wed, 19 Oct 2022 14:40:51 +0700 Subject: [PATCH] bugfix --- app/Http/Controllers/DashboardBoDController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/DashboardBoDController.php b/app/Http/Controllers/DashboardBoDController.php index 4cebea1..85c5eb3 100644 --- a/app/Http/Controllers/DashboardBoDController.php +++ b/app/Http/Controllers/DashboardBoDController.php @@ -386,7 +386,7 @@ class DashboardBoDController extends Controller ->groupBy('activity_id') ->first(); try { - $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan)*$keyActualM->bobot_planning; + $sumPercentageActual+=($keyActualM->qty/$sumVolActual->ttl_qty_plan ?? 0)*$keyActualM->bobot_planning; } catch (\DivisionByZeroError $e) { return response()->json(['message' => $e->getMessage()]); }