@php $statusMeta = [ 'draft' => ['label' => __('Draft'), 'color' => 'slate'], 'sent' => ['label' => __('Out for Quotation'), 'color' => 'indigo'], 'closed' => ['label' => __('Closed'), 'color' => 'amber'], 'awarded' => ['label' => __('Awarded'), 'color' => 'emerald'], 'cancelled' => ['label' => __('Cancelled'), 'color' => 'slate'], ]; $tonePill = [ 'up' => 'bg-emerald-50 text-emerald-700', 'down' => 'bg-rose-50 text-rose-700', 'muted' => 'bg-slate-100 text-slate-500', ]; @endphp
{{-- Header --}} @if ($canManage) {{ __('New RFQ') }} @endif {{-- KPI cards --}}
@foreach ($kpis as $kpi)

{{ $kpi['label'] }}

{{ $kpi['value'] }}

{{ $kpi['sub']['text'] }}
@endforeach
{{-- RFQ table --}} {{-- Toolbar --}}
{{-- Table --}}
@forelse ($rfqs as $rfq) @php $deadline = $rfq->response_deadline; $closingSoon = $rfq->status === 'sent' && $deadline && $deadline->isFuture() && $deadline->diffInHours(now()) <= 72; $overdue = $rfq->status === 'sent' && $deadline && $deadline->isPast(); $outstanding = max(0, $rfq->invitations_count - $rfq->responses_count - $rfq->declined_count); @endphp @empty @endforelse
{{ __('RFQ #') }} {{ __('Subject') }} {{ __('Issued') }} {{ __('Closes') }} {{ __('Responses') }} {{ __('Status') }} {{ __('Actions') }}
{{ $rfq->rfq_number }} @if ($rfq->purchase_order_id)

{{ __('PO raised') }}

@endif
{{ $rfq->title ?: '—' }} @if ($rfq->is_public) {{ __('Open') }} @endif {{ trans_choice('{0}No items|{1}:count item|[2,*] :count items', $rfq->lines_count, ['count' => $rfq->lines_count]) }} {{ optional($rfq->issue_date)->format('j M Y') ?? '—' }} @if ($deadline) {{ $deadline->format('j M Y') }} @if ($rfq->status === 'sent') {{ $overdue ? __('Deadline passed') : $deadline->diffForHumans() }} @endif @else — @endif {{ $rfq->responses_count }}/{{ $rfq->invitations_count }} @if ($outstanding > 0 && $rfq->status === 'sent') {{ __(':n awaited', ['n' => $outstanding]) }} @endif {{ $statusMeta[$rfq->status]['label'] ?? $rfq->status_label }}
@if ($rfq->public_url)
@endif @if ($canManage && $rfq->status === 'draft') @endif @if ($canManage && $rfq->status === 'sent') @endif @if ($canManage && $rfq->status === 'closed') @endif @if ($rfq->purchase_order_id) {{ __('View PO') }} @endif @if ($canManage && ! in_array($rfq->status, ['awarded', 'cancelled'], true)) @endif @if ($canDelete) @endif
@if ($canManage && $search === '' && $statusFilter === '' && $visibilityFilter === '') {{ __('New RFQ') }} @endif
{{-- Pagination --}}
{{ $rfqs->links() }}
{{-- ============================================================= --}} {{-- Create / Edit RFQ modal --}} {{-- ============================================================= --}} {{ $editingId ? __('Edit RFQ') : __('New Request for Quotation') }}
{{-- Who may bid: the one choice that changes how the tender runs --}}

{{ __('Who can bid?') }}

{{-- Tailwind classes are written out literally per branch: the JIT scanner cannot see interpolated colour names, and this project carries no safelist. --}}
@if ($visibility === 'public')

{{ __('The bidding link appears once you save. Bidding stays sealed either way — each supplier only ever sees their own prices.') }}

@endif
{{-- Header fields --}}

{{ __('Suppliers may still answer in their own currency, bids are compared in base.') }}

{{ __('Supplier links lock automatically at this time.') }}

{{-- Items --}}

{{ __('Items to be priced') }}

@foreach ($lines as $i => $line)

{{ __('Linking stock carries the inventory link through to the purchase order raised on award.') }}

@error('lines.' . $i . '.description')

{{ $message }}

@enderror @error('lines.' . $i . '.quantity')

{{ $message }}

@enderror
@endforeach
{{-- Suppliers to invite --}}

{{ __('Invite suppliers') }}

{{ trans_choice('{0}None selected|{1}:count selected|[2,*] :count selected', count($invitedSuppliers), ['count' => count($invitedSuppliers)]) }}

{{ __('Each supplier gets their own private link. Nobody can see anybody else’s pricing.') }}

@if ($suppliers->isEmpty())

{{ __('No active suppliers yet. Add one on the Suppliers tab first.') }}

@else
@foreach ($suppliers as $supplier) @endforeach
@endif
{{-- Terms + internal notes --}}
{{ __('Cancel') }} {{ $editingId ? __('Save Changes') : __('Save Draft') }} {{ __('Saving...') }}