@extends('pdf.layout') @section('content') @php $today = \Carbon\Carbon::today(); $value = $expiryItems->getCollection()->sum(fn ($b) => (float) $b->quantity_remaining * (float) ($b->unit_cost ?? $b->product?->purchase_price ?? 0)); @endphp
Batches with expiry {{ number_format($totalItems) }} in stock |
Expired {{ number_format($expiredItems) }} remove from the shelf |
Expiring in 30 days {{ number_format($expiringSoonItems) }} sell first |
Value listed MWK {{ number_format($value, 2) }} at cost |
| Product | Batch | Supplier | Received | Expiry | Days left | Qty | Value (MWK) | Status |
|---|---|---|---|---|---|---|---|---|
| {{ $b->product?->name ?? 'Deleted product' }} {{ $b->product?->sku }} |
{{ $b->batch_no }} | {{ $b->purchaseItem?->purchase?->supplier?->name ?? $b->product?->supplier?->name ?? '-' }} | {{ ($b->received_at ?? $b->created_at)->format('d M Y') }} | {{ $b->expiry_date?->format('d M Y') }} | {{ $days === null ? '-' : ($days < 0 ? abs($days) . ' ago' : $days) }} | {{ (float) $b->quantity_remaining }} | {{ number_format((float) $b->quantity_remaining * (float) ($b->unit_cost ?? $b->product?->purchase_price ?? 0), 2) }} | {{ $text }} |
| Total ({{ $expiryItems->count() }} batches) | {{ (float) $expiryItems->getCollection()->sum('quantity_remaining') }} | {{ number_format($value, 2) }} | ||||||