@extends('layouts.app') @section('content')
Expiry Alerts

Showing batches expiring within {{ $days }} days

Expired

{{ $stats['expired'] }}

Critical

{{ $stats['critical'] }}

Warning

{{ $stats['warning'] }}

Total Value

${{ number_format($stats['total_value'], 2) }}

Expiring Batches
@if($batches->isEmpty())
No expiring batches found!

All batches are valid for at least {{ $days }} more days.

@else
@foreach($batches as $batch) @php $daysLeft = $batch->expiry_date ? $batch->expiry_date->diffInDays(now()) : 999; $status = 'success'; if ($daysLeft < 0) { $status = 'danger'; } elseif ($daysLeft <= 7) { $status = 'warning'; } @endphp @endforeach
Batch Product Expiry Date Days Left Quantity Cost Value Status Actions
{{ $batch->batch_number }} {{ $batch->product->name }} {{ $batch->expiry_date->format('Y-m-d') }} @if($daysLeft < 0) Expired {{ abs($daysLeft) }} days ago @else {{ $daysLeft }} days @endif {{ $batch->current_quantity }} ${{ number_format($batch->current_quantity * $batch->batch_cost_price, 2) }} @if($daysLeft < 0) Expired @elseif($daysLeft <= 7) Critical @else Warning @endif
@if($daysLeft <= 30 && $batch->current_quantity > 0) @endif
Showing {{ $batches->firstItem() }} to {{ $batches->lastItem() }} of {{ $batches->total() }} batches
@endif
@endsection @section('script') @endsection