feat: update cash overview to use cash account balance and add description for clarity
This commit is contained in:
parent
cd944403bd
commit
9fead3dfa9
@ -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,
|
||||
|
||||
@ -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)}` },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user