@php use Carbon\Carbon; $namaPerush = $profile->nama_perusahaan ?? 'IDEMEDIKA'; $alamat = $profile->alamat ?? ''; $logoPath = ($profile->logo_desktop && \Storage::disk('public')->exists($profile->logo_desktop)) ? storage_path('app/public/' . $profile->logo_desktop) : null; $totalKurang = $itemsKurang->count() + $stoksBelumDiscan->count(); @endphp {{-- KOP --}}
@if($logoPath) @endif
{{ $namaPerush }}
@if($alamat)
{{ $alamat }}
@endif @if($profile->no_telp_1 ?? null)
Telp: {{ $profile->no_telp_1 }}
@endif
Laporan Stok Opname
{{ $so->nomor_opname }}
Selesai
{{-- META --}}
Gudang
{{ $so->gudang->nama }}
Diselesaikan
{{ $so->diselesaikan_at ? Carbon::parse($so->diselesaikan_at)->format('d-m-Y H:i') : '—' }}
Tanggal
{{ $so->tanggal_opname->format('d-m-Y') }}
Oleh
{{ $so->diselesaikanOleh?->nama ?? '—' }}
{{-- SUMMARY --}}
{{ $itemsCocok->count() }}Cocok {{ $totalKurang }}Kurang / Belum {{ $itemsLebih->count() }}Lebih {{ $itemsAnomali->count() }}Anomali
{{-- 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 {{-- KURANG --}} @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 Ket.
{{ $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 {{-- LEBIH --}} @if($itemsLebih->count() > 0)
Stok Lebih ({{ $itemsLebih->count() }} item)
@foreach($itemsLebih as $item) @endforeach
Barang No Lot No Serial Kedaluwarsa Sistem Fisik Selisih
{{ $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 {{-- ANOMALI --}} @if($itemsAnomali->count() > 0)
Anomali — Tidak Ada di Sistem ({{ $itemsAnomali->count() }} item)
@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 }} {{ $item->status_item === 'anomali_barang' ? 'Barang tdk dikenal' : 'Stok tdk ditemukan' }}
@endif {{-- SEMUA COCOK --}} @if($totalKurang === 0 && $itemsLebih->count() === 0 && $itemsAnomali->count() === 0)

Semua item cocok. Tidak ditemukan selisih stok.

@endif {{-- CATATAN --}}
Catatan:
{{-- TTD --}}
Dibuat oleh
{{ $so->dibuatOleh?->nama ?? '—' }}
Kepala Gudang
(................................)
Pihak Rumah Sakit
@if(!empty($ttdFoto))@endif
@if($so->nama_petugas_rs)({{ $so->nama_petugas_rs }})@else(................................)@endif