@php $fmtCurrency = fn ($value) => 'Rp'.number_format((float) $value, 0, ',', '.'); @endphp

Laporan Persediaan

Ringkasan stok dan nilai persediaan per bahan baku.

Total Nilai Persediaan

{{ $fmtCurrency((float) ($summary['valueTotal'] ?? 0)) }}

Coverage Unit Cost

{{ number_format((float) ($summary['coveragePercent'] ?? 0), 1, ',', '.') }}%

{{ number_format((int) ($summary['movementCostLines'] ?? 0), 0, ',', '.') }}/{{ number_format((int) ($summary['movementLines'] ?? 0), 0, ',', '.') }} baris

Stok Paling Sedikit

@forelse (($lowestStocks ?? collect())->take(3) as $row) @php $stock = (float) ($row->stock_on_hand ?? 0); $unit = (string) ($row->unit ?? ''); @endphp

{{ (string) ($row->name ?? '') }}

{{ \App\Support\Number\QuantityFormatter::format($stock) }}{{ $unit !== '' ? ' '.$unit : '' }}

@empty

-

@endforelse

Stok Paling Banyak

@forelse (($highestStocks ?? collect())->take(3) as $row) @php $stock = (float) ($row->stock_on_hand ?? 0); $unit = (string) ($row->unit ?? ''); @endphp

{{ (string) ($row->name ?? '') }}

{{ \App\Support\Number\QuantityFormatter::format($stock) }}{{ $unit !== '' ? ' '.$unit : '' }}

@empty

-

@endforelse
Export Excel
@forelse ($ingredients as $row) @php $stock = (float) ($row->stock_on_hand ?? 0); $value = (float) ($row->stock_value ?? 0); $unit = (string) ($row->unit ?? ''); $cost = (float) ($row->cost_price ?? 0); $avg = abs($stock) >= 0.0005 ? ($value / $stock) : null; $movementLines = (int) ($row->movement_lines ?? 0); $movementCostLines = (int) ($row->movement_cost_lines ?? 0); $coverage = $movementLines > 0 ? ($movementCostLines / $movementLines) * 100 : 100.0; @endphp @empty @endforelse
Bahan Unit Stok HPP/Unit Nilai Persediaan Avg HPP Aksi

{{ (string) ($row->name ?? '') }}

{{ (string) ($row->sku ?? '') }}

@if ($coverage < 99.9)

Ada movement tanpa unit cost

@endif

{{ $unit }}

{{ \App\Support\Number\QuantityFormatter::format($stock) }}{{ $unit !== '' ? ' '.$unit : '' }}

{{ $fmtCurrency($cost) }}

{{ $fmtCurrency($value) }}

{{ $avg === null ? '-' : $fmtCurrency($avg) }}

Kartu Stok
{{ $ingredients->links('livewire.pagination.admin') }}