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)}` },