@extends('layouts.app') @section('title', 'Batch Report') @section('content') @php $statusBadges = [ 'expired' => ['danger', 'Expired'], 'expiring' => ['warning', 'Expiring soon'], 'valid' => ['success', 'Good'], 'none' => ['secondary', 'No expiry'], ]; @endphp
| Product | Expiry | Received | Received qty | Sold | In stock | Value | Status |
|---|---|---|---|---|---|---|---|
|
@if($batch->product)
{{ $batch->product->name }}
{{ $batch->product->sku }}
@else
Deleted product
@endif
|
{{ $batch->expiry_date ? $batch->expiry_date->format('d M Y') : '—' }}
@if($days !== null && $remaining > 0)
{{ $days < 0 ? abs($days) . ' days ago' : ($days === 0 ? 'today' : 'in ' . $days . ' days') }}
@endif
|
{{ ($batch->received_at ?? $batch->created_at)->format('d M Y') }} | {{ (float) $batch->quantity_received }} | {{ (float) ($sold[$batch->id] ?? 0) }} | {{ $remaining }} | {{ formatCurrency($remaining * (float) ($batch->unit_cost ?? $batch->product?->purchase_price ?? 0)) }} | {{ $label }} |