@php ini_set('memory_limit', '44M'); @endphp @php $shared_total = 0; $student_income_total = 0; $other_opennings = 0; $other_income_total = 0; $salary_total = 0; $other_expense_total = 0; $voucher_total = 0;@endphp

Report

{{-- @php $student_total = 0; $other_total = 0; @endphp --}} @php $count = 0; @endphp @if(count($studentRevenues) > 0)

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
{{++$loop->index}} {{$row->id}} {{$stName}} {{$fName}} {{$courseName}} {{$row->admission_fee}} {{$row->exam_fee}} {{$row->payment}} {{$row->material_fees}} {{$totalStudentRevenue}}
Total: {{$student_income_total}}
@endif @if(isset($data['incomeTransactions']) && count($data['incomeTransactions']) > 0)

Other Incomes

@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']) && count($data['salaryTransactions']) > 0)

Receipt Expense

@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
# 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) && count($shared) > 0)

Shared Dividends Expense

@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']) && count($data['expenseTransactions']) > 0)

Other Expense

@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']) && count($data['voucherExpense']) > 0)

Voucher Expense

@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) }}