@extends('layouts.app') @section('title', 'New Procurement Request') @section('content')

New Procurement Request

Add drugs you need to restock. Admin will review and approve.

@if($errors->any())
@endif
@csrf
@if($suggested->count() > 0)

Suggested — Below Reorder Level

@foreach($suggested as $d)

{{ $d->name }}

Stock: {{ $d->current_stock }}  | Reorder: {{ $d->reorder_level }}

@endforeach
@endif

Drugs to Request

{{-- Inline add panel - no fixed positioning --}}
No drugs added yet. Use the suggestions above or click "+ Add Drug".

Request Details

How this works

1. Add drugs that need restocking

2. Submit to admin for approval

3. Admin reviews, adjusts quantities, and approves

4. You receive a notification when approved

@php $drugsForJs = $drugs->map(fn($d) => [ 'id' => $d->id, 'name' => $d->name, 'reorder' => (int)$d->reorder_level, 'stock' => (int)$d->current_stock, ])->values()->toArray(); @endphp {{-- IMPORTANT: close content before opening scripts. Without this @endsection the 'content' section silently swallowed everything including the @section('scripts') block, which broke the page layout — sidebar rendered at the bottom because the main flex container got pushed below the content somehow. --}} @endsection @section('scripts') @endsection