@php $expiryView = $expiryView ?? request()->query('view', 'manage'); if (!in_array($expiryView, ['manage', 'near', 'expired'], true)) { $expiryView = 'manage'; } @endphp @if($expiryView === 'near')
@if(!empty($expiryIndexExtraQuery)) @foreach($expiryIndexExtraQuery as $k => $v) @endforeach @endif
Run time: {{ $runAt->format('Y-m-d h:i A') }} Up to: {{ $expiryDate }}
@endif @if($expiryView === 'manage')

Manage the Stock with EXP

Edit existing batch quantities (active batches with EXP), optionally create new batches, mark as expired or off-POS sold.

Assign EXP/MFD to Unbatched Stock (Opening Stock)

For opening stock: select a product → assign multiple batches (EXP required per batch) → optionally mark some remaining as expired or off-POS sold → leftover can remain unbatched.

@endif @if($expiryView === 'manage') @endif @if($expiryView === 'manage') @endif @if($expiryView === 'manage') @endif @if($expiryView === 'manage') @endif @php $perPage = $perPage ?? (int) request()->query('per_page', 20); $allowedPerPage = [20, 50, 100]; if (!in_array($perPage, $allowedPerPage, true)) { $perPage = 20; } @endphp @if($expiryView === 'near')
Near Expiry
Items approaching expiry – still sellable! Consider discounting or moving stock before it expires.
@forelse($nearExpiry ?? [] as $row) @php $expDate = \Carbon\Carbon::parse($row->price_exp); $daysLeft = max(0, now()->startOfDay()->diffInDays($expDate, false)); $urgencyClass = $daysLeft <= 7 ? 'text-rose-600 font-bold' : ($daysLeft <= 14 ? 'text-amber-600 font-semibold' : 'text-gray-700'); @endphp @empty @endforelse
Product Batch MFD EXP Days Left Qty Actions
{{ $row->product_name }}
{{ $row->product_barcode }}
{{ $row->price_name }} {{ $row->price_mfg ?? '-' }} {{ $row->price_exp }} {{ $daysLeft }} {{ number_format((float) $row->qty, 3) }}
{{-- Mark for clearance / Off-POS sale --}}
No near-expiry batches found. Great job managing your stock!
@if(isset($nearExpiry) && method_exists($nearExpiry, 'links'))
{{ $nearExpiry->links() }}
@endif
💡 Tips for Near-Expiry Items
  • Discount & Promote: Offer discounts to move stock quickly before expiry
  • Off-POS Sale: Bulk sale to restaurants, staff purchases, or other businesses
  • Check Supplier Policy: Some suppliers accept returns on near-expiry items
  • Don't wait until expired – expired items have zero value and must be disposed
{{-- Near Expiry Off-POS Sale Modal --}} @elseif($expiryView === 'expired')
Expired Items
Lists expired stock totals per product (live stock by location).
@forelse($expiredItems ?? [] as $row) @empty @endforelse
Product Expired Qty Dispose
{{ $row->product_name }}
{{ $row->product_barcode }}
{{ number_format((float) $row->qty, 3) }}
@csrf
No expired items with remaining stock.
@if(isset($expiredItems) && method_exists($expiredItems, 'links'))
{{ $expiredItems->links() }}
@endif
@endif