@extends('admin.layouts.index-template', [ 'pageTitle' => 'Cotizaciones', 'items' => $quotes, 'icon' => 'chat-quote', 'module' => 'Cotizaciones', 'createRoute' => route('admin.quotes.create'), 'indexRoute' => route('quotes.index'), 'searchPlaceholder' => 'Buscar por cliente, email o ID...', 'emptyIcon' => 'quote-left', 'emptyTitle' => 'No hay cotizaciones', 'emptyMessage' => 'Las cotizaciones aparecerán cuando los clientes las soliciten desde la tienda', 'stats' => [ 'all' => [ 'label' => 'Total', 'count' => $quotes->total(), 'color' => 'primary', 'icon' => 'chat-quote' ], 'pending' => [ 'label' => 'Pendientes', 'count' => \App\Models\Quote::where('status', 'pending')->count(), 'color' => 'warning', 'icon' => 'time' ], 'quoted' => [ 'label' => 'Cotizadas', 'count' => \App\Models\Quote::where('status', 'quoted')->count(), 'color' => 'success', 'icon' => 'checkbox-circle' ], 'accepted' => [ 'label' => 'Aceptadas', 'count' => \App\Models\Quote::where('status', 'accepted')->count(), 'color' => 'success', 'icon' => 'thumb-up' ], 'rejected' => [ 'label' => 'Rechazadas', 'count' => \App\Models\Quote::where('status', 'rejected')->count(), 'color' => 'danger', 'icon' => 'close-circle' ], 'today' => [ 'label' => 'Hoy', 'count' => \App\Models\Quote::whereDate('created_at', today())->count(), 'color' => 'secondary', 'icon' => 'calendar-event' ] ] ]) @push('css') @endpush @section('header-buttons') @endsection @section('action-buttons') @endsection @section('filters')
@endsection @section('table-headers') ID Cliente Productos Total Estimado Precio Cotizado Estado Fecha Acciones @endsection @section('table-body') @foreach($quotes as $quote) #{{ $quote->id }}
@if($quote->user_name) {{ $quote->user_name }}
{{ $quote->user_email }} @else {{ $quote->first_name }} {{ $quote->last_name }}
{{ $quote->email }} @endif
{{ $quote->quoteItems->count() }} productos @if($quote->special_requirements)
Req. especiales @endif ${{ number_format($quote->grand_total, 2) }} @if($quote->quoted_price) ${{ number_format($quote->quoted_price, 2) }} @if($quote->valid_until)
Válida hasta: {{ \Carbon\Carbon::parse($quote->valid_until)->format('d/m/Y') }} @endif @else Sin cotizar @endif @php $statusColors = [ 'pending' => 'warning', 'quoted' => 'info', 'accepted' => 'success', 'rejected' => 'danger' ]; $statusLabels = [ 'pending' => 'Pendiente', 'quoted' => 'Cotizada', 'accepted' => 'Aceptada', 'rejected' => 'Rechazada' ]; @endphp {{ $statusLabels[$quote->status] ?? $quote->status }} {{ \Carbon\Carbon::parse($quote->created_at)->format('d/m/Y H:i') }}
@if($quote->status != 'accepted') @endif
@endforeach @endsection @push('js') @endpush