@extends('layouts.app') @section('title', 'Product Report - ' . $product->name) @section('content')
SKU: {{ $product->sku }} @if($product->category) · {{ $product->category->name }} @endif @if($product->brand) · {{ $product->brand->name }} @endif @if($product->supplier) · Supplier: {{ $product->supplier->name }} @endif
No stock.
@else| Batch No | Expiry | In stock | Received | Sold from it | |
|---|---|---|---|---|---|
| {{ $batch->label() }} @if($i === $batches->search(fn ($b) => !$b->isExpired()))sold next@endif | @if($batch->expiry_date) {{ $batch->expiry_date->format('d M Y') }} @if($batch->isExpired())Expired @elseif($days <= \App\Models\Product::EXPIRING_SOON_DAYS){{ (int) $days }} days left@endif @else None @endif | {{ rtrim(rtrim(number_format($batch->quantity, 2), '0'), '.') }} | {{ rtrim(rtrim(number_format($batch->received_quantity, 2), '0'), '.') }} {{ $batch->received_at?->format('d M Y') }} |
{{ rtrim(rtrim(number_format($soldFromBatch[$batch->id] ?? 0, 2), '0'), '.') }} | @if($batch->batch_no)Trace@endif |
Expired batches cannot be sold. Remove them with a Stock Out adjustment (reason: Expired).
@endif @endif| Time | Invoice | Customer | Payment | Qty | Price | Subtotal | Sold By |
|---|---|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($day)->format('l, M d, Y') }} | {{ number_format($salesPerDay[$day]->qty ?? 0) }} | {{ formatCurrency($salesPerDay[$day]->amount ?? 0) }} | day total | ||||
| {{ \Carbon\Carbon::parse($item->sold_at)->format('H:i') }} | @if($item->sale) {{ $item->sale->invoice_no }} @endif | {{ $item->sale->customer_name ?? 'Walk-In Customer' }} | {{ str_replace('_', ' ', $item->sale->payment_method ?? '—') }} | {{ number_format($item->quantity) }} | {{ formatCurrency($item->price) }} | {{ formatCurrency($item->subtotal) }} |
{{ $seller->name ?? 'Unknown' }}
@if($item->sale?->is_edited)
Edited by {{ $item->sale->editor->name ?? 'Unknown' }} {{ $item->sale->edited_at ? 'on ' . $item->sale->edited_at->format('M d, H:i') : '' }} @endif |
| No sales found for this product | |||||||
| Reference | Supplier | Status | Qty | Unit Cost | Line Total | Expiry | Recorded By |
|---|---|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($day)->format('l, M d, Y') }} | {{ rtrim(rtrim(number_format($purchasesPerDay[$day]->qty ?? 0, 2), '0'), '.') }} | {{ formatCurrency($purchasesPerDay[$day]->amount ?? 0) }} | day total | ||||
|
@if($row->purchase)
{{ $row->reference }}
@else
{{ $row->kind === 'adjustment' ? 'Stock in' : 'First stock' }}
@if($row->reference) {{ $row->reference }}@endif @endif |
{{ $row->supplier ?? '—' }} | {{ $row->status ?? '—' }} | {{ rtrim(rtrim(number_format($row->quantity, 2), '0'), '.') }} | {{ formatCurrency($row->unit_cost) }} | {{ formatCurrency($row->line_total) }} | {{ $row->expiry ? \Carbon\Carbon::parse($row->expiry)->format('M d, Y') : '—' }} | {{ $row->by ?? 'Unknown' }} |
| No purchases found for this product | |||||||
| Date & Time | Type | Qty Change | Previous → New | Price Change | Reason | By |
|---|---|---|---|---|---|---|
| {{ $adjustment->created_at->format('M d, Y H:i') }} | {{ $adjustment->adjustment_type_text }} | {{ $adjustment->quantity_change }} | {{ number_format($adjustment->previous_quantity) }} → {{ number_format($adjustment->new_quantity) }} | @if($adjustment->previous_price != $adjustment->new_price) {{ formatCurrency($adjustment->previous_price) }} → {{ formatCurrency($adjustment->new_price) }} @else No change @endif | {{ $adjustment->reason }} | {{ $adjustment->user->name ?? 'Unknown' }} |
| No stock adjustments found for this product | ||||||
| Date & Time | Type | Qty Change | Stock After | Reference | Customer / Supplier | By |
|---|---|---|---|---|---|---|
| {{ $movement->created_at->format('M d, Y H:i') }} | {{ $movement->type }} | {{ $movement->quantity_change >= 0 ? '+' : '' }}{{ number_format($movement->quantity_change) }} | {{ number_format($movement->new_quantity) }} | {{ $movement->reference_no ?? '—' }} | {{ $movement->customer_supplier ?? '—' }} | @if($movement->user) {{ $movement->user->name }} @else Not recorded @endif |
| No stock movements found for this product | ||||||
Stock at the start (opening) and end (closing) of each day. {{ request('from') || request('to') ? 'Days in the selected period' : 'The last 30 days' }}, newest first; use From / To above for other days.
| Date | Opening Stock | Received | Sold | Adjusted | Closing Stock |
|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($day)->format('D, M d, Y') }}{{ \Carbon\Carbon::parse($day)->isToday() ? ' (today)' : '' }} | {{ $qty($row['opening']) }} | {{ $row['received'] ? '+' . $qty($row['received']) : '—' }} | {{ $row['sold'] ? '−' . $qty($row['sold']) : '—' }} | {{ $row['adjusted'] ? ($row['adjusted'] > 0 ? '+' : '−') . $qty(abs($row['adjusted'])) : '—' }} | {{ $qty($row['closing']) }} |
| No days in the selected period | |||||
| Date & Time | Action | Description | By | IP Address |
|---|---|---|---|---|
| {{ $activity->created_at->format('M d, Y H:i') }} | {{ $activity->action }} | {{ $activity->description }} | {{ $activity->user->name ?? 'Unknown' }} | {{ $activity->ip_address }} |
| No activity recorded for this product | ||||