| Opening Balance |
|
| Bank Accounts |
00.00 |
@foreach ($bankAccounts as $accounts)
@php
$initialBlance = 0;
if ($accounts->initial_balance) {
$initialBlance = $accounts->initial_balance;
}
$deposit = $accounts->bankTrans
->where('transaction_type', 'deposit')
->whereBetween('transaction_date', [$from_date, $date_to])
->sum('deposit');
$customerReceived = $accounts->customerPayment
->where('transaction_type', 'receive')
->whereBetween('date', [$from_date, $date_to])
->sum('amount');
$supplierReceived = $accounts->supplierPayment
->where('transaction_type', 'receive')
->whereBetween('date', [$from_date, $date_to])
->sum('amount');
$withdraw = $accounts->bankTrans
->where('transaction_type', 'withdraw')
->whereBetween('transaction_date', [$from_date, $date_to])
->sum('withdraw');
$customerPayment = $accounts->customerPayment
->where('transaction_type', 'payment')
->whereBetween('date', [$from_date, $date_to])
->sum('amount');
$supplierPayment = $accounts->supplierPayment
->where('transaction_type', 'payment')
->whereBetween('date', [$from_date, $date_to])
->sum('amount');
$totalIn = $deposit + $customerReceived + $supplierReceived + $initialBlance - ($withdraw + $customerPayment + $supplierPayment);
@endphp
| {{ $accounts->bank_name }} {{ $accounts->account_name }}
{{ $accounts->account_number }} |
{{ number_format($totalIn, 2) }} |
@endforeach
| Cash in Hand |
{{ $cashInHand }} |
| Cash |
{{ $cashInHand }} |
| Receipt |
|
@if (count($sales) > 0)
| Sales |
{{ number_format($sales->sum('total_paid'), 2) }} |
@endif
@foreach ($sales as $sale)
| {{ $sale->customer->customer_name }} |
{{ number_format($sale->total_paid, 2) }} |
@endforeach
@if (count($customerTrans->where('transaction_type', 'receive')) > 0)
| Customer Payment |
{{ number_format($customerTrans->where('transaction_type', 'receive')->sum('amount'), 2) }}
|
@endif
@foreach ($customerTrans->where('transaction_type', 'receive') as $customerTran)
| {{ $customerTran->customer->customer_name }} |
{{ number_format($customerTran->amount, 2) }} |
@endforeach
@if (count($customerTrans->where('transaction_type', 'receive')) > 0)
| Bank Deposits (Not Calculated)
|
{{ number_format($customerTrans->where('transaction_type', 'receive')->sum('amount'), 2) }}
|
@endif
@foreach ($customerTrans->where('transaction_type', 'receive') as $customerTran)
| {{ $customerTran->customer->customer_name }} |
{{ number_format($customerTran->amount, 2) }} |
@endforeach