@extends('pdf.layout') @section('content') @php $today = \Carbon\Carbon::today(); $cost = fn ($b) => (float) ($b->unit_cost ?? $b->product?->purchase_price ?? 0); @endphp
Batches {{ number_format($totals['batches']) }} |
Units in stock {{ number_format($totals['in_stock']) }} |
Expiring in 30 days {{ number_format($totals['expiring']) }} |
Expired, still in stock {{ number_format($totals['expired']) }} |
| Product | Expiry | Received | Received qty | Sold | In stock | Value (MWK) | Status |
|---|---|---|---|---|---|---|---|
| {{ $b->product->name ?? 'Deleted product' }} {{ $b->product->sku ?? '' }} |
{{ $b->expiry_date?->format('d M Y') ?? '-' }}@if($days !== null && $left > 0) {{ $days < 0 ? abs($days) . ' days ago' : ($days === 0 ? 'today' : 'in ' . $days . ' days') }} @endif |
{{ ($b->received_at ?? $b->created_at)->format('d M Y') }} | {{ (float) $b->quantity_received }} | {{ (float) ($sold[$b->id] ?? 0) }} | {{ $left }} | {{ number_format($left * $cost($b), 2) }} | {{ $text }} |