update grafik revenuw di dashboard
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m58s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 42s
Build, Push and Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-23 22:28:02 +07:00
parent f2cd16a2a8
commit f25542ea0d

View File

@@ -196,7 +196,7 @@ public function revenue()
$data['loss'] = Sale::where('business_id', auth()->user()->business_id) $data['loss'] = Sale::where('business_id', auth()->user()->business_id)
->whereYear('created_at', request('year') ?? date('Y')) ->whereYear('created_at', request('year') ?? date('Y'))
->where('lossProfit', '<', 0) ->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') ->orderBy('created_at')
->groupBy('created_at') ->groupBy('created_at')
->get(); ->get();
@@ -204,7 +204,7 @@ public function revenue()
$data['profit'] = Sale::where('business_id', auth()->user()->business_id) $data['profit'] = Sale::where('business_id', auth()->user()->business_id)
->whereYear('created_at', request('year') ?? date('Y')) ->whereYear('created_at', request('year') ?? date('Y'))
->where('lossProfit', '>=', 0) ->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') ->orderBy('created_at')
->groupBy('created_at') ->groupBy('created_at')
->get(); ->get();