diff --git a/app/Http/Controllers/Reports/OutstandingController.php b/app/Http/Controllers/Reports/OutstandingController.php index 8043739..7e70c3e 100644 --- a/app/Http/Controllers/Reports/OutstandingController.php +++ b/app/Http/Controllers/Reports/OutstandingController.php @@ -127,10 +127,12 @@ class OutstandingController extends Controller if (!empty($endDate)) { $queryAll->where('tarikh', '=', $endDate); } - - return array_merge( - $queryAll->first()->toArray() - ); + $record = $queryAll->first(); + + return $record + ? $record->toArray() + : ['bakieod' => 0]; + }, $active_cawangan_db_connection); // Combine data with branch info