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

Hasil Stok Opname

Gudang → Stok Opname → {{ $so->nomor_opname }} → Hasil
Kembali
{{-- Info SO --}}
Nomor: {{ $so->nomor_opname }}
Gudang: {{ $so->gudang->nama }}
Tanggal: {{ $so->tanggal_opname->format('d-m-Y') }}
Status: Selesai
Diselesaikan: {{ $so->diselesaikanOleh?->nama ?? '—' }}
{{-- Card Foto Stok Opname --}} @php $fotoScans = $so->fotos->filter(fn($f) => in_array($f->tipe, ['scan', null, ''])); $fotoHardcopy = $so->fotos->where('tipe', 'hardcopy'); $fotoPetugas = $so->fotos->where('tipe', 'foto_petugas'); $fotoTtd = $so->fotos->where('tipe', 'ttd_rs')->first(); @endphp @if($so->fotos->count() > 0)
Foto Stok Opname
{{ $so->fotos->count() }}
{{-- Foto Scan --}} @if($fotoScans->count())
Foto Scan
@foreach($fotoScans as $foto) @endforeach
@endif {{-- Hardcopy SO --}} @if($fotoHardcopy->count())
Hardcopy SO
@foreach($fotoHardcopy as $foto) @endforeach
@endif {{-- Foto Petugas RS --}} @if($fotoPetugas->count() || $so->nama_petugas_rs)
Foto Petugas RS
@if($so->nama_petugas_rs)
{{ $so->nama_petugas_rs }}
@endif @if($fotoPetugas->count())
@foreach($fotoPetugas as $foto) @endforeach
@endif
@endif {{-- TTD Digital RS --}} @if($fotoTtd)
TTD Digital Rumah Sakit
@endif
@endif {{-- Summary Cards --}} @php $totalKurang = $itemsKurang->count() + $stoksBelumDiscan->count(); @endphp
{{ $itemsCocok->count() }}
Item Cocok
{{ $totalKurang }}
Stok Kurang / Tidak Ditemukan
@if($stoksBelumDiscan->count() > 0)
{{ $stoksBelumDiscan->count() }} belum discan
@endif
{{ $itemsLebih->count() }}
Stok Lebih
@if($itemsLebih->count() > 0)
Selisih: +{{ $itemsLebih->sum('selisih') }} pcs
@endif
{{ $itemsAnomali->count() }}
Anomali
{{-- 1. Cocok --}} @if($itemsCocok->count() > 0)
Stok Cocok ({{ $itemsCocok->count() }} item)
@foreach($itemsCocok as $item) @endforeach
Barang No Lot No Serial Kedaluwarsa Sistem Fisik
{{ $item->nama_barang_scan ?? $item->barang?->nama ?? '—' }} {{ $item->no_lot ?: '—' }} {{ $item->no_serial ?: '—' }} {{ $item->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $item->qty_sistem }} {{ $item->qty_fisik }}
@endif {{-- 2. Stok Kurang + Belum Discan --}} @if($totalKurang > 0)
Stok Kurang / Tidak Ditemukan ({{ $totalKurang }} item)
@foreach($itemsKurang as $item) @endforeach @foreach($stoksBelumDiscan as $stok) @endforeach
Barang No Lot No Serial Kedaluwarsa Sistem Fisik Selisih Keterangan
{{ $item->nama_barang_scan ?? $item->barang?->nama ?? '—' }} {{ $item->no_lot ?: '—' }} {{ $item->no_serial ?: '—' }} {{ $item->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $item->qty_sistem }} {{ $item->qty_fisik }} {{ $item->selisih }} Kurang
{{ $stok->barang?->nama ?? '—' }} @if($stok->barang?->ukuran){{ $stok->barang->ukuran }}@endif {{ $stok->no_lot ?: '—' }} {{ $stok->no_serial ?: '—' }} {{ $stok->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $stok->qty }} — — Belum Discan
@endif {{-- 2. Stok Lebih --}} @if($itemsLebih->count() > 0)
Stok Lebih ({{ $itemsLebih->count() }} item)
@foreach($itemsLebih as $item) @endforeach
Barang No Lot No Serial Kedaluwarsa Sistem Fisik Selisih Kondisi
{{ $item->nama_barang_scan ?? $item->barang?->nama ?? '—' }} {{ $item->no_lot ?: '—' }} {{ $item->no_serial ?: '—' }} {{ $item->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $item->qty_sistem }} {{ $item->qty_fisik }} +{{ $item->selisih }}
@endif {{-- 3. Anomali --}} @if($itemsAnomali->count() > 0)
Anomali — Tidak Ada di Sistem ({{ $itemsAnomali->count() }} item)

Barang ditemukan secara fisik namun tidak terdapat catatan stok di sistem.

@foreach($itemsAnomali as $item) @endforeach
Barang / Nama Scan No Lot No Serial Kedaluwarsa Qty Fisik Keterangan
{{ $item->nama_barang_scan ?? $item->barang?->nama ?? '—' }} {{ $item->no_lot ?: '—' }} {{ $item->no_serial ?: '—' }} {{ $item->tanggal_kedaluwarsa?->format('d-m-Y') ?? '—' }} {{ $item->qty_fisik }} @if($item->status_item === 'anomali_barang') Barang tdk dikenal @else Stok tdk ditemukan @endif
@endif {{-- Semua Cocok --}} @if($totalKurang === 0 && $itemsLebih->count() === 0 && $itemsAnomali->count() === 0)
Semua item cocok! Tidak ditemukan selisih stok pada opname ini.
@endif
{{-- Modal Preview PDF --}} @endsection @section('scripts') @endsection