@if(auth()->user()->isSuperAdmin() && !request()->filled('branch_id'))

Mode Tampilan Semua Cabang

Data stok harian saat ini digabungkan dari seluruh cabang. Untuk melakukan Edit stok harian, silakan pilih salah satu cabang terlebih dahulu menggunakan filter cabang di atas.

@endif
@forelse($dailyStocks as $stock) @php $productName = $stock->product_name ?? ($stock->product->name ?? '-'); $partnerName = $stock->partner_name ?? ($stock->partner->name ?? '-'); // correction from DB (raw, can be negative) $correction = isset($stock->correction) ? (int)$stock->correction : 0; // raw initial_stock from DB (before correction) $rawInitial = (int)$stock->initial_stock; // effective = raw + correction, used for display in Awal column $effectiveInitial = isset($stock->effective_initial_stock) ? (int)$stock->effective_initial_stock : max($rawInitial + $correction, 0); $stockId = $stock->id ?? null; @endphp @empty @endforelse
Produk Mitra Awal Terjual Sisa Dikembalikan Aksi
{{ $productName }} {{ $partnerName }} {{ $effectiveInitial }} {{ $stock->sold }} {{ $stock->remaining }} {{ $stock->returned }} @if($stockId) @php $pendingRev = $stock->pendingRevision ?? null; $hasPendingRev = $pendingRev !== null; $isInitialStockPending = $hasPendingRev && $pendingRev->old_initial_stock == 0; $isPartnerUser = (auth()->user()->role === 'partner'); @endphp @if($isPartnerUser) @if($hasPendingRev) {{ $isInitialStockPending ? 'Pending Persetujuan' : 'Pending Revisi' }} @else @endif @else @endif @else - @endif
Belum ada stok harian untuk tanggal ini.
@if($dailyStocks->hasPages())
{{ $dailyStocks->links() }}
@endif