Cash Balance
BDT {{ number_format($totalCashTransaction, 2) }}
Bank Balance
BDT {{ number_format($totalBankTransaction, 2) }}
Total Balance
BDT {{ number_format($totalBankTransaction + $totalCashTransaction, 2) }}
@foreach ($allBankAccount as $account)
@php
$bankTransWithdraw = $account->bankTrans->where('transaction_type', 'withdraw')->sum('withdraw');
$bankTransDeposit = $account->bankTrans->where('transaction_type', 'deposit')->sum('deposit');
$CustomerbankTransPayment = $account->customerPayment
->where('payment_type', 'bank')
->where('transaction_type', 'payment')
->sum('amount');
$CustomerbankTransRecieve = $account->customerPayment
->where('payment_type', 'bank')
->where('transaction_type', 'recieve')
->sum('amount');
$supplierBankTransPayment = $account->supplierPayment
->where('payment_type', 'bank')
->where('transaction_type', 'payment')
->sum('amount');
$supplierBankTransRecieve = $account->supplierPayment
->where('payment_type', 'bank')
->where('transaction_type', 'recieve')
->sum('amount');
$totalCash = $bankTransDeposit + $CustomerbankTransRecieve + $supplierBankTransRecieve + $account->initial_balance - ($supplierBankTransPayment + $CustomerbankTransPayment + $bankTransWithdraw);
@endphp
{{ $account->account_name }}
{{ $account->account_number }}
{{ $account->bank_name }}
BDT {{ number_format($totalCash, 2) }}
@endforeach