@extends('layouts.app') @section('title', 'Dashboard') @section('content') @php $u = auth()->user(); @endphp {{-- ---------------- Quick Links ---------------- --}}
@if($u->canManagePatients()) Add Patient Patient Reports @endif @if($u->canManageInventory()) Add Ingredient Use Ingredient Add Product POS Sale Ingredient Reports Product Reports @endif
{{-- ---------------- Patient Summary ---------------- --}} @if($u->canManagePatients())
Patient Summary
Total Patients

{{ $totalPatients }}

Today's Patients

{{ $todaysPatients }}

Upcoming Follow-ups

{{ $upcomingFollowUps->count() }}

Recent Visits

{{ $latestVisits->count() }}

Today's Patient Fee
{{ number_format($todaysFees->total_fee, 2) }}
Today's Received Fee
{{ number_format($todaysFees->total_received, 2) }}
Today's Remaining Fee
{{ number_format($todaysFees->total_remaining, 2) }}
Today's Discount Fee
{{ number_format($todaysFees->total_discount, 2) }}
Recent Patients
@forelse($recentPatients as $p) @empty @endforelse
SerialNameLast Visit
{{ $p->serial_number }}{{ $p->name }}{{ optional($p->latestVisit)->visit_date?->format('d M Y') ?? '—' }}
No patients yet.
Follow-up Patients
@forelse($upcomingFollowUps as $v) @empty @endforelse
PatientDoctorDate
{{ $v->patient->name ?? '—' }}{{ $v->doctor_name ?? '—' }}{{ $v->follow_up_date?->format('d M Y') }}
No upcoming follow-ups.
Latest Patient Records
@forelse($latestVisits as $v) @empty @endforelse
PatientVisitStatus
{{ $v->patient->name ?? '—' }}{{ $v->visit_date->format('d M Y') }}{{ $v->statusLabel() }}
No visits yet.
@endif {{-- ---------------- Ingredient Inventory Summary ---------------- --}} @if($u->canManageInventory())
Ingredient Inventory Summary
Total Ingredients

{{ $totalIngredients }}

Ingredient Categories

{{ $totalIngredientCategories }}

Low Stock (< 100 g)

{{ $lowStockIngredients->count() }}

Out of Stock

{{ $outOfStockIngredients->count() }}

Low / Out of Stock Ingredients
Recent Stock Entries
    @forelse($recentStockEntries as $e)
  • IN {{ $e->ingredient->name ?? '—' }} ({{ \App\Models\Ingredient::trimNum($e->quantity) }} {{ $e->unit }}) from {{ $e->supplier_name }} — {{ $e->date->format('d M') }}
  • @empty
  • No recent stock entries.
  • @endforelse
Recent Ingredient Usage
    @forelse($recentUsages as $us)
  • OUT {{ $us->ingredient->name ?? '—' }} ({{ \App\Models\Ingredient::trimNum($us->quantity) }} {{ $us->unit }}) — {{ $us->usage_date->format('d M') }}
  • @empty
  • No recent usage.
  • @endforelse
{{-- ---------------- Product Summary ---------------- --}}
Product Summary Open POS
Total Products

{{ $totalProducts }}

Low Stock Products

{{ $lowStockProducts->count() }}

Out of Stock Products

{{ $outOfStockProducts->count() }}

Today's Sales

{{ number_format($todaysSales->total, 2) }}

{{ $todaysSales->count }} invoice(s)
Out of Stock Products
Low Stock Products
Recent POS Sales
@endif @endsection