@extends('layouts.app') @section('title', 'Compare Quotes — ' . $request->request_number) @section('content')
Quote Comparison
{{ $request->request_number }}
@if($request->project_name)
{{ $request->project_name }}
@endif
← Back to Quotes
@if($quotes->isEmpty())

No quotes submitted yet.

@else @php $awardedQuote = $request->awardedQuote; @endphp @foreach($quotes as $quote) @endforeach {{-- Per-item rows --}} @foreach($items as $i => $reqItem) @php $rowPrices = $quotes->map(fn($q) => optional($q->items->get($i))->unit_price)->filter()->values(); $minPrice = $rowPrices->count() ? $rowPrices->min() : null; @endphp @foreach($quotes as $q) @php $qItem = $q->items->get($i); $isMin = $qItem && $minPrice !== null && (float)$qItem->unit_price === (float)$minPrice && $rowPrices->count() > 1; @endphp @endforeach @endforeach {{-- Grand totals --}} @php $minTotal = $quotes->min('total_amount'); @endphp @foreach($quotes as $quote) @php $isCheapest = (float)$quote->total_amount === (float)$minTotal && $quotes->count() > 1; @endphp @endforeach {{-- Lead time --}} @foreach($quotes as $quote) @endforeach {{-- Payment terms --}} @foreach($quotes as $quote) @endforeach {{-- Award buttons --}} @if(!$awardedQuote) @foreach($quotes as $quote) @endforeach @else @endif
Item {{ $quote->supplier->name }} @if($quote->is_awarded)
✓ AWARDED
@endif
{{ $reqItem->description }}
Qty: {{ $reqItem->quantity }} {{ $reqItem->unit }}
@if($qItem)
@if($isMin)LOWEST@endif BD {{ number_format($qItem->unit_price, 3) }}
BD {{ number_format($qItem->total_price, 3) }}
@else @endif
Grand Total BD {{ number_format($quote->total_amount, 3) }}
Lead Time {{ $quote->lead_time_days !== null ? $quote->lead_time_days.' days' : '—' }}
Payment Terms {{ $quote->payment_terms ?: '—' }}
Award to:
✓ Awarded to {{ $awardedQuote->supplier->name }} on {{ $awardedQuote->awarded_at?->format('d M Y') }}
@endif
{{-- Award modal --}} @endsection