@extends('layouts.app') @section('title', 'Batch Recall') @section('content') @php $qty = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.'); $today = today(); $filtered = $search !== '' || $from || $to || $expiry || $stock; $chips = [ ['Expired, still on the shelf', ['expiry' => 'expired', 'stock' => 'in'], 'danger'], ['Expiring within 90 days', ['expiry' => 'soon', 'stock' => 'in'], 'warning'], ['Received this month', ['received_from' => $today->copy()->startOfMonth()->toDateString(), 'received_to' => $today->toDateString()], 'primary'], ['In stock', ['stock' => 'in'], 'success'], ]; $isChip = fn (array $params) => collect($params)->every(fn ($v, $k) => request($k) == $v) && collect(['q', 'received_from', 'received_to', 'expiry', 'stock'])->diff(array_keys($params))->every(fn ($k) => !request()->filled($k)); @endphp
Every batch received. Click a batch to see what is left on the shelf and which customers it was sold to.
| Batch | Product | Received | Expiry | Received | Sold | In stock | |
|---|---|---|---|---|---|---|---|
| {{ $batch->batch_no ?? 'No number' }} |
{{ $batch->product?->name ?? 'Deleted product' }}
{{ $batch->product?->sku }}{{ $batch->product?->category ? ' ยท ' . $batch->product->category->name : '' }}
|
{{ $batch->received_at?->format('d M Y') ?? '-' }} |
@if($batch->expiry_date)
{{ $batch->expiry_date->format('d M Y') }}
{{ $days < 0 ? 'expired ' . abs($days) . ' days ago' : ($days === 0 ? 'expires today' : 'in ' . $days . ' days') }}
@else
None
@endif
|
{{ $qty($batch->received_quantity) }} | {{ $qty($sold[$batch->id] ?? 0) }} | {{ $qty($batch->quantity) }} | Recall view |