@php ini_set('memory_limit', '44M'); $total_income = 0;$total_expense = 0; @endphp
Report
@if(isset($data['incomes']))
@php
$count = 0;
@endphp
# |
Name |
Account Type |
Amount |
@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
{{++$count}} |
{{$row->name}} |
{{$row->account_type}} |
{{$amount}} |
@endforeach
Total: {{$total}} |
@endif
@if(isset($data['expenses']))
@php
$count = 0;
@endphp
# |
Name |
Account Type |
Amount |
@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
{{++$c}} |
{{$row->name}} |
{{$row->account_type}} |
{{$amount}} |
@endforeach
{{++$c}} |
Voucher |
Expense |
{{$data['vouchers']}} |
@php $total += $data['vouchers']; $total_expense += $data['vouchers']; @endphp
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