@extends('procurement::layouts.master') @section('title','Invoice Preview') @section('content')

Invoice Preview — {{ $parsed['supplier'] }}

← Upload Different File
@if(!empty($parsed['parse_errors']))
Parse warnings:
@endif
@csrf
Invoice Details — Review & Confirm
@php $matchedSupplier = $suppliers->first(fn($s) => Str::contains(strtolower($parsed['supplier']), strtolower($s->name)) || Str::contains(strtolower($s->name), strtolower($parsed['supplier']))); @endphp
Line Items ({{ count($parsed['lines']) }} extracted)
{{ collect($parsed['lines'])->where('component_matched',true)->count() }} matched {{ collect($parsed['lines'])->where('component_matched',false)->count() }} unmatched
@if(count($parsed['lines']) === 0)
Nothing could be extracted automatically from this file — a non-standard layout, a scanned image, etc. The invoice details above are still usable; click Add Line to type in its components by hand.
@endif
@foreach($parsed['lines'] as $idx => $line) @endforeach
Row # Supplier Part # MFG Part # Description Manufacturer COO HTS Qty Ord Qty Ship Unit $ Tariff $ Extended $ Matched Component
{{ $line['line_no'] }} {{ $line['supplier_part_number'] ?: '—' }} {{ $line['mfg_part_number'] ?: '—' }} {{ Str::limit($line['description'],35) }} {{ $line['manufacturer'] ?: '—' }} {{ $line['country_of_origin'] ?: '—' }} {{ $line['hs_code'] ?: '—' }} ${{ number_format($line['extended_price'],2) }} @if($line['component_matched']) @php $comp = \Modules\Procurement\Models\Component::find($line['component_id']) @endphp {{ Str::limit($comp?->description ?? 'Matched',25) }} @else No match @endif
Lines Total: ${{ number_format(collect($parsed['lines'])->sum('extended_price'),2) }}
{{ collect($parsed['lines'])->where('component_matched',true)->count() }} line items were automatically matched to existing components. {{ collect($parsed['lines'])->where('component_matched',false)->count() }} could not be matched — they will be saved as invoice line items without a component link. You can link them manually later from the component page.
Cancel
@endsection @push('scripts') @endpush