@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
@foreach($parsed['lines'] as $idx => $line) @endforeach
# 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'] ?: '—' }} {{ $line['qty_ordered'] }} {{ $line['qty_shipped'] ?: $line['qty_ordered'] }} ${{ number_format($line['unit_price'],4) }} {{ $line['tariff_amount'] > 0 ? '$'.number_format($line['tariff_amount'],2) : '—' }} ${{ 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