{{ __('app.fees.invoices.title') }}

{{ __('app.fees.invoices.desc') }}

@can('fees.create') {{ __('app.fees.invoices.generate_monthly') }} {{ __('app.fees.invoices.generate_exam') }} @endcan
@if ($notice) {{ $notice }} @endif @if ($errors->any())
    @foreach ($errors->all() as $message)
  • {{ $message }}
  • @endforeach
@endif @if ($showGenerator)
@if ($mode === 'exam')
@foreach ($exams as $option) @endforeach
@else
@foreach ($years as $option) @endforeach @foreach ($genClasses as $option) @endforeach @foreach ($genSections as $option) @endforeach
@endif @if ($previewSummary !== [])
@foreach ([ 'students' => __('app.fees.invoices.summary.students'), 'ready' => __('app.fees.invoices.summary.ready'), 'existing' => __('app.fees.invoices.summary.existing'), 'no_structure' => __('app.fees.invoices.summary.no_structure'), 'no_items' => __('app.fees.invoices.summary.no_items'), 'zero' => __('app.fees.invoices.summary.zero'), ] as $key => $label)

{{ $label }}

{{ $previewSummary[$key] ?? 0 }}

@endforeach

{{ __('app.fees.invoices.preview_due', ['date' => \Illuminate\Support\Carbon::parse($previewDueDate)->translatedFormat('d M Y')]) }} · {{ __('app.fees.fields.total') }}: {{ number_format((float) ($previewSummary['total'] ?? 0), 2) }}

@if ($previewRows !== [])
@foreach ($previewRows as $row) @endforeach
{{ __('app.fees.fields.student') }} {{ __('app.admissions.roll') }} {{ __('app.fees.fields.structure') }} {{ __('app.fees.fields.items') }} {{ __('app.fees.fields.total') }}
{{ $row['name_en'] }} {{ $row['student_uid'] }} {{ $row['roll'] ?? '—' }} {{ $row['structure_name_en'] }} {{ count($row['lines']) }} {{ number_format((float) $row['total'], 2) }}
@endif @endif
{{ __('app.actions.cancel') }} {{ __('app.fees.invoices.preview') }} {{ __('app.fees.invoices.generate') }}
@endif
@foreach ([ 'count' => __('app.fees.invoices.summary.invoices'), 'total' => __('app.fees.invoices.summary.total'), 'paid' => __('app.fees.invoices.summary.paid'), 'outstanding' => __('app.fees.invoices.summary.outstanding'), 'overdue' => __('app.fees.invoices.summary.overdue'), ] as $key => $label)

{{ $label }}

@if ($key === 'count') {{ number_format($summary['count']) }} @else {{ number_format((float) $summary[$key], 2) }} @endif

@endforeach
@foreach ($years as $option) @endforeach @foreach ($classes as $option) @endforeach @foreach ($sections as $option) @endforeach @foreach ($kinds as $option) @endforeach @foreach ($statuses as $option) @endforeach
@forelse ($invoices as $invoice) @empty @endforelse
{{ __('app.fees.fields.invoice_no') }} {{ __('app.fees.fields.student') }} {{ __('app.fees.fields.scope') }} {{ __('app.fees.fields.period') }} {{ __('app.fees.fields.total') }} {{ __('app.fees.fields.balance') }} {{ __('app.fees.fields.due_date') }} {{ __('app.fees.fields.status') }} {{ __('app.actions.view') }}
{{ $invoice->invoice_no }} {{ $invoice->student?->localizedName() }} {{ $invoice->student?->student_uid }} · {{ __('app.admissions.roll') }} {{ $invoice->student?->roll ?? '—' }} {{ $invoice->academicClass?->localizedName() }} {{ $invoice->section?->localizedName() }} {{ $invoice->kind->label() }} {{ $invoice->billing_period }} {{ number_format((float) $invoice->total, 2) }} {{ number_format((float) $invoice->balance, 2) }} {{ $invoice->due_date->translatedFormat('d M Y') }} @if ($invoice->isOverdue()) {{ __('app.fees.invoices.days_overdue', ['days' => $invoice->daysOverdue()]) }} @endif {{ $invoice->status->label() }}
@can('fees.view') {{ __('app.actions.view') }} @endcan @can('fees.print') {{ __('app.actions.print') }} @endcan
@if ($invoices->hasPages())
{{ $invoices->links() }}
@endif