@extends('layouts.app') @section('title', 'Pharmacy | Stock Take') @section('styles') @endsection @section('content') @php $authUser = Auth::user(); $isFullAccess = $authUser->hasAnyRole('Super Admin','Hospital Admin','Pharmacy User'); @endphp {{-- Drug Inventory tab bar — Stock Take is part of the Drug Inventory group --}}
Drug Inventory @if($isFullAccess) Suppliers Stock Take @endif
@php $history = \App\Models\StockMovement::with(['drugItem', 'creator']) ->where('type', 'adjustment') ->orderByDesc('created_at') ->limit(200) ->get(); $historyGroups = $history->groupBy('reference'); @endphp

Stock Take

Enter physical counts to reconcile system quantities. Leave blank to skip a drug.

Adjustments are permanent and logged
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif {{-- Filters --}}
@if(request()->hasAny(['search','category'])) Clear @endif
@csrf {{-- Reason --}}

Applied to all adjustments in this session and saved in the audit log.

{{-- Drug table --}}

Drugs in Stock

{{ $drugs->count() }} drug(s) shown

0 changes pending
@forelse($drugs as $drug) @php $sysQty = $drug->system_qty; @endphp @empty @endforelse
Drug Category System Qty Physical Count Difference Save

{{ $drug->name }}

{{ $drug->generic_name }}  ·  {{ $drug->code }}

{{ $drug->category }} {{ $sysQty }} {{ $drug->unit }}
No drugs with stock found. @if(request()->hasAny(['search','category'])) Clear filters @endif
{{-- Submit --}} @if($drugs->count() > 0)

Save each drug individually using its Save button, or use Save All Remaining to commit every unsaved row at once.

Cancel
@endif
{{-- History — collapsible, at the very bottom --}} @if($historyGroups->count() > 0)
@endif @endsection