@extends('layouts.master') @section('title', 'Stok Opname — ' . $so->nomor_opname) @section('styles') @endsection @section('content')

Stok Opname

Gudang → Stok Opname → {{ $so->nomor_opname }}
@if($so->isDraft()) @else Per Barang @endif Kembali
{{-- Info SO --}}
Nomor: {{ $so->nomor_opname }}
Gudang: {{ $so->gudang->nama }}
Tanggal: {{ $so->tanggal_opname->format('d-m-Y') }}
Status: @if($so->isDraft()) Draft @else Selesai @endif
Dibuat: {{ $so->dibuatOleh?->nama ?? '—' }}
{{-- Summary --}}
{{ $opnameItems->where('status_item','cocok')->count() }}
Cocok
{{ ($stoksGudang->count() - $opnameItems->count()) + $opnameItems->where('status_item','kurang')->count() }}
Kurang / Belum
{{ $opnameItems->where('status_item','lebih')->count() }}
Lebih
{{ $anomaliItems->count() }}
Anomali
{{-- Panel Scan + Foto (1 kolom kiri) --}}
{{-- Card Scan (hanya draft) --}} @if($so->isDraft())
Scan Barang Fisik

Gunakan kamera AI untuk memverifikasi barang fisik secara otomatis.

@endif {{-- Hidden fotoGrid saat draft agar JS addFotoToGrid tidak error --}} @if($so->isDraft()) @endif {{-- Card Foto (hanya tampil saat selesai) --}} @if(!$so->isDraft())
Foto Stok Opname
{{ $so->fotos->count() }}
{{-- Foto Scan --}} @php $fotoScans = $so->fotos->filter(fn($f) => in_array($f->tipe, ['scan', null, ''])); @endphp @if($fotoScans->count())
Foto Scan
@foreach($fotoScans as $foto)
@endforeach
@else
@endif {{-- Upload Hardcopy SO --}}
Hardcopy SO
@php $fotoHardcopy = $so->fotos->where('tipe', 'hardcopy'); @endphp
@foreach($fotoHardcopy as $foto)
@endforeach
{{-- Foto Petugas RS --}}
Foto Petugas RS
@php $fotoPetugas = $so->fotos->where('tipe', 'foto_petugas'); @endphp
@foreach($fotoPetugas as $foto)
@endforeach
Nama Petugas RS
{{-- TTD Digital RS --}}
TTD Digital Rumah Sakit
@php $fotoTtd = $so->fotos->where('tipe','ttd_rs')->first(); @endphp @if($fotoTtd)
@else
@endif
@endif
{{-- Tabel Stok Sistem --}}
Daftar Stok Sistem ({{ $stoksGudang->count() }} item)
@if($so->isDraft()) Ketik langsung pada kolom Fisik, tekan Enter/Tab untuk menyimpan @endif
@if(!empty($sjMap)) @endif @foreach($stoksGudang as $idx => $stok) @php $item = $opnameItems->get($stok->id); $sjKey = $stok->no_serial ? 'sn:'.$stok->no_serial : ($stok->no_lot ? 'lot:'.$stok->no_lot : null); $sjRow = $sjKey ? ($sjMap[$sjKey] ?? null) : null; @endphp @if(!empty($sjMap)) @endif @endforeach @if($stoksGudang->isEmpty()) @endif
No Barang No Lot No Serial EDNo. Pengiriman Tgl. KirimSistem Fisik Selisih Status
{{ $idx + 1 }} {{ $stok->barang?->nama ?? '—' }} @if($stok->barang?->ukuran){{ $stok->barang->ukuran }}@endif {{ $stok->no_lot ?: '—' }} {{ $stok->no_serial ?: '—' }} {{ $stok->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }}{{ $sjRow['nomor_sj'] ?? '—' }} {{ $sjRow['tanggal'] ?? '—' }}{{ $stok->qty }} @if($so->isDraft()) @else {{ $item ? $item->qty_fisik : '—' }} @endif @if($item) {{ $item->selisih > 0 ? '+' : '' }}{{ $item->selisih }} @else — @endif @if($item) @include('gudang.stok-opname._chip-status', ['status' => $item->status_item]) @else Belum @endif
Tidak ada stok di gudang ini.
{{-- Card Anomali --}}
Anomali — Tidak Ada di Sistem
@if($so->isDraft()) @endif {{ $anomaliItems->count() }}
@if($so->isDraft()) @endif @forelse($anomaliItems as $item) @if($so->isDraft()) @endif @empty @endforelse
Nama / Keterangan No Lot No Serial ED Qty
{{ $item->nama_barang_scan ?: '(tidak dikenali)' }} @if($item->barang_id) Tercocokkan @endif {{ $item->no_lot ?: '—' }} {{ $item->no_serial ?: '—' }} {{ $item->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $item->qty_fisik }}
Tidak ada item anomali.
{{-- Fullscreen Scan Overlay --}} @if($so->isDraft()) @endif {{-- Modal Cocokkan Anomali --}} {{-- Modal Tambah Anomali Manual --}} {{-- Modal Edit Qty --}} @endsection @section('scripts') @if(!$so->isDraft()) @endif @endsection