@extends('documents.procurement._layout', [ 'documentTitle' => 'Item Sourcing Report', 'reference' => $sourcingTrip->trip_reference, 'documentDate' => now()->format('d M Y'), ]) @section('header-meta')
| Destination Countries | {{ implode(', ', $sourcingTrip->destination_countries ?? []) ?: '—' }} |
| Departed | {{ \Carbon\Carbon::parse($sourcingTrip->actual_departure)->format('d M Y') }} |
| Returned | {{ \Carbon\Carbon::parse($sourcingTrip->return_date)->format('d M Y') }} |
| Source Currency | {{ $currency }} @ {{ number_format($sourcingTrip->exchange_rate ?? 0, 4) }} to base |
| Items Planned | Items Sourced / Partial | Items Unavailable | Total Est. Cost ({{ $currency }}) | Total Actual Cost ({{ $currency }}) | Variance ({{ $currency }}) |
|---|---|---|---|---|---|
| {{ $items->count() }} | {{ $sourcedItems->count() }} | {{ $unavailableItems->count() }} | {{ $totalEstCost > 0 ? number_format($totalEstCost, 2) : '—' }} | {{ $totalActCost > 0 ? number_format($totalActCost, 2) : '—' }} | @if($totalEstCost > 0 && $totalActCost > 0) {{ ($totalActCost <= $totalEstCost ? '−' : '+') . number_format(abs($totalActCost - $totalEstCost), 2) }} @else — @endif |
| # | Product | Supplier | Planned Qty | Sourced Qty | Δ Qty | Est. Unit Price | Act. Unit Price | Δ Price | Act. Total | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $i + 1 }} | {{ $item->product?->name ?? '—' }} | {{ $item->supplier?->name ?? '—' }} | {{ number_format($item->planned_quantity, 0) }} | {{ $item->sourced_quantity !== null ? number_format($item->sourced_quantity, 0) : '—' }} | @if($item->sourced_quantity !== null) {{ ($dQty >= 0 ? '+' : '') . number_format($dQty, 0) }} @else — @endif | {{ $item->estimated_unit_source_price ? number_format($item->estimated_unit_source_price, 2) : '—' }} | {{ $item->unit_source_price ? number_format($item->unit_source_price, 2) : '—' }} | {{ $dPrice !== null ? (($dPrice >= 0 ? '+' : '') . number_format($dPrice, 2)) : '—' }} | {{ $actTotal !== null ? number_format($actTotal, 2) : '—' }} | {{ ucwords(str_replace('_', ' ', $item->status)) }} |
| Product | Planned Qty | Reason |
|---|---|---|
| {{ $item->product?->name ?? '—' }} | {{ number_format($item->planned_quantity, 0) }} | {{ $item->unavailability_reason ?? '—' }} |