@extends('pdf.layout') @section('content') @php $n = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.') ?: '0'; $m = fn ($v) => number_format((float) $v, 2); @endphp
Current stock {{ $n($product->current_stock) }} {{ $product->unit->short_name ?? '' }} Alert at {{ $n($product->alertLevel()) }} |
Sold {{ $n($salesTotals->qty) }} MWK {{ $m($salesTotals->amount) }} in {{ $salesTotals->count }} sale(s) |
Purchased / stock in {{ $n($purchaseTotals->qty) }} MWK {{ $m($purchaseTotals->amount) }} |
Prices MWK {{ $m($product->selling_price) }} Cost MWK {{ $m($product->purchase_price) }} |
{{ $product->category->name ?? 'No category' }}{{ $product->brand ? ' - ' . $product->brand->name : '' }}{{ $product->supplier ? ' - Supplier: ' . $product->supplier->name : '' }}
| Date | Invoice | Customer | Payment | Qty | Price | Amount (MWK) | Sold by |
|---|---|---|---|---|---|---|---|
| {{ \Carbon\Carbon::parse($item->sold_at)->format('d M Y H:i') }} | {{ $item->sale->invoice_no ?? '-' }}@if($item->sale?->is_edited) edited@endif | {{ $item->sale->customer_name ?? 'Walk-in' }} | {{ ucwords(str_replace('_', ' ', $item->sale->payment_method ?? '-')) }} | {{ $n($item->quantity) }} | {{ $m($item->price) }} | {{ $m($item->subtotal) }} | {{ ($item->sale?->user ?? $item->sale?->register?->user)->name ?? '-' }} |
| Total | {{ $n($salesTotals->qty) }} | {{ $m($salesTotals->amount) }} | |||||
| Date | Reference | Supplier | Status | Qty | Unit cost | Total (MWK) | Expiry | By |
|---|---|---|---|---|---|---|---|---|
| {{ $row->date->format('d M Y') }} | {{ $row->reference }} | {{ $row->supplier }} | {{ ucfirst($row->status) }} | {{ $n($row->quantity) }} | {{ $m($row->unit_cost) }} | {{ $m($row->line_total) }} | {{ $row->expiry ? \Carbon\Carbon::parse($row->expiry)->format('d M Y') : '-' }} | {{ $row->user }} |
| Total | {{ $n($purchaseTotals->qty) }} | {{ $m($purchaseTotals->amount) }} | ||||||
| Date | Type | Change | Stock before / after | Price change | Reason | By |
|---|---|---|---|---|---|---|
| {{ $a->created_at->format('d M Y H:i') }} | {{ $a->adjustment_type_text }} | {{ $a->quantity_change }} | {{ $n($a->previous_quantity) }} → {{ $n($a->new_quantity) }} | {{ $a->previous_price != $a->new_price ? $m($a->previous_price) . ' -> ' . $m($a->new_price) : '-' }} | {{ $a->reason }} | {{ $a->user->name ?? '-' }} |
| Day | Register | Opened | Stock at opening | Closed | Stock at closing | Change |
|---|---|---|---|---|---|---|
| {{ $register->opened_at->format('D d M Y') }} | #{{ $register->id }} {{ $register->user->name ?? '' }} | {{ $register->opened_at->format('H:i') }} | {{ $open ? $n($open['qty']) . ($open['estimated'] ? ' est.' : '') : '-' }} | {{ $register->closed_at?->format('H:i') ?? 'open' }} | {{ $close ? $n($close['qty']) . ($close['estimated'] ? ' est.' : '') : '-' }} | {{ $change === null ? '-' : (($change > 0 ? '+' : '') . $n($change)) }} |
"est." = worked out from the stock history (no snapshot was taken for that register).
@else