@php $tabs = [ 'daily' => __('reports.daily'), 'monthly' => __('reports.monthly'), 'yearly' => __('reports.yearly'), 'patient' => __('reports.patient'), 'financial' => __('reports.financial'), ]; @endphp
@foreach ($tabs as $tab => $label) @endforeach
@if ($activeTab === 'daily') @php($report = $this->dailyReport)
{{ __('reports.total_appointments') }}
{{ $report['summary']['total_appointments'] }}
{{ __('reports.completed') }}
{{ $report['summary']['completed'] }}
{{ __('reports.cancelled') }}
{{ $report['summary']['cancelled'] }}
{{ __('reports.revenue') }}
৳{{ number_format($report['summary']['revenue'], 2) }}

{{ __('reports.appointments') }}

@forelse ($report['appointments'] as $appointment) @empty @endforelse
{{ __('appointment.serial') }} {{ __('patient.name') }} {{ __('appointment.chamber') }} {{ __('common.status') }} {{ __('appointment.fee') }}
{{ $appointment->serial_number }} {{ $appointment->patient_name }} {{ $appointment->chamber?->name ?: '-' }} {{ $appointment->status }} ৳{{ number_format((float) $appointment->fee, 2) }}
{{ __('reports.no_data') }}
@elseif ($activeTab === 'monthly') @php($report = $this->monthlyReport)
{{ __('reports.revenue') }}
৳{{ number_format($report['summary']['total_revenue'], 2) }}
{{ __('reports.total_appointments') }}
{{ $report['summary']['total_appointments'] }}
{{ __('reports.new_patients') }}
{{ $report['summary']['new_patients'] }}

{{ __('reports.appointments') }}

@forelse ($report['chart'] as $row) @empty @endforelse
{{ __('reports.date') }} {{ __('reports.total_appointments') }} {{ __('reports.revenue') }}
{{ $row['label'] }} {{ $row['appointments'] }} ৳{{ number_format($row['revenue'], 2) }}
{{ __('reports.no_data') }}

{{ __('reports.top_chambers') }}

@forelse ($report['top_chambers'] as $chamber)
{{ $chamber['name'] }}
{{ $chamber['count'] }} {{ __('reports.appointments') }}
@empty
{{ __('reports.no_data') }}
@endforelse
@elseif ($activeTab === 'yearly') @php($report = $this->yearlyReport)
{{ __('reports.revenue') }}
৳{{ number_format($report['summary']['total_revenue'], 2) }}
{{ __('reports.total_appointments') }}
{{ $report['summary']['total_appointments'] }}
{{ __('reports.new_patients') }}
{{ $report['summary']['new_patients'] }}

{{ __('reports.yearly') }}

@forelse ($report['monthly'] as $row) @empty @endforelse
{{ __('reports.month') }} {{ __('reports.revenue') }} {{ __('reports.total_appointments') }} {{ __('reports.new_patients') }}
{{ $row['label'] }} ৳{{ number_format($row['revenue'], 2) }} {{ $row['appointments'] }} {{ $row['patients'] }}
{{ __('reports.no_data') }}
@elseif ($activeTab === 'patient') @php($report = $this->patientReport)
@if ($report['patient']) @endif
@if (! $report['patient'])
{{ __('reports.no_patient_selected') }}
@else
{{ __('reports.collected') }}
৳{{ number_format($report['summary']['total_spent'], 2) }}
{{ __('reports.visit_count') }}
{{ $report['summary']['visit_count'] }}
{{ __('reports.prescriptions') }}
{{ $report['prescriptions']->count() }}
{{ __('reports.average_visit_gap') }}
{{ $report['summary']['average_days_between_visits'] !== null ? $report['summary']['average_days_between_visits'].' '. __('common.days') : __('reports.average_visit_gap_empty') }}

{{ __('reports.appointments') }}

@forelse ($report['appointments'] as $appointment) @empty @endforelse
{{ __('reports.date') }} {{ __('appointment.chamber') }} {{ __('common.status') }}
{{ $appointment->appointment_date?->format('d M Y') }} {{ $appointment->chamber?->name ?: '-' }} {{ $appointment->status }}
{{ __('reports.no_data') }}

{{ __('reports.invoices') }}

@forelse ($report['invoices'] as $invoice) @empty @endforelse
{{ __('invoice.number') }} {{ __('invoice.paid_amount') }} {{ __('invoice.payment_status') }}
{{ $invoice->invoice_no }} ৳{{ number_format((float) $invoice->paid_amount, 2) }} {{ $invoice->payment_status }}
{{ __('reports.no_data') }}
@endif
@else @php($report = $this->financialReport)
{{ __('reports.collected') }}
৳{{ number_format($report['summary']['collected'], 2) }}
{{ __('reports.due') }}
৳{{ number_format($report['summary']['due'], 2) }}
{{ __('reports.total_invoices') }}
{{ $report['summary']['total_invoices'] }}

{{ __('reports.invoices') }}

@forelse ($report['invoices'] as $invoice) @empty @endforelse
{{ __('invoice.number') }} {{ __('patient.name') }} {{ __('invoice.paid_amount') }} {{ __('invoice.due_amount') }} {{ __('invoice.payment_method') }}
{{ $invoice->invoice_no }} {{ $invoice->patient?->name ?: '-' }} ৳{{ number_format((float) $invoice->paid_amount, 2) }} ৳{{ number_format((float) $invoice->due_amount, 2) }} {{ $invoice->payment_method ?: '-' }}
{{ __('reports.no_data') }}

{{ __('reports.payment_breakdown') }}

@forelse ($report['payment_breakdown'] as $method => $amount)
{{ $method }}
৳{{ number_format((float) $amount, 2) }}
@empty
{{ __('reports.no_data') }}
@endforelse
@endif