From f25542ea0d24fc0ac3310043843003e8dfd67387 Mon Sep 17 00:00:00 2001 From: eko54r Date: Thu, 23 Apr 2026 22:28:02 +0700 Subject: [PATCH] update grafik revenuw di dashboard --- Modules/Business/App/Http/Controllers/DashboardController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Business/App/Http/Controllers/DashboardController.php b/Modules/Business/App/Http/Controllers/DashboardController.php index e6a10824..861c5e6f 100644 --- a/Modules/Business/App/Http/Controllers/DashboardController.php +++ b/Modules/Business/App/Http/Controllers/DashboardController.php @@ -196,7 +196,7 @@ public function revenue() $data['loss'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '<', 0) - ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") + ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(\"lossProfit\")) as total") ->orderBy('created_at') ->groupBy('created_at') ->get(); @@ -204,7 +204,7 @@ public function revenue() $data['profit'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '>=', 0) - ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") + ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(\"lossProfit\")) as total") ->orderBy('created_at') ->groupBy('created_at') ->get();