{{ __('Batch Expiry Report') }}

{{ __('Showing batches expiring within selected date range') }}
{{ __('Matching Batches') }}
{{ number_format($batches->total()) }}
{{ __('Total Stock') }}
{{ number_format($totalStock, 2) }}
{{ __('Expired Batches') }}
{{ number_format($expiredBatches) }}
@forelse($batches as $batch) @php $expDate = $batch->expiry_date ? \Carbon\Carbon::parse($batch->expiry_date) : null; $daysLeft = $expDate ? (int) now()->startOfDay()->diffInDays($expDate, false) : null; if ($daysLeft !== null && $daysLeft < 0) { $badgeClass = 'bg-danger'; $statusText = __('Expired'); } elseif ($daysLeft !== null && $daysLeft <= 7) { $badgeClass = 'bg-warning text-dark'; $statusText = __('Expiring Soon'); } else { $badgeClass = 'bg-success'; $statusText = __('Active'); } @endphp @empty @endforelse
{{ __('Product') }} {{ __('Batch No') }} {{ __('Invoice') }} {{ __('MFG Date') }} {{ __('Expiry Date') }} {{ __('Days Left') }} {{ __('Stock') }} {{ __('Purchase Rate') }} {{ __('Sale Rate') }} {{ __('Status') }}
{{ $batch->product?->name ?? __('N/A') }}
{{ $batch->product?->barcode_number }}
{{ $batch->batch_no ?? '-' }} {{ $batch->purchase?->invoice_no ?? '-' }} {{ $batch->mfg_date ? \Carbon\Carbon::parse($batch->mfg_date)->format('d M Y') : '-' }} {{ $expDate ? $expDate->format('d M Y') : '-' }} @if($daysLeft !== null) @if($daysLeft < 0) {{ abs($daysLeft) }} {{ __('days ago') }} @elseif($daysLeft === 0) {{ __('Today') }} @else {{ $daysLeft }} {{ __('days left') }} @endif @else - @endif {{ number_format((float) $batch->qty, 2) }} {{ number_format((float) $batch->purchase_rate, 2) }} {{ number_format((float) $batch->sale_rate, 2) }} {{ $statusText }}
{{ __('No records found for the selected date range and search query.') }}
{{ $batches->links() }}