@props(['preInvoice' => null]) @if ($preInvoice !== null)
{{-- Header --}}

{{ __('Pre-Invoice Details') }} #{{ $preInvoice->id }}

{{-- Customer Info --}}

{{ __('Customer Information') }}

  • {{ __('Customer Name') }}: {{ $preInvoice->customer_name ?? '-' }}
  • {{ __('Company Name') }}: {{ $preInvoice->company_name ?? '-' }}
  • {{ __('Phone') }}: {{ $preInvoice->phone ?? '-' }}
  • {{ __('Email') }}: {{ $preInvoice->email ?? '-' }}
  • {{ __('Address') }}: {{ $preInvoice->address ?? '-' }}
  • {{ __('City') }}: {{ $preInvoice->city ?? '-' }}
  • {{ __('Postal Code') }}: {{ $preInvoice->postal_code ?? '-' }}

{{ __('Status and Overview') }}

  • {{ __('Status') }}: @php $statusColors = [ 'open' => 'bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300', 'closed' => 'bg-gray-100 text-gray-700 dark:bg-secondary/0.5 dark:text-gray-300', 'awarded' => 'bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300', 'cancelled' => 'bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300', ]; @endphp {{ __($preInvoice->status) }}
  • {{ __('Paid') }}: @if($preInvoice->is_paid) {{ __('Yes') }} ({{ number_format($preInvoice->paid_amount) }} {{ __('Toman') }}) @else {{ __('No') }} @endif
  • {{ __('Created At') }}: {{ verta($preInvoice->created_at)->format('Y/m/d H:i') }}
  • {{ __('Notes') }}: {{ $preInvoice->notes ?? '-' }}
{{-- Items --}}

{{ __('Items List') }}

@foreach($preInvoice->items as $index => $item) @endforeach
# {{ __('Item Name') }} {{ __('Quantity') }} {{ __('Unit') }} {{ __('Description') }} {{ __('External Link') }}
{{ $index + 1 }} {{ $item->name }} {{ $item->qty }} {{ $item->unit ?? '-' }} {{ $item->description ?? '-' }} @if($item->external_url) {{ __('View Link') }} @else - @endif
{{-- Quotes Section --}} @if($preInvoice->quotes->count())

{{ __('Supplier Quotes') }}

@foreach($preInvoice->quotes as $index => $quote) @endforeach
# {{ __('Supplier') }} {{ __('Total') }} {{ __('Terms') }} {{ __('Status') }} {{ __('Date') }} {{ __('Actions') }}
{{ $index + 1 }} {{ $quote->supplier->name ?? '—' }} {{ number_format($quote->total) }} {{ Str::limit($quote->terms, 50) ?? '-' }} {{ __($quote->status) ?? $quote->status }} {{ verta($quote->created_at)->format('Y/m/d') }} @if ($preInvoice->selected_quote_id !== $quote->id)
@csrf
@else {{ __('Selected') }} @endif
@else
{{ __('No quotes have been submitted yet.') }}
@endif {{-- comparison table --}} @if($preInvoice->quotes->count()) @php $compression = $preInvoice->createCompressionQuote() @endphp

{{ __('Supplier Quotes Compression') }}

@foreach ($compression['headers'] as $h) @endforeach @foreach ($compression['rows'] as $row) @foreach ($row['sellers'] as $cell) @endforeach @endforeach
{{ $h['name'] }}{{ __('Products / Items') }}
@if(!is_null($cell['price'])) {{ number_format($cell['price']) }} @else - @endif {{ $row['item_name'] }}
@else
{{ __('No quotes have been submitted yet.') }}
@endif
@endif