@extends('admin.layout.app') @php $titles = [ 'student-fees' => 'Student Fees', 'teacher-salaries' => 'Teacher Salaries', 'student-cycle' => 'Student Financial Cycle', 'teacher-cycle' => 'Teacher Financial Cycle', 'teacher-registration' => 'Teacher Registration', 'employee-registration' => 'Employee / Staff Registration', 'salary-advances' => 'Salary Advances', 'payments' => 'Payments', 'expenses' => 'Expenses', 'assets' => 'Fixed Assets', 'exchange' => 'Currency Exchange', 'archive' => 'Archive Documents', 'reports' => 'Financial Reports', ]; $title = $titles[$module] ?? 'Finance Module'; $m = $money; $date = fn ($value) => $value ? \Illuminate\Support\Carbon::parse($value)->format('Y-m-d') : ''; $filters = request()->except(['page', 'mode', 'edit', 'view']); $createModules = ['student-fees', 'payments', 'teacher-salaries', 'salary-advances', 'expenses', 'assets', 'exchange', 'archive']; $exportModules = ['student-fees', 'payments', 'teacher-salaries', 'salary-advances', 'expenses', 'assets', 'exchange', 'archive', 'reports']; $isCreateSupported = in_array($module, $createModules, true); $showIndex = true; $addLabel = [ 'student-fees' => 'Add New Fee', 'payments' => 'Add New Payment', 'teacher-salaries' => 'Add New Salary', 'salary-advances' => 'Add New Advance', 'expenses' => 'Add New Expense', 'assets' => 'Add New Asset', 'exchange' => 'Add New Exchange', 'archive' => 'Archive New Document', ][$module] ?? 'Add New'; @endphp @section('title', $title) @section('body')

{{ $title }}

Records, filters, reports, and actions

@if($showIndex && $isCreateSupported) {{ $addLabel }} @elseif($showIndex && $module === 'student-cycle') Add New Fee @elseif($showIndex && $module === 'teacher-cycle') Add New Salary @elseif($showIndex && $module === 'teacher-registration') Add New Teacher @elseif($showIndex && $module === 'employee-registration') Add New Employee @endif @if($showIndex) Reports @if(in_array($module, $exportModules, true)) Export @endif @endif
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif @if($showIndex && in_array($module, ['student-fees', 'payments', 'teacher-salaries', 'salary-advances', 'expenses', 'student-cycle', 'teacher-cycle', 'reports'], true))
@if(isset($totalExpected))
Expected
{{ $m($totalExpected) }}
@endif @if(isset($totalPaid))
Paid
{{ $m($totalPaid) }}
@endif @if(isset($totalPayments))
Payments
{{ $m($totalPayments) }}
@endif @if(isset($totalGross))
Gross Salary
{{ $m($totalGross) }}
@endif @if(isset($totalNet))
Net Salary
{{ $m($totalNet) }}
@endif @if(isset($totalAdvanced))
Advanced
{{ $m($totalAdvanced) }}
@endif @if(isset($totalDeducted))
Deducted
{{ $m($totalDeducted) }}
@endif @if(isset($totalExpenses))
Expenses
{{ $m($totalExpenses) }}
@endif @if(isset($totalSalaries))
Teacher Salaries
{{ $m($totalSalaries) }}
@endif @if(isset($totalAdvances))
Teacher Advances
{{ $m($totalAdvances) }}
@endif @if(isset($netProfit))
Net Profit / Loss
{{ $m($netProfit) }}
@endif
@endif @if($showIndex)
@if($module === 'student-fees')
@endif @if(in_array($module, ['student-fees', 'teacher-salaries', 'salary-advances', 'expenses'], true))
@endif @if(in_array($module, ['teacher-salaries', 'salary-advances', 'payments', 'expenses', 'archive', 'reports'], true))
@endif
@endif @if($showIndex)
Record List {{ isset($rows) && method_exists($rows, 'total') ? number_format($rows->total()).' records' : '' }}
@if($module === 'student-fees') @forelse($rows as $fee) @empty @endforelse
StudentSemesterRequiredPaidStatusDueActions
{{ $fee->student->name ?? 'Student' }}
{{ $fee->student?->studentRecord?->program?->name }}
{{ $fee->semester->name ?? '' }} {{ $m($fee->net_amount) }} {{ $m($fee->paid_amount) }} {{ ucfirst($fee->status) }} {{ $date($fee->due_date) }} View Edit
@csrf @method('DELETE')
No records found.
@elseif($module === 'payments') @forelse($rows as $payment) @empty @endforelse
ReceiptStudentDateMethodAmountActions
{{ $payment->receipt_no }}
{{ $payment->reference_number ?: $payment->transaction_id }}
{{ $payment->studentFee?->student?->name }}{{ $date($payment->gregorian_date) }}
{{ $payment->shamsi_date }}
{{ str_replace('_', ' ', ucfirst($payment->payment_method)) }}{{ $m($payment->amount) }}View Edit Print
@csrf @method('DELETE')
No records found.
@elseif($module === 'teacher-salaries') @forelse($rows as $payroll) @empty @endforelse
TeacherPeriodGrossNetStatusActions
{{ $payroll->employee->name ?? 'Teacher' }}{{ $date($payroll->period_start) }} - {{ $date($payroll->period_end) }}{{ $m($payroll->gross_salary) }}{{ $m($payroll->net_salary) }}{{ ucfirst($payroll->status) }}View Edit Print
@csrf @method('DELETE')
No records found.
@elseif($module === 'salary-advances') @forelse($rows as $advance) @empty @endforelse
EmployeeDateAmountDeductedRemainingStatusActions
{{ $advance->employee->name ?? 'Employee' }}{{ $date($advance->advance_date) }}
{{ $advance->shamsi_date }}
{{ $m($advance->amount) }}{{ $m($advance->deducted_amount) }}{{ $m($advance->remaining_amount) }}{{ ucfirst($advance->approval_status) }}View Edit Print
@csrf @method('DELETE')
No records found.
@elseif($module === 'expenses') @forelse($rows as $expense) @empty @endforelse
DateTitleCategoryStatusAmountActions
{{ $date($expense->expense_date) }}
{{ $expense->shamsi_date }}
{{ $expense->title }}
{{ $expense->supplier }}
{{ $expense->category->name ?? '' }}{{ ucfirst($expense->approval_status) }}{{ $m($expense->amount) }} {{ $expense->currency }}View Edit @if($expense->attachment_path)Print@endif
@csrf @method('DELETE')
No records found.
@elseif(in_array($module, ['teacher-registration', 'employee-registration'], true)) @forelse($rows as $user) @empty @endforelse
NameEmailPhoneRole / TypeActions
{{ $user->name }}{{ $user->email }}{{ $user->phone }}{{ $user->employee_type ?: $user->roles->pluck('name')->join(', ') }}View Edit
@csrf @method('DELETE')
No records found.
@elseif($module === 'student-cycle') @forelse($rows as $fee) @empty @endforelse
StudentProgramSemesterFeePaymentsStatusActions
{{ $fee->student->name ?? 'Student' }}{{ $fee->student?->studentRecord?->program?->name }}{{ $fee->semester->name ?? '' }}{{ $m($fee->net_amount) }}{{ $m($fee->payments->sum('amount')) }}{{ ucfirst($fee->status) }}View
No records found.
@elseif($module === 'teacher-cycle') @forelse($rows as $teacher) @empty @endforelse
TeacherEmailSalary TypeMonthlyDailyHourlyActions
{{ $teacher->name }}{{ $teacher->email }}{{ $teacher->salary_type }}{{ $m($teacher->monthly_salary) }}{{ $m($teacher->daily_rate) }}{{ $m($teacher->hourly_rate) }}View
No records found.
@elseif($module === 'assets') @forelse($rows as $asset)@empty@endforelse
CodeAssetDateLocationResponsiblePriceActions
{{ $asset->asset_code }}{{ $asset->asset_name }}
{{ $asset->category->name ?? '' }}
{{ $date($asset->purchase_date) }}{{ $asset->location }}{{ $asset->responsiblePerson->name ?? '' }}{{ $m($asset->purchase_price) }}View Edit
@csrf @method('DELETE')
No records found.
@elseif($module === 'exchange') @forelse($rows as $tx)@empty@endforelse
DateTypeFromRateToReferenceActions
{{ $date($tx->transaction_date) }}{{ ucfirst($tx->transaction_type) }}{{ $m($tx->from_amount) }} {{ $tx->from_currency }}{{ $tx->rate }}{{ $m($tx->to_amount) }} {{ $tx->to_currency }}{{ $tx->reference_number }}View Edit
@csrf @method('DELETE')
No records found.
@elseif($module === 'archive') @forelse($rows as $doc)@empty@endforelse
NoDateTypeSubjectFrom / ToFileActions
{{ $doc->document_number }}{{ $date($doc->document_date) }}
{{ $doc->shamsi_date }}
{{ ucfirst($doc->document_type) }}{{ $doc->subject }}{{ $doc->sender ?: $doc->recipient }}@if($doc->attachment_path)Open@endifView Edit
@csrf @method('DELETE')
No records found.
@elseif($module === 'reports')
Student fee income{{ $m($feeIncome) }}
Other income{{ $m($otherIncome) }}
Salary expenses{{ $m($salaryExpenses) }}
Operational and asset expenses{{ $m($operationalExpenses) }}
Net profit / loss{{ $m($netProfit) }}
@endif @if(isset($rows) && method_exists($rows, 'links'))
{{ $rows->links('pagination::bootstrap-4') }}
@endif
@endif @endsection