@extends('hms.layout') @section('title','Inventory & procurement') @section('content')

Organisation-wide catalogue and suppliers · facility-scoped stores and stock · direct entry for stock already on hand · auditable purchase orders and receipts.

@if($manager)

Add current stock

Record stock already on hand without a supplier or purchase order. Choose an existing catalogue item and store, then enter the physical batch and quantity in stock units. Opening balances create new batches; unrecorded stock adds quantity to a new or matching batch. Use batch adjustments below to reconcile an existing balance.

@if($stores->isEmpty() || $items->where('active',true)->isEmpty())

Create a store and an active catalogue item using the forms below before adding stock.

@else
@csrf
This entry does not create a purchase order, supplier payment or expense.
@endif
New catalogue item
@csrf
New store
@csrf
New supplier
@csrf
@endif @if($manager || \App\Models\Hms\Membership::where('organization_id',session('hms_organization_id'))->where('user_id',auth()->id())->whereIn('role',['pharmacist','procurement_officer'])->exists())
New purchase order
@csrf
@endif
Purchase orders
@forelse($orders as $po)@empty@endforelse
OrderSupplierDestinationStatusItems / receiving
{{ $po->number }}{{ $po->supplier_name }}{{ $po->store_name }}{{ str_replace('_',' ',$po->status) }} @if($manager && $po->status==='draft')
@csrf
@endif
@foreach($lines[$po->id]??[] as $line)
{{ $line->item_name }} · {{ $line->quantity_received }}/{{ $line->quantity_ordered }} @if(in_array($po->status,['approved','partially_received']) && $line->quantity_received<$line->quantity_ordered)
@csrf
@endif
@endforeach
No purchase orders yet.
@if($manager)
Transfer stock between stores
@csrf
@endif
Stock by batch
@forelse($batches as $b)@empty@endforelse
ItemStoreBatchExpiryAvailableCost per unitReorder levelAdjustment
{{ $b->item_name }}{{ $b->store_name }}{{ $b->batch_number }}{{ $b->expires_on??'—' }}{{ $b->quantity_on_hand }} {{ $b->unit }}{{ number_format($b->unit_cost,4) }}{{ $b->reorder_level }}@if($manager)
@csrf
@endif
No stock recorded yet.
{{ $batches->links() }}
@if($manager)
Recent direct stock entries
@forelse($stockEntries as $entry) @empty @endforelse
Date / recorded byItem / storeBatch / expiryQuantity addedEntry type / reason
{{ $entry->created_at }}
{{ $entry->actor_name }}
{{ $entry->item_name }}
{{ $entry->store_name }}
{{ $entry->batch_number }}
{{ $entry->expires_on??'Not recorded' }}
+{{ $entry->quantity }} {{ $entry->unit }}{{ $entry->entry_kind==='opening_balance'?'Opening balance':'Unrecorded stock' }}
{{ $entry->reason }}
No direct stock entries in this scope.
@endif @endsection