@extends('../layout/' . $layout) @section('subhead') Atarud MIS - Charts of Accounts @endsection @section('subcontent')

Accounting Reports

@include('../pages/account/reports/sidebar')

Report Filters

Report Content

@if(isset($fromDate) && isset($toDate))
@endif
@php $income_openning = App\Models\ChartofAccount::where('account_type', '!=', 'expense') ->where("account_type", '!=','fixed assets') ->sum("openning_balance"); @endphp @if(isset($data['incomes']))

Income Reports

@php $total_income = 0; $i=0; @endphp @foreach($data['incomes'] as $row) @php $amount = App\Models\Payment::where('account_id', $row->id) ->whereBetween('timestamp', [$fromDate, $toDate]) ->sum('amount'); $total_income += $amount; @endphp @endforeach {{-- @php $total_income += $data['vouchers']; @endphp --}}
# Name Account Type Amount
{{++$i}} {{$row->name}} {{$row->account_type}} {{$amount}}
Total: {{$total_income}}
@endif @if(isset($data['expenses']))

Expenses Reports

@php $total_expense = 0; $c=0; @endphp @foreach($data['expenses'] as $row) @php $exp_amount = App\Models\Payment::where('account_id', $row->id) ->where('vochure_id', 0) ->whereBetween('timestamp', [$fromDate, $toDate]) ->sum('amount'); $total_expense += $exp_amount; @endphp @endforeach @php $total_expense += $data['vouchers']; @endphp
# Name Account Type Amount
{{++$c}} {{$row->name}} {{$row->account_type}} {{$exp_amount}}
{{ ++$c }} Voucher Expense {{$data['vouchers']}}
Total: {{$total_expense}}
@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
@endsection @section('script') @endsection