@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"); $student_income_total = 0; $shared_total = 0; @endphp @if(isset($studentRevenues))

Student Incomes

@foreach($studentRevenues as $row) @php $student = App\Models\Student::where('id', $row->student_id)->first(); $course = App\Models\Course::where('id', $row->section_id)->first(); $courseName = $course != null ? $course->title : ''; $stName = $student != null ? $student->name : ''; $fName = $student != null ? $student->father_name : ''; $totalStudentRevenue = $row->payment + $row->admission_fee + $row->material_fees + $row->exam_fee; $student_income_total += $totalStudentRevenue; @endphp @endforeach
# Slip# Name F/Name Course Admission Exam Monthly Fee Material Fee Total Status
{{++$loop->index}} {{$row->id}} {{$stName}} {{$fName}} {{$courseName}} {{$row->admission_fee}} {{$row->exam_fee}} {{$row->payment}} {{$row->material_fees}} {{$totalStudentRevenue}} {{$row->fees_payment}}
Total: {{$student_income_total}}


@endif @php $other_opennings = 0; @endphp @if(isset($data['incomeTransactions']))

Other Incomes

@php $other_income_total = 0; @endphp @foreach($data['incomeTransactions'] as $row) @php $account = App\Models\ChartofAccount::where('id', $row->account_id)->first(); $other_income_total += $row->amount; @endphp @endforeach
# Category Title Description Date Amount
{{++$loop->index}} {{$account->name}} {{$row->title}} {{$row->description}} {{$row->timestamp}} {{$row->amount}}
Total: {{$other_income_total}}


@endif @if(isset($data['salaryTransactions']))

Receipt Expense

{{--

asdfasdf

--}} {{-- --}} @php $salary_total = 0; @endphp @foreach($data['salaryTransactions'] as $row) @php $emp = App\Models\Employee::where('id', $row->employee_id)->first(); $teacher = App\Models\Teacher::where('id', $row->teacher_id)->first(); $account = App\Models\ChartofAccount::where('id', $row->account_id)->first(); $salary_total += $row->amount; $name = $emp != null ? $emp->emp_fname : $teacher->name; $fname = $emp != null ? $emp->emp_father_name : $teacher->name; $job = $emp != null ? $emp->emp_job : 'Teacher'; @endphp @endforeach
#Slip#Name F/Name Position Amount Notes Date
{{++$loop->index}} {{$name}} {{$fname}} {{$job}} {{$row->amount}} {{$row->title}} {{$row->timestamp}}
Total: {{$salary_total}}


@endif @if(isset($shared))

Shared Dividends

@foreach($shared as $row) @php $partner = App\Models\Partner::where('id', $row->partner_id)->first(); $shared_total += $row->shared_amount; @endphp @endforeach
# Name F/Name Percentage Amount Notes Date
{{++$loop->index}} {{$partner != null ? $partner->name : ''}} {{$partner != null ? $partner->father_name : ''}} {{$row->shared_percentage}} {{$row->shared_amount}} {{$row->description}} {{$row->date}}
Total: {{$shared_total}}
@endif @if(isset($data['expenseTransactions']))

Other Expenses

@php $other_expense_total = 0; @endphp @foreach($data['expenseTransactions'] as $row) @php $account = App\Models\ChartofAccount::where('id', $row->account_id)->first(); $other_expense_total += $row->amount; @endphp @endforeach
# Category Title Description Date Amount
{{++$loop->index}} {{$account->name}} {{$row->title}} {{$row->description}} {{$row->timestamp}} {{$row->amount}}
Total: {{$other_expense_total}}
@endif @if(isset($data['voucherExpense']))

Voucher Expenses

@php $voucher_total = 0; @endphp @foreach($data['voucherExpense'] as $row) @php $account = App\Models\ChartofAccount::where('id', $row->account_id)->first(); $voucher_total += $row->amount; @endphp @endforeach
# Category Title Description Date Amount
{{++$loop->index}} {{$account->name}} {{$row->title}} {{$row->description}} {{$row->timestamp}} {{$row->amount}}
Total: {{$voucher_total}}
@endif
@php $revenue = $student_income_total + $other_income_total; $expense = $salary_total + $other_expense_total + $voucher_total + $shared_total; $totalBalance = ($revenue + $income_openning - $expense); @endphp
Starting Balance {{$income_openning}}
Today's Revenue {{ $revenue}}
Today's Expenses {{ $expense }}
Today's Balance {{$totalBalance}}
Closing Balance {{ ($totalBalance) }}
@endsection @section('script') @endsection