@extends('layouts.app')
@section('title','Quotations') @section('page_title','Customer Quotations')
@section('content')<div class="page-header"><div><h1>Customer Quotations</h1><p class="muted">Create, approve, issue and convert accepted quotations into transport jobs.</p></div>@if(auth()->user()->hasPermission('quotations.create'))<a class="btn btn-primary" href="{{ route('quotations.create') }}">New Quotation</a>@endif</div><div class="card"><div class="card-header"><form class="filter-bar"><input class="control" name="search" value="{{ request('search') }}" placeholder="Quotation or customer"><select class="control" name="status"><option value="">All statuses</option>@foreach(['draft','pending_approval','approved','sent','accepted','converted','rejected','expired','cancelled'] as $s)<option value="{{ $s }}" @selected(request('status')===$s)>{{ ucwords(str_replace('_',' ',$s)) }}</option>@endforeach</select><button class="btn btn-secondary">Filter</button></form></div><div class="table-wrap"><table><thead><tr><th>Quotation</th><th>Date</th><th>Customer</th><th>Expiry</th><th class="text-right">Total</th><th>Status</th><th></th></tr></thead><tbody>@forelse($quotations as $q)<tr><td><strong>{{ $q->quotation_number }}</strong><div class="muted">Version {{ $q->version }}</div></td><td>{{ $q->quotation_date->format('d M Y') }}</td><td>{{ $q->party?->legal_name }}</td><td>{{ $q->expiry_date?->format('d M Y') ?? '—' }}</td><td class="text-right">{{ $q->currency_code }} {{ number_format((float)$q->grand_total,2) }}</td><td><span class="badge status-{{ $q->status }}">{{ ucwords(str_replace('_',' ',$q->status)) }}</span></td><td class="text-right"><a class="btn btn-secondary btn-sm" href="{{ route('quotations.show',$q) }}">Open</a></td></tr>@empty<tr><td colspan="7" class="empty">No quotations found.</td></tr>@endforelse</tbody></table></div><div class="card-footer">{{ $quotations->links() }}</div></div>@endsection
