@extends('documents.inventory._layout', [
'documentTitle' => 'Lot Detail Sheet',
'reference' => $lot->lot_number,
'documentDate' => now()->format('d M Y'),
])
@section('header-meta')
Source: {{ ucwords(str_replace('_', ' ', $lot->source_type)) }}
Received: {{ $lot->received_date ? \Carbon\Carbon::parse($lot->received_date)->format('d M Y') : '—' }}
@endsection
@section('content')
{{-- Product & lot summary --}}
| Product |
{{ $lot->product?->name ?? '—' }}
@if($lot->product?->sku) ({{ $lot->product->sku }})@endif
|
| Received Location |
{{ $lot->receivedLocation?->name ?? '—' }} ({{ $lot->receivedLocation?->type ?? '' }}) |
| Qty Received |
{{ number_format($lot->quantity_received) }} {{ $lot->quantity_uom ?? $lot->product?->uom ?? '' }} |
| Current On Hand |
{{ number_format($currentStock) }}
@if($currentStock < $lot->quantity_received)
({{ number_format($lot->quantity_received - $currentStock) }} issued/adjusted)
@endif
|
@if($lot->batch_number)
| Batch Number |
{{ $lot->batch_number }} |
@endif
@if($lot->expiry_date)
@php $expired = \Carbon\Carbon::parse($lot->expiry_date)->isPast(); @endphp
| Expiry Date |
{{ \Carbon\Carbon::parse($lot->expiry_date)->format('d M Y') }}
{{ $expired ? ' ⚠ EXPIRED' : '' }}
|
@endif
| Costing Method |
{{ strtoupper($lot->costing_method) }} |
{{-- Pricing --}}
Pricing
| Landed Cost |
{{ $lot->landed_cost_per_unit ? number_format($lot->landed_cost_per_unit, 4) : '—' }} |
Per unit — batch-specific |
@if($lot->selling_price)
| Selling Price |
{{ number_format($lot->selling_price, 2) }} |
{{ $lot->selling_price_method ? ucwords(str_replace('_', ' ', $lot->selling_price_method)) : '' }}
@if($lot->margin_pct) · Margin: {{ $lot->margin_pct }}%@endif
@if($lot->markup_amount) · Markup: {{ number_format($lot->markup_amount, 2) }}@endif
|
@endif
@if($lot->outlet_price)
| Outlet Price |
{{ number_format($lot->outlet_price, 2) }} |
{{ $lot->outlet_price_method ? ucwords(str_replace('_', ' ', $lot->outlet_price_method)) : '' }} |
@endif
@if($lot->discount_cap)
| Discount Floor |
{{ number_format($lot->discount_cap, 2) }} |
Minimum sale price |
@endif
{{-- Stock Movements --}}
@if($lot->stockMovements->isNotEmpty())
Stock Movements
@foreach($lot->stockMovements as $m)
| {{ \Carbon\Carbon::parse($m->moved_at)->format('d M Y') }} |
{{ ucwords(str_replace('_', ' ', $m->movement_type)) }} |
{{ number_format($m->quantity) }} |
{{ $m->fromLocation?->name ?? '—' }} |
{{ $m->toLocation?->name ?? '—' }} |
{{ $m->adjustment_reason ?? '—' }} |
@endforeach
@endif
{{-- Serial Numbers --}}
@if($lot->product?->is_serialised && $lot->serialNumbers->isNotEmpty())
Serial Numbers ({{ $lot->serialNumbers->count() }})
@php
$statusGroups = $lot->serialNumbers->groupBy('status');
$statusColors = ['in_stock' => 'bg-green', 'reserved' => 'bg-amber', 'sold' => '', 'transferred' => 'bg-blue', 'written_off' => 'bg-red'];
@endphp
@foreach($lot->serialNumbers->sortBy('serial_number') as $i => $sn)
| {{ $i + 1 }} |
{{ $sn->serial_number }} |
{{ ucwords(str_replace('_', ' ', $sn->status)) }} |
@endforeach
@php
$statusSummary = $lot->serialNumbers->groupBy('status')->map->count();
@endphp
@foreach($statusSummary as $status => $count)
{{ ucwords(str_replace('_', ' ', $status)) }}: {{ $count }}{{ !$loop->last ? ' · ' : '' }}
@endforeach
@endif
@endsection