@php $opname = $this->record; $items = $this->getOpnameItems(); $searchResults = $this->getSearchResults(); $isLocked = $this->isLocked(); @endphp
{{-- Header --}}

Form Stock Opname

@if(!$isLocked) @else APPROVED @endif
{{-- Info --}}
{{ $opname->opname_number }}
{{ $opname->opname_date?->format('d/m/Y') ?? '-' }}
@php $statusColor = match($opname->status) { 'draft' => ['bg' => '#FEF3C7', 'border' => '#FCD34D', 'text' => '#92400E'], 'in_progress' => ['bg' => '#DBEAFE', 'border' => '#93C5FD', 'text' => '#1E40AF'], 'approved' => ['bg' => '#ECFDF5', 'border' => '#A7F3D0', 'text' => '#059669'], 'cancelled' => ['bg' => '#FEF2F2', 'border' => '#FECACA', 'text' => '#DC2626'], default => ['bg' => '#F9FAFB', 'border' => '#E5E7EB', 'text' => '#111827'], }; $statusLabel = match($opname->status) { 'draft' => 'Draft', 'in_progress' => 'Sedang Berjalan', 'pending_approval' => 'Menunggu Approval', 'approved' => 'Disetujui', 'cancelled' => 'Dibatalkan', default => $opname->status, }; @endphp
{{ $statusLabel }}
{{-- Search Product --}} @if(!$isLocked)
@if(count($searchResults) > 0)
@foreach($searchResults as $product) @endforeach
@endif
@endif {{-- Items Table - Desktop --}}
@if(!$isLocked) @endif @forelse($items as $idx => $item) @php $difference = (float) $item->physical_stock - (float) $item->system_stock; $diffColor = $difference > 0 ? '#059669' : ($difference < 0 ? '#DC2626' : '#6B7280'); $diffPrefix = $difference > 0 ? '+' : ''; $isValidated = (bool) $item->is_validated; $rowBg = $isValidated ? '#F0FDF4' : 'transparent'; @endphp @if(!$isLocked) @endif @empty @endforelse
NO PRODUK SKU SATUAN STOK SISTEM STOK FISIK SELISIH CATATANCEK HAPUS
{{ $idx + 1 }} {{ $item->product?->name ?? '-' }} {{ $item->product?->sku ?? '-' }} {{ $item->product?->unit ?? 'pcs' }} {{ number_format((float) $item->system_stock, 0, ',', '.') }} @if(!$isLocked && !$isValidated) @else {{ number_format((float) $item->physical_stock, 0, ',', '.') }} @endif {{ $diffPrefix }}{{ number_format($difference, 0, ',', '.') }} @if(!$isLocked && !$isValidated) @else {{ $item->notes ?? '-' }} @endif @if($isValidated) @else @endif @if(!$isValidated) @else @endif
Belum ada item. Cari produk di atas untuk menambahkan.
{{-- Items - Mobile Card View --}}
{{-- Status Change Modal --}} {{-- SweetAlert2 --}}