feat: update cash overview to use cash account balance and add description for clarity

This commit is contained in:
Yoga Pangestu 2026-08-19 20:19:09 +07:00
parent cd944403bd
commit 9fead3dfa9
2 changed files with 2 additions and 1 deletions

View File

@ -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,

View File

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