@extends('admin.layouts.inventory') @section('title', $purchaseOrder->document_number) @section('content') @php $statusValue = $purchaseOrder->status?->value ?? $purchaseOrder->status; $lineTotal = fn ($line) => $line->unit_price !== null ? (float) $line->qty * (float) $line->unit_price : null; $grandTotal = $purchaseOrder->lines->sum(fn ($line) => $lineTotal($line) ?? 0); $hasPricing = $purchaseOrder->lines->contains(fn ($line) => $line->unit_price !== null); @endphp
No line items on this purchase order.
@else| # | SKU / Item | Qty | Unit | Base qty | @if ($hasPricing)Unit price | Line total | @endif
|---|---|---|---|---|---|---|
| {{ $line->line_number }} |
{{ $line->sku?->sku_code }}
{{ $item->name }}
@if ($line->sku?->variant?->variant)
— {{ $line->sku->variant->variant }}
@endif
@endif
|
@qty($line->qty) | {{ $line->unit?->symbol ?? $line->unit?->name ?? '—' }} | @qty($line->qty_in_base_uom, $line->sku) | @if ($hasPricing){{ $line->unit_price !== null ? number_format((float) $line->unit_price, 2) : '—' }} | {{ $total !== null ? number_format($total, 2) : '—' }} | @endif