@extends('layouts.app') @section('title', 'Dispensing Tab') @section('styles') @endsection @section('content') {{-- Page header and global search removed per UI cleanup; each tab has its own filtering where appropriate. --}} {{-- Stats removed Issue #15: tab counts in the next block convey the same information (Queue / Dispensed Today / Partial) without the visual weight. Low Stock is still surfaced via the Low Stock submenu / dedicated drugs page. --}} {{-- Tabs --}}
| Time | Patient | Patient No. | Type | Prescriber | Payment | Stock | Status | Action |
|---|---|---|---|---|---|---|---|---|
| {{ $createdAt->format('H:i') }} |
{{ $patient->full_name ?? '–' }} {{-- Drug count moved inline under the name — cheap acknowledgement that this row may cover multiple pads, without re-introducing a Drugs column. --}}{{ $row->drug_count }} drug{{ $row->drug_count == 1 ? '' : 's' }}@if(($row->pad_count ?? 1) > 1) · {{ $row->pad_count }} pads @endif |
{{ $patient->mrn ?? '' }} | {{ $isIPD ? 'IPD' : 'OPD' }} | {{ $user->name ?? '' }} | @if($isUnpaid) Unpaid @else Cleared @endif | @if($allInStock) All In Stock @elseif($stockSummary['ok'] > 0 && $stockSummary['low'] > 0) {{ $stockSummary['low'] }} Low @else Low @endif | {{ $statusLabel }} | @if((int) ($row->visit_id ?? 0) > 0) Open @else — @endif |
| No pending prescriptions in queue. | ||||||||
| Return # | Item | Qty | Condition | Reason | Action Taken | By | Date |
|---|---|---|---|---|---|---|---|
| {{ $ret->return_number ?? $ret->id }} | {{ $ret->drug_name ?? '' }} | {{ $ret->quantity }} | {{ ucfirst($ret->condition ?? '–') }} | {{ Str::limit($ret->reason, 30) }} | {{ str_replace('_', ' ', ucfirst($ret->outcome ?? '')) }} | {{ $ret->processor->name ?? '' }} | {{ $ret->created_at->format('d M H:i') }} |
| No returns recorded. | |||||||
| Patient | Drug | Qty Prescribed | Qty Dispensed | Balance | Reason | Status | Date | Action |
|---|---|---|---|---|---|---|---|---|
| {{ $p->patient->full_name ?? '' }} | {{ $p->drug_name }} | {{ $p->quantity }} | {{ $qtyDispensed }} | {{ $p->quantity - $qtyDispensed }} | Insufficient stock | Partial | {{ $p->updated_at->format('d M') }} | Dispense Balance |
| No partial or pending items. | ||||||||
| View Dispensed Drugs | Date | Patient | MRN | Drugs | Prescriber | Action |
|---|---|---|---|---|---|---|
| @if($isLegacy) — @else {{ $groupId }} @endif |
{{ $created->format('d M Y') }} {{ $created->format('H:i') }} |
{{ $patient->full_name ?? '—' }} | {{ $patient->mrn ?? '' }} |
{{ $row->drug_count }} drug{{ $row->drug_count == 1 ? '' : 's' }} {{ \Illuminate\Support\Str::limit($row->drug_names, 80) }} |
{{ $user->name ?? '—' }} | @if($isLegacy) Legacy @else View / Print @endif |
|
No external prescriptions yet External prescriptions are for drugs the patient fills outside the hospital. |
||||||
| Date / Time | Drug | Patient | Qty | Unit Price | Total | Method | Dispensed By |
|---|---|---|---|---|---|---|---|
| {{ $sale->dispensed_at ? \Carbon\Carbon::parse($sale->dispensed_at)->format('d M H:i') : '—' }} | {{ $sale->drugItem->name ?? '—' }} |
@if($sale->patient_id && $sale->patient)
{{ $sale->patient->full_name }}
{{ $sale->patient->mrn }} @else Walk-in @endif |
{{ $sale->quantity_dispensed }} | {{ number_format($sale->unit_price, 2) }} | {{ number_format($sale->total_price, 2) }} | {{ str_replace('_', ' ', $sale->payment_mode) }} | {{ $sale->dispensedBy?->name ?? '—' }} |
| No OTC sales in this period. | |||||||