@extends('layouts.app') @section('title', $rfq->ref_no) @section('content') @include('supplychain::layouts.nav')

{{ $rfq->ref_no }} — {{ $rfq->title }} @lang('supplychain::lang.rfq_status_'.$rfq->status)

@if(session('status'))
{{ session('status.msg') }}
@endif

@lang('supplychain::lang.lines')

@foreach($rfq->lines as $line) @endforeach
@lang('supplychain::lang.product') @lang('supplychain::lang.variation') @lang('supplychain::lang.qty') @lang('supplychain::lang.specs')
{{ $line->product?->name ?? '—' }} {{ $line->variation?->sub_sku ?? '—' }} {{ number_format($line->qty, 4) }} {{ $line->specs ?? '—' }}

@lang('supplychain::lang.responses')

@can('supplychain.rfq.update') @endcan @forelse($rfq->responses as $response) @can('supplychain.rfq.update') @endcan @empty @endforelse
@lang('supplychain::lang.supplier') @lang('supplychain::lang.quoted_price') @lang('supplychain::lang.lead_days') @lang('supplychain::lang.status')@lang('supplychain::lang.action')
{{ $response->contact?->name ?? '—' }} {{ $response->quoted_price !== null ? number_format($response->quoted_price, 2) : '—' }} {{ $response->lead_days ?? '—' }} {{ $response->status }} @if($rfq->status === 'open' || $rfq->status === 'closed')
@csrf
@endif
@lang('supplychain::lang.no_records')

@lang('supplychain::lang.due_date'): {{ $rfq->due_date?->format('Y-m-d') ?? '—' }}

@if($rfq->notes)

@lang('supplychain::lang.notes'): {{ $rfq->notes }}

@endif
@can('supplychain.rfq.update') @endcan
@can('supplychain.rfq.update') @if(in_array($rfq->status, ['open', 'closed']))

@lang('supplychain::lang.submit_response')

{!! Form::open(['url' => action([\Modules\SupplyChain\Http\Controllers\RfqController::class, 'submitResponse'], $rfq->id), 'method' => 'post']) !!}
{!! Form::label('contact_id', __('supplychain::lang.supplier').':') !!} {!! Form::select('contact_id', $suppliers, null, ['class' => 'form-control select2', 'required']) !!}
{!! Form::label('quoted_price', __('supplychain::lang.quoted_price').':') !!} {!! Form::number('quoted_price', null, ['class' => 'form-control', 'required', 'min' => '0', 'step' => 'any']) !!}
{!! Form::label('lead_days', __('supplychain::lang.lead_days').':') !!} {!! Form::number('lead_days', null, ['class' => 'form-control', 'required', 'min' => '0']) !!}
{!! Form::label('notes', __('supplychain::lang.notes').':') !!} {!! Form::textarea('notes', null, ['class' => 'form-control', 'rows' => 2]) !!}
{!! Form::close() !!}
@endif @endcan
@lang('messages.back')
@endsection