@php use App\Support\QuoteStatuses; $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' => QuoteStatuses::label($st)]; } $selectedStatusStr = $selectedStatus !== null ? (string) $selectedStatus : ''; $userFilterOptions = [['value' => '', 'label' => 'All salespeople']]; foreach (($users ?? []) as $u) { $userLabel = trim(($u->name ?? '').' '.($u->surname ?? '')); $userFilterOptions[] = ['value' => (string) $u->id, 'label' => $userLabel !== '' ? $userLabel : ('User #'.$u->id)]; } $selectedUserStr = $selectedUserId !== null ? (string) $selectedUserId : ''; $canUpdateQuotes = (bool) ($canUpdateQuotes ?? false); $summaryMetrics = [ ['label' => 'Total', 'key' => 'total'], ['label' => 'Issued', 'key' => 'issued', 'value_class' => 'text-blue-700'], ['label' => 'Accepted', 'key' => 'accepted', 'value_class' => 'text-emerald-700'], ['label' => 'Declined', 'key' => 'declined', 'value_class' => 'text-red-700'], ['label' => 'Expired', 'key' => 'expired', 'value_class' => 'text-amber-700'], ['label' => 'Cancelled', 'key' => 'cancelled'], ]; @endphp {{ __('Quotes') }}
@foreach ($summaryMetrics as $metric)
{{ $metric['label'] }}
{{ number_format((int) data_get($summary, $metric['key'], 0)) }}
@endforeach
@if (! empty($isDealerWideView) && $isDealerWideView)
@endif

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

@forelse ($quotes as $quote) @php $salesperson = trim(($quote->user?->name ?? '').' '.($quote->user?->surname ?? '')); $creator = trim(($quote->createdBy?->name ?? '').' '.($quote->createdBy?->surname ?? '')); $editPayload = $canUpdateQuotes ? [ 'updateUrl' => route('quotes.update', $quote), 'leadLabel' => $quote->lead?->displayNameForTable() ?? '', 'quoteDate' => optional($quote->quote_date)->format('Y-m-d') ?? '', 'make' => $quote->make ?? '', 'model' => $quote->model ?? '', 'variant' => $quote->variant ?? '', 'year' => $quote->year ?? '', 'stockNumber' => $quote->stock_number ?? '', 'quotedPrice' => $quote->quoted_price, 'tradeInValue' => $quote->trade_in_value, 'deposit' => $quote->deposit, 'estMonthly' => $quote->estimated_monthly_payment, 'status' => $quote->status, 'referenceNumber' => $quote->reference_number ?? '', 'notes' => $quote->notes ?? '', ] : null; @endphp @empty @endforelse
Date Lead Vehicle Quoted price Trade-in Deposit Est. monthly Status Reference Salesperson Created by Notes
{{ optional($quote->quote_date)->format('Y-m-d') ?? '—' }} {{ $quote->lead?->displayNameForTable() ?? '—' }} {{ $quote->displayVehicle() }} {{ $quote->formattedQuotedPrice() }} {{ $quote->formattedTradeInValue() }} {{ $quote->formattedDeposit() }} {{ $quote->formattedEstimatedMonthlyPayment() }} {{ $quote->statusLabel() }} {{ $quote->reference_number ?? '—' }} {{ $salesperson !== '' ? $salesperson : '—' }} {{ $creator !== '' ? $creator : '—' }}
No quotes found for this period.
@if ($canUpdateQuotes) @endif