@php $tonePill = [ 'up' => 'bg-emerald-50 text-emerald-700', 'down' => 'bg-rose-50 text-rose-700', 'muted' => 'bg-slate-100 text-slate-500', ]; // Movement-type presentation (badge colour + label). $typeMeta = [ 'opening' => ['label' => __('Opening'), 'color' => 'slate'], 'receipt' => ['label' => __('Receipt'), 'color' => 'emerald'], 'consumption' => ['label' => __('Consumption'), 'color' => 'indigo'], // Not a type of its own: a consumption whose reason is the shop's own // use (a customer's invoice printed at the counter). Shown and filtered // apart so it is never read as a sale or as spoilage. 'internal_use' => ['label' => __('Internal use'), 'color' => 'amber'], 'wastage' => ['label' => __('Wastage'), 'color' => 'rose'], 'adjustment' => ['label' => __('Adjustment'), 'color' => 'amber'], 'stocktake' => ['label' => __('Stocktake'), 'color' => 'sky'], 'return' => ['label' => __('Return'), 'color' => 'violet'], ]; $stockActionMeta = [ 'receive' => ['title' => __('Receive Stock'), 'verb' => __('Receive')], 'adjust' => ['title' => __('Adjust Stock'), 'verb' => __('Adjust')], 'writeoff' => ['title' => __('Write Off Stock'), 'verb' => __('Write off')], 'stocktake' => ['title' => __('Stocktake'), 'verb' => __('Stocktake')], ]; // Status badge for a material/variant given its on-hand vs reorder level. $statusFor = function (float $onHand, $level) { if ($onHand <= 0) { return ['label' => __('Out'), 'color' => 'rose']; } if ($level !== null && $onHand <= (float) $level) { return ['label' => __('Low'), 'color' => 'amber']; } return ['label' => __('In Stock'), 'color' => 'emerald']; }; @endphp
{{ $kpi['label'] }}
{{ $kpi['value'] }}
| {{ __('Material') }} | {{ __('Category') }} | {{ __('On Hand') }} | {{ __('Available') }} | {{ __('Unit Cost') }} | {{ __('Value') }} | {{ __('Status') }} | {{ __('Actions') }} | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @if ($material->category) {{ $material->category->name }} @else — @endif | @qty($onHand) | @qty($available) | {{ $baseCode }} {{ number_format($avgCost, 2) }} | {{ $baseCode }} {{ number_format($stockValue, 2) }} | |||||||||||||||||
|
|||||||||||||||||||||
|
|
|||||||||||||||||||||
| {{ __('Date') }} | {{ __('Material / Variant') }} | {{ __('Location') }} | {{ __('Type') }} | {{ __('Quantity') }} | {{ __('Unit Cost') }} | {{ __('Value') }} | {{ __('By') }} | {{ __('Notes') }} |
|---|---|---|---|---|---|---|---|---|
| {{ optional($mv->moved_on)->format('d M Y') }} |
{{ $mv->variant?->material?->name ?? '—' }} {{ $mv->variant?->label }} @if ($mv->supplier) · {{ $mv->supplier->name }} @endif |
{{ $mv->location?->name ?? '—' }} |
|
{{ (float) $mv->quantity > 0 ? '+' : '' }}@qty((float) $mv->quantity) | {{ $baseCode }} {{ number_format((float) $mv->unit_cost, 2) }} | {{ $baseCode }} {{ number_format((float) $mv->value, 2) }} | {{ $mv->recorder?->name ?? __('System') }} | {{ $mv->notes ?: '—' }} |
|
|
||||||||
| {{ __('Material / Variant') }} | {{ __('Category') }} | {{ __('On Hand') }} | {{ __('Reorder Level') }} | {{ __('Reorder Qty') }} | @if ($canManage){{ __('Actions') }} | @endif
|---|---|---|---|---|---|
|
{{ $variant->material?->name ?? '—' }} {{ $variant->label }} |
@if ($variant->material?->category) {{ $variant->material->category->name }} @else — @endif | @qty($variant->on_hand) {{ $variant->material?->base_unit }} | {{ $level !== null ? \App\Support\Number::qty($level) : '—' }} | {{ $reorderQty !== null ? \App\Support\Number::qty($reorderQty) : '—' }} | @if ($canManage)@endif |
|
|
|||||
| {{ __('Material / Variant') }} | {{ __('On Hand') }} | {{ __('Reorder Level') }} | {{ __('Suggested Qty') }} | {{ __('Preferred Supplier') }} | @if ($canManage){{ __('Action') }} | @endif
|---|---|---|---|---|---|
|
{{ $variant->material?->name ?? '—' }} {{ $variant->label }} |
@qty($variant->on_hand) {{ $variant->material?->base_unit }} | {{ $level !== null ? \App\Support\Number::qty($level) : '—' }} | @qty($variant->suggested_qty) {{ $variant->material?->base_unit }} |
@if ($variant->suggested_supplier_name)
{{ $variant->suggested_supplier_name }} @if ($variant->suggested_lead_time !== null){{ trans_choice('{1} :count day lead|[2,*] :count days lead', (int) $variant->suggested_lead_time, ['count' => (int) $variant->suggested_lead_time]) }} @endif @else {{ __('No supplier set') }} @endif |
@if ($canManage)
@endif |
|
|
|||||
| {{ __('Supplier') }} | {{ __('Category') }} | {{ __('Materials') }} | {{ __('Lead Time') }} | {{ __('Payable Balance') }} | {{ __('Last Purchase') }} |
|---|---|---|---|---|---|
|
{{ $supplier->name }} @if ($supplier->is_preferred){{ $supplier->contact_person }} @endif |
{{ $supplier->category ?: '—' }} | @php $supplies = (int) ($supplyCounts[$supplier->id] ?? 0); @endphp {{ $supplies > 0 ? number_format($supplies) : __('none') }} | {{ $supplier->lead_time_days !== null ? trans_choice('{1} :count day|[2,*] :count days', (int) $supplier->lead_time_days, ['count' => (int) $supplier->lead_time_days]) : '—' }} | {{ $baseCode }} {{ number_format($supplier->payable_balance, 2) }} | {{ $supplier->last_purchase_at ? \Illuminate\Support\Carbon::parse($supplier->last_purchase_at)->format('d M Y') : '—' }} |
|
|
|||||
{{ $drawer['material']->base_unit }} @if ($drawer['material']->sku) · {{ __('SKU') }}: {{ $drawer['material']->sku }} @endif
@if ($drawer['material']->category) {{ $drawer['material']->category->name }} @endif{{ __('On Hand') }}
@qty($drawer['on_hand'])
{{ __('Available') }}
@qty($drawer['available'])
{{ __('Committed') }}
@qty($drawer['committed'])
{{ __('No active-job demand, Available equals On Hand.') }}
@endunless {{-- Per-location breakdown --}} @if ($drawer['location_breakdown']->isNotEmpty()){{ $variant->label }}
@if ($variant->size || $variant->color){{ collect([$variant->size, $variant->color])->filter()->implode(' · ') }}
@endif@qty($variant->on_hand)
{{ __('Avail') }} @qty($vAvailable)
{{ $stockVariantLabel }}
{{ __('Quantity to remove. Valued at the running weighted-average cost.') }}
@elseif ($stockAction === 'stocktake'){{ __('The physical count. The difference vs on-hand is posted as a stocktake movement.') }}
@endif{{ __('Cost per base unit. Blends into the weighted-average cost.') }}
@endif{{ __('Links this supplier to the material and remembers what they charged.') }}