{{-- ========================================================= HEADER ========================================================== --}}
ANALISA STOCK
Laporan analisa kondisi stock dan pergerakan barang
Dicetak: {{ $printedAt->format('d/m/Y H:i:s') }}
{{-- ========================================================= FILTER ========================================================== --}}
Gudang
@if ($warehouse) {{ $warehouse->warehouse_code }} - {{ $warehouse->warehouse_name }} @else Semua Gudang @endif
Periode
{{ $period }} Hari
Status
{{ $statusFilterLabel }}
Pencarian
{{ $search !== '' ? $search : 'Semua Produk' }}
Data
{{ number_format($analysis->count(), 0, ',', '.') }} SKU
{{-- ========================================================= SUMMARY ========================================================== --}}
Total SKU
{{ number_format($totalSku, 0, ',', '.') }}
Total Stock
{{ number_format($totalQty, 2, ',', '.') }}
Total Masuk
{{ number_format($totalQtyIn, 2, ',', '.') }}
Total Keluar
{{ number_format($totalQtyOut, 2, ',', '.') }}
Habis
{{ number_format($outOfStock, 0, ',', '.') }}
Kritis
{{ number_format($critical, 0, ',', '.') }}
Menipis
{{ number_format($lowStock, 0, ',', '.') }}
{{-- ========================================================= STATUS SUMMARY ========================================================== --}}
Fast Moving
{{ number_format($fastMoving, 0, ',', '.') }}
Tidak Bergerak
{{ number_format($noMovement, 0, ',', '.') }}
Tidak Keluar
{{ number_format($noOut, 0, ',', '.') }}
Status yang Ditampilkan
{{ $statusFilterLabel }}
{{-- ========================================================= MAIN TABLE ========================================================== --}} @forelse ($analysis as $index => $item) @php $statusClass = match ($item['status']) { 'out' => 'status-out', 'low' => 'status-low', 'critical' => 'status-critical', 'fast' => 'status-fast', 'no_movement' => 'status-no-movement', 'no_out' => 'status-no-out', default => 'status-no-out', }; @endphp {{-- No --}} {{-- Product --}} {{-- Warehouse --}} {{-- Stock --}} {{-- In --}} {{-- Out --}} {{-- Average --}} {{-- Days --}} {{-- Status --}} @empty @endforelse
# Produk Gudang Stock Masuk Keluar Rata-rata/Hari Estimasi Hari Status
{{ $index + 1 }}
{{ $item['stock']->product->product_name ?? '-' }}
{{ $item['stock']->product->product_code ?? '-' }}
{{ $item['stock']->warehouse->warehouse_name ?? '-' }}
{{ $item['stock']->warehouse->warehouse_code ?? '-' }}
{{ number_format( $item['stock_qty'], 2, ',', '.' ) }} +{{ number_format( $item['qty_in'], 2, ',', '.' ) }} -{{ number_format( $item['qty_out'], 2, ',', '.' ) }} {{ number_format( $item['avg_out_per_day'], 2, ',', '.' ) }} @if ($item['days_remaining'] === null) - @else {{ number_format( $item['days_remaining'], 1, ',', '.' ) }} @endif {{ $item['status_label'] }}
Tidak ada data stock berdasarkan filter yang dipilih.
{{-- ========================================================= DETAIL MOVEMENT ========================================================== --}} @if ($analysis->count() > 0)
DETAIL MOVEMENT STOCK
Histori seluruh movement untuk stock yang ditampilkan pada laporan analisa.
@foreach ($analysis as $index => $item) @php $stock = $item['stock']; $movements = $details[$stock->id] ?? collect(); $statusClass = match ($item['status']) { 'out' => 'status-out', 'low' => 'status-low', 'critical' => 'status-critical', 'fast' => 'status-fast', 'no_movement' => 'status-no-movement', 'no_out' => 'status-no-out', default => 'status-no-out', }; @endphp
{{-- Product detail --}}
Produk
{{ $stock->product->product_name ?? '-' }}
Kode Produk
{{ $stock->product->product_code ?? '-' }}
Gudang
{{ $stock->warehouse->warehouse_name ?? '-' }}
Stock
{{ number_format( $item['stock_qty'], 2, ',', '.' ) }}
Status
{{ $item['status_label'] }}
Movement
{{ number_format( $movements->count(), 0, ',', '.' ) }}
{{-- Movement table --}} @if ($movements->count() > 0) @foreach ($movements as $movement) {{-- Date --}} {{-- Movement --}} {{-- Reference --}} {{-- Before --}} {{-- In --}} {{-- Out --}} {{-- After --}} {{-- User --}} {{-- Notes --}} @endforeach
Tanggal Movement Referensi Sebelum Masuk Keluar Sesudah User Catatan
@if ($movement->movement_date) {{ \Carbon\Carbon::parse( $movement->movement_date )->format( 'd/m/Y H:i' ) }} @else - @endif {{ $movement->movement_type ?? '-' }} {{ $movement->reference_type ?? '-' }} @if ($movement->reference_id) #{{ $movement->reference_id }} @endif {{ number_format( (float) $movement->qty_before, 2, ',', '.' ) }} @if ( (float) $movement->qty_in > 0 ) +{{ number_format( (float) $movement->qty_in, 2, ',', '.' ) }} @else - @endif @if ( (float) $movement->qty_out > 0 ) -{{ number_format( (float) $movement->qty_out, 2, ',', '.' ) }} @else - @endif {{ number_format( (float) $movement->qty_after, 2, ',', '.' ) }} {{ $movement->user->name ?? '-' }} {{ $movement->notes ?? '-' }}
@else
Belum ada histori movement.
@endif
@endforeach
@endif {{-- ========================================================= FOOTER ========================================================== --}}