From 9fead3dfa94fc25c03d8c697af64ccb91cf76f9e Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Wed, 19 Aug 2026 20:19:09 +0700 Subject: [PATCH] feat: update cash overview to use cash account balance and add description for clarity --- app/Services/AnalysisService.php | 2 +- resources/js/pages/admin/analysis/index.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/AnalysisService.php b/app/Services/AnalysisService.php index 433c4fa..8d947f8 100644 --- a/app/Services/AnalysisService.php +++ b/app/Services/AnalysisService.php @@ -199,7 +199,7 @@ public function getCashOverview(?string $startDate, ?string $endDate): array $totalWithdrawal = (clone $transactions)->where('type', CashTransactionType::WITHDRAWAL)->sum('amount'); return [ - 'total_balance' => (int) $totalDeposit - (int) $totalWithdrawal, + 'total_balance' => (int) $cashAccount->balance, 'total_transactions' => (clone $transactions)->count(), 'total_deposit' => (int) $totalDeposit, 'total_withdrawal' => (int) $totalWithdrawal, diff --git a/resources/js/pages/admin/analysis/index.tsx b/resources/js/pages/admin/analysis/index.tsx index f56addf..d4deddb 100644 --- a/resources/js/pages/admin/analysis/index.tsx +++ b/resources/js/pages/admin/analysis/index.tsx @@ -645,6 +645,7 @@ export default function Analysis({ mainLabel="Total Saldo" mainValue={`Rp${formatRupiah(cashOverview.total_balance)}`} subLabel={`${cashOverview.total_transactions} transaksi`} + description="Tidak terpengaruh filter tanggal" items={[ { label: 'Deposit', value: `Rp${formatRupiah(cashOverview.total_deposit)}` }, { label: 'Withdrawal', value: `Rp${formatRupiah(cashOverview.total_withdrawal)}` },