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

Buat Stok Opname

@endsection @section('content')
Profil Perusahaan Apotek
@if ($companyProfileConfigurationError) @else
{{ $location->name }}
Batch aktif dari profil ini langsung digunakan untuk stok opname.
@endif
@if ($location)
Hitung Fisik — {{ $location->name }}
@if ($batches->isEmpty())
Belum ada batch barang pada lokasi ini. Tidak ada stok opname yang perlu dibuat.
@else @php($unpricedBatchCount = $batches ->filter(fn($batch) => $batch->drug->last_purchase_price === null && $batch->purchase_price === null) ->count())
@csrf
@error ('opname_date')
{{ $message }}
@enderror
@error ('notes')
{{ $message }}
@enderror
@error ('items')
{{ $message }}
@enderror
@foreach ($batches as $index => $batch) @php($oldItem = old("items.{$index}", [])) @php($unitCost = $batch->drug->last_purchase_price ?? $batch->purchase_price) @php($unitCostSource = $batch->drug->last_purchase_price !== null ? 'Harga beli terakhir' : ($batch->purchase_price !== null ? 'Harga batch' : null)) @endforeach
Barang Nomor Batch Kedaluwarsa Stok Sistem Stok Fisik Selisih Harga Beli Snapshot Nilai Selisih Keterangan
{{ $batch->drug->name }}
{{ $batch->drug->unit?->abbreviation ?: $batch->drug->unit?->name }}
{{ $batch->batch_number }} {{ \App\Helpers\DateHelper::formatDate( $batch->expired_date, ) }} {{ number_format($batch->current_qty, 0, ',', '.') }} 0 @if ($unitCost !== null)
Rp {{ number_format((float) $unitCost, 2, ',', '.') }}
{{ $unitCostSource }}
@else Belum memiliki harga @endif
{{ $unitCost !== null ? 'Rp 0' : '-' }}
Total Kekurangan
Rp 0
Total Kelebihan
Rp 0
Nilai Bersih
Rp 0
Status Valuasi
{{ $unpricedBatchCount > 0 ? $unpricedBatchCount . ' rincian belum memiliki harga' : 'Lengkap' }}
Batal
@endif
@endif @endsection @push('scripts') @endpush