@php ini_set('memory_limit', '44M'); $total_income = 0;$total_expense = 0; @endphp

Report

@if(isset($data['incomes'])) @php $count = 0; @endphp @php $total = 0; @endphp @foreach($data['incomes'] as $row) @php $amount = App\Models\Payment::where('account_id', $row->id) ->whereBetween('timestamp', [$fromDate, $toDate]) ->sum('amount'); $total += $amount; $total_income += $amount; @endphp @endforeach
# Name Account Type Amount
{{++$count}} {{$row->name}} {{$row->account_type}} {{$amount}}
Total: {{$total}}
@endif @if(isset($data['expenses'])) @php $count = 0; @endphp @php $total = 0; $c=0; @endphp @foreach($data['expenses'] as $row) @php // dd($row->id); $amount = App\Models\Payment::where('account_id', $row->id) ->where('vochure_id', 0) ->whereBetween('timestamp', [$fromDate, $toDate]) ->sum('amount'); $total += $amount; $total_expense += $amount; @endphp @endforeach @php $total += $data['vouchers']; $total_expense += $data['vouchers']; @endphp
# Name Account Type Amount
{{++$c}} {{$row->name}} {{$row->account_type}} {{$amount}}
{{++$c}} Voucher Expense {{$data['vouchers']}}
Total: {{$total}}
@php $totalBalance = ($total_income + $income_openning - $total_expense); @endphp
Starting Balance {{$income_openning}}
Today's Revenue {{ $total_income}}
Today's Expenses {{ $total_expense }}
Today's Balance {{$totalBalance}}
Closing Balance {{ ($totalBalance) }}
@endif