@extends('layouts.app') @section('title', 'Detail Stok Opname - MCU Klinik Mustika') @section('breadcrumb')

Detail Stok Opname

@endsection @section('content') @php($statusClass = ['draft' => 'bg-warning', 'completed' => 'bg-success', 'cancelled' => 'bg-secondary'][$stockOpname->status] ?? 'bg-secondary')
{{ $stockOpname->opname_number }}
{{ ucfirst($stockOpname->status) }}
Tanggal Opname
{{ \App\Helpers\DateHelper::formatDate( $stockOpname->opname_date, ) }}
Lokasi
{{ $stockOpname->location->name }}
Dibuat Oleh
{{ $stockOpname->creator->name }}
Diterapkan Oleh
{{ $stockOpname->approver?->name ?: '-' }}
Keterangan
{{ $stockOpname->notes ?: '-' }}
Total Kekurangan
Rp {{ number_format($stockOpname->total_shortage_value, 2, ',', '.') }}
Total Kelebihan
Rp {{ number_format($stockOpname->total_surplus_value, 2, ',', '.') }}
Nilai Bersih
Rp {{ number_format($stockOpname->net_difference_value, 2, ',', '.') }}
Status Valuasi
{{ $stockOpname->unpriced_items_count > 0 ? $stockOpname->unpriced_items_count . ' rincian belum memiliki harga' : 'Lengkap' }}
Rincian Perhitungan
@foreach ($stockOpname->items as $item) @endforeach
No. Barang Batch Stok Sistem Stok Fisik Selisih Harga Beli Snapshot Nilai Selisih Keterangan
{{ $loop->iteration }}
{{ $item->drug->name }}
{{ $item->drug->unit?->abbreviation ?: $item->drug->unit?->name }}
{{ $item->drugBatch?->batch_number ?: '-' }} {{ number_format($item->system_qty, 0, ',', '.') }} {{ number_format($item->actual_qty, 0, ',', '.') }} {{ number_format($item->difference_qty, 0, ',', '.') }} @if ($item->unit_cost_snapshot !== null)
Rp {{ number_format((float) $item->unit_cost_snapshot, 2, ',', '.') }}
{{ $item->unit_cost_source === 'last_purchase_price' ? 'Harga beli terakhir' : 'Harga batch' }}
@else Belum memiliki harga @endif
{{ $item->difference_value !== null ? 'Rp ' . number_format((float) $item->difference_value, 2, ',', '.') : '-' }} {{ $item->notes ?: '-' }}
Kembali @if ($stockOpname->status === 'draft') @can ('manage-stock-opname')
@csrf
@endcan @can ('approve-stock-opname') @if ((int) $stockOpname->created_by !== (int) auth()->id())
@csrf
@else Menunggu persetujuan pengguna lain @endif @endcan @endif
@endsection