@extends('layouts.app') @section('title', 'Dispensed Products') @section('content') {{-- ───────────────────────────────────────────────────────────────────── Dispensed Products page (admin only). Lists recent PharmacyDispense rows so admins can find a wrong dispense and click Reverse. The Reverse modal at the bottom posts to the same /pharmacy/dispenses/{id}/reverse endpoint as the per- visit dispense form, so all the safety + audit + invoice handling is shared. ───────────────────────────────────────────────────────────────────── --}}
Recent dispense events · Back to Pharmacy
Total Dispenses
{{ number_format($stats['total']) }}
Active
{{ number_format($stats['active']) }}
Reversed
{{ number_format($stats['reversed']) }}
Refund Pending
{{ number_format($stats['refund_pending']) }}
Showing dispenses from {{ $from->format('d M Y') }} to {{ $to->format('d M Y') }}. Default window is the last 7 days.
| Date / Time | Patient | Drug | Qty | Total (KES) | Dispensed By | Status | Action |
|---|---|---|---|---|---|---|---|
|
{{ $disp->dispensed_at?->format('d M Y') }} {{ $disp->dispensed_at?->format('H:i') }} |
@if($patient)
{{ trim(($patient->first_name ?? '') . ' ' . ($patient->last_name ?? '')) ?: '—' }}
{{ $patient->mrn ?? '' }}
@else
—
@endif
|
{{ $drug->name ?? ($disp->prescription->drug_name ?? '—') }}
@if($drug && $drug->strength)
{{ $drug->strength }}
@endif
|
{{ $disp->quantity_dispensed }} | {{ number_format($disp->total_price ?? 0, 2) }} | {{ $disp->dispensedBy->name ?? '—' }} |
@if($isRev)
REVERSED
@if($disp->refund_status === 'pending')
REFUND PENDING
@endif
by {{ $disp->reversedBy->name ?? 'unknown' }}
· {{ $disp->reversed_at?->format('d M Y, H:i') }}
@if($disp->reversal_reason)
"{{ Str::limit($disp->reversal_reason, 80) }}"
@endif
@else
ACTIVE
@endif
|
@if(!$isRev) @endif @if($disp->prescription && $disp->prescription->visit_id) View visit @endif |
| No dispenses found in this date range. @if($q || $status !== 'all') Try clearing the search or switching status to "All". @endif | |||||||
Returns — unit(s) of — to stock.