@extends('layouts.app') @section('title', 'Dashboard') @section('content')

📊 FOTOKOPI Operations Control

Real-time status parameters, decentralized stock entries, and shelf lifecycle alerts.

{{-- ─── Quick Action Cards ─── --}} {{-- ─── Stats Metrics Row ─── --}}

Total Products

{{ $stats['total_products'] }}

Low Stock Triggers

{{ $stats['low_stock_count'] }}

Today Check-In Flows

{{ $stats['today_checkins'] }}

Expiring Soon Queue

{{ $stats['expiring_soon'] }}

{{-- ─── MOVED: Expiry Reminder Component Table ─── --}}

Expiry Monitor

Tracking independent stock batch windows nearing their lifespan thresholds.

⚠️ 7-Day Threshold
@forelse($expiringItems as $item) @empty @endforelse
Batch Reference Item Category Allocation Remaining Volume Target Expiration Status
{{ method_exists($item, 'batches') ? $item->name : ($item->product->name ?? 'Unknown Item') }} {{ method_exists($item, 'batches') ? $item->category : ($item->product->category ?? '—') }} {{ method_exists($item, 'batches') ? $item->stock : ($item->remaining_quantity ?? $item->quantity ?? '0') }}{{ method_exists($item, 'batches') ? $item->unit : ($item->product->unit ?? '') }} {{ \Carbon\Carbon::parse($item->expiry_date)->format('d M Y') }} @php $daysLeft = (int) now()->startOfDay()->diffInDays(\Carbon\Carbon::parse($item->expiry_date)->startOfDay(), false); @endphp @if($daysLeft <= 0) Critical (Expired) @elseif($daysLeft === 1) Tomorrow @elseif($daysLeft <= 3) {{ $daysLeft }} Days Left @else {{ $daysLeft }} Days Left @endif
✨ Safe Zone: No batch records are flagged for expiration inside the current 7-day tracking window.
{{-- ─── Middle Row: Transactions + Low Stock ─── --}}

Today's Store Transactions

Live operational throughput logs for the current shift.

@forelse($todaysTransactions as $t) @empty @endforelse
Item Descriptor Action Type Adjustment Timestamp
{{ $t->product->name }} @if($t->type === 'check_in') Check-In @elseif($t->type === 'check_out') Check-Out @else {{ $t->type }} @endif {{ $t->type === 'check_in' ? '+' : '-' }}{{ $t->quantity }} {{ $t->created_at->format('g:i A') }}
No activity recorded during this transaction cycle.

Low Stock Alerts

Items whose combined batch stocks fall under target thresholds.

@forelse($lowStockProducts as $p)

{{ $p->name }}

Threshold: Minimum {{ $p->min_stock }} {{ $p->unit }}

{{ $p->stock }} {{ $p->unit }} left
@empty
🎉

Ledgers Clear

All ingredients are perfectly provisioned.

@endforelse
@endsection