@extends('admin.layouts.inventory') @section('title', $goodsReceipt->document_number) @section('content') @php $statusValue = $goodsReceipt->status?->value ?? $goodsReceipt->status; $useAverageGst = (bool) $goodsReceipt->use_average_gst; $totals = \App\Support\InventoryDocumentTotals::for($goodsReceipt, 'sell'); $unitPrice = fn ($line) => $line->site_unit_price !== null ? (float) $line->site_unit_price : null; $lineTotal = fn ($line) => $unitPrice($line) !== null ? (float) $line->qty * $unitPrice($line) : null; $hasPricing = $goodsReceipt->lines->contains(fn ($line) => $line->site_unit_price !== null); $hasTax = $useAverageGst || $goodsReceipt->lines->contains(fn ($line) => $line->tax_id || $line->tax); $showLineTax = $hasTax && ! $useAverageGst; @endphp
No line items on this dispatch.
@else| # | SKU / Item | Batch | Qty | Unit | @if ($hasPricing)Unit price | @if ($showLineTax)GST / Tax | Tax amount | @endifLine total | @endif
|---|---|---|---|---|---|---|---|---|
| {{ $line->line_number }} |
{{ $line->sku?->sku_code }}
{{ $item->name }}
@if ($line->sku?->variant?->variant)
— {{ $line->sku->variant->variant }}
@endif
@endif
|
{{ $line->batch_no ?: '—' }} | @qty($line->qty) | {{ $line->unit?->symbol ?? $line->unit?->name ?? '—' }} | @if ($hasPricing){{ $price !== null ? number_format($price, 2) : '—' }} | @if ($showLineTax)@if ($line->tax) {{ $line->tax->name }} ({{ $line->tax->rate }}%) @else — @endif | {{ $lineTax !== null ? number_format($lineTax, 2) : '—' }} | @endif{{ $total !== null ? number_format($total, 2) : '—' }} | @endif