@php $monthNames = [ 1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December', ]; $monthSelectOptions = []; foreach ($monthNames as $num => $label) { $monthSelectOptions[] = ['value' => (string) $num, 'label' => $label]; } $yearSelectOptions = collect($yearOptions ?? [])->map(fn ($y) => ['value' => (string) $y, 'label' => (string) $y])->all(); $statusFilterOptions = [['value' => '', 'label' => 'All statuses']]; foreach (($statusOptions ?? []) as $st) { $statusFilterOptions[] = ['value' => (string) $st, 'label' => ucfirst($st)]; } $selectedStatusStr = $selectedStatus !== null ? (string) $selectedStatus : ''; $leadTypeFilterOptions = [['value' => '', 'label' => 'All types']]; foreach (($leadTypeOptions ?? []) as $lt) { $leadTypeFilterOptions[] = ['value' => (string) $lt, 'label' => ucfirst($lt)]; } $selectedLeadTypeStr = $selectedLeadType !== null ? (string) $selectedLeadType : ''; $assignedFilterOptions = []; $selectedAssignedStr = $selectedAssignedUserId !== null ? (string) $selectedAssignedUserId : ''; if (! empty($isManagementView) && $isManagementView) { $assignedFilterOptions = [['value' => '', 'label' => 'All']]; foreach (($assigneeFilterUsers ?? []) as $u) { $label = trim(($u->name ?? '').' '.($u->surname ?? '')); $label = $label !== '' ? $label : ('User #'.$u->id); $label = (bool) ($u->is_disabled ?? false) ? ($label.' (disabled)') : $label; $assignedFilterOptions[] = ['value' => (string) $u->id, 'label' => $label]; } } @endphp {{ __('Prospects') }}
@php $prospectsAlpineConfig = [ 'toolbarMode' => 'prospects', 'todayDate' => now()->format('Y-m-d'), 'leadUrlBase' => url('/leads'), 'appointmentDateDefault' => old('appointment_date', now()->format('Y-m-d')), 'appointmentTimeDefault' => old('appointment_time', '09:00'), 'appointmentLocationDefault' => old('location', ''), 'appointmentNotesDefault' => old('notes', ''), 'financeApplicationDateDefault' => old('application_date', now()->format('Y-m-d')), 'financeApplicationStatusDefault' => old('status', 'submitted'), 'financeApplicantNameDefault' => old('applicant_name', ''), 'financeVehicleDefault' => old('vehicle', ''), ]; if (filled(old('__appointment_lead_id'))) { $prospectsAlpineConfig['reopenAppointment'] = [ 'leadId' => (int) old('__appointment_lead_id'), 'leadLabel' => (string) old('__appointment_lead_label', ''), ]; } if (filled(old('__finance_application_lead_id'))) { $prospectsAlpineConfig['reopenFinanceApplication'] = [ 'leadId' => (int) old('__finance_application_lead_id'), 'leadLabel' => (string) old('__finance_application_lead_label', ''), 'applicantName' => (string) old('applicant_name', ''), ]; } if (! empty($isManagementView) && $isManagementView) { $prospectsAlpineConfig['canReassignLead'] = true; } if (filled(old('__reassign_lead_id'))) { $prospectsAlpineConfig['reopenReassign'] = [ 'leadId' => (int) old('__reassign_lead_id'), 'leadLabel' => (string) old('__reassign_lead_label', ''), 'assignedUserId' => old('assigned_user_id') !== null && old('assigned_user_id') !== '' ? (string) old('assigned_user_id') : '', ]; } @endphp
@if (! empty($isManagementView) && $isManagementView) @endif
@if (! empty($isManagementView) && $isManagementView)
@endif

{{ number_format(count($leads ?? [])) }} record(s)

@include('leads.partials.index-table-colgroup') @include('leads.partials.index-table-head') @forelse (($leads ?? []) as $lead) @include('leads.partials.index-table-row', [ 'lead' => $lead, 'prospectOnly' => true, 'convertUrl' => '', ]) @empty @endforelse
@if (! empty($isManagementView) && $isManagementView) No prospects for this selection. @else No prospects are assigned to you. @endif
@if (! empty($isManagementView) && $isManagementView)
@endif