@extends('layouts.admin') @section('title', 'Dashboard') @section('subtitle', now()->format('l, F d, Y')) @section('content')
{{-- Stats Cards --}}
{{-- Today's Sales --}}
๐Ÿ’ฐ Today

Today's Sales

LKR {{ number_format($todaySales, 2) }}

{{-- Today's Invoices --}}
๐Ÿงพ Today

Invoices

{{ number_format($todayInvoices) }}

{{-- Today's Profit --}}
๐Ÿ“ˆ Profit

Today's Profit

LKR {{ number_format($todayProfit, 2) }}

{{-- Monthly Sales --}}
๐Ÿ“Š {{ now()->format('M') }}

This Month

LKR {{ number_format($monthSales, 2) }}

{{-- Charts and Lists --}}
{{-- Weekly Sales Chart --}}

Weekly Sales

@php $maxSale = max($weeklyData ?: [1]); $days = []; for ($i = 6; $i >= 0; $i--) { $date = now()->subDays($i)->format('Y-m-d'); $days[$date] = $weeklyData[$date] ?? 0; } @endphp @foreach($days as $date => $amount)
{{ \Carbon\Carbon::parse($date)->format('D') }}
@endforeach
{{-- Low Stock Alerts --}}

Low Stock Alerts

โš ๏ธ
@if($lowStockProducts->count() > 0)
@foreach($lowStockProducts as $stock)

{{ $stock->product->name_en }}

Min: {{ $stock->product->min_stock }}

{{ number_format($stock->quantity) }} {{ $stock->product->unit }}
@endforeach
@else

โœ…

All stock levels OK

@endif
{{-- Recent Transactions --}}

Recent Transactions

@if($unsyncedCount > 0) ๐Ÿ”„ {{ $unsyncedCount }} pending sync @endif
@if($recentInvoices->count() > 0)
@foreach($recentInvoices as $invoice) @endforeach
Invoice # Cashier Items Total Time Status
{{ $invoice->invoice_number }} {{ $invoice->user->name }} {{ $invoice->items_count ?? $invoice->items->count() }} items LKR {{ number_format($invoice->total, 2) }} {{ $invoice->created_at->format('H:i') }} @if($invoice->status === 'completed') Paid @else {{ ucfirst($invoice->status) }} @endif
@else

๐Ÿ“‹

No transactions yet

@endif
@endsection