@extends('business.layout') @section('title', 'Dashboard') @section('content')
+ New Sale + Add Product Receive Stock + Add Expense
@foreach(['today'=>'Today','yesterday'=>'Yesterday','week'=>'This Week','month'=>'This Month'] as $k=>$lbl) {{ $lbl }} @endforeach
Sales ({{ ucfirst($range) }})
UGX {{ number_format((float)$salesTotal) }}
{{ $salesCount }} sales
Profit ({{ ucfirst($range) }})
UGX {{ number_format((float)$netProfit) }}
Gross: UGX {{ number_format((float)$grossProfit) }}
Expenses
UGX {{ number_format((float)$todayExpenses) }}
Total Products
{{ number_format($totalProducts) }}
Stock Value: UGX {{ number_format((float)$stockValue) }}

Last 7 Days Sales Trend (UGX)

@php $maxVal = max(1, max($chartValues ?: [1])); @endphp
@foreach($chartValues as $idx => $val) @php $pct = round(($val / $maxVal) * 100); @endphp
{{ $chartLabels[$idx] }}
@endforeach

Low Stock Alerts

@if($lowStockProducts->isEmpty())

All tracked products are well stocked.

@else
@foreach($lowStockProducts as $lp) @endforeach
ProductStockReorder
{{ $lp->name }} {{ $lp->quantity }} {{ $lp->reorder_level }}
@endif

Recent Transactions

@forelse($recentSales as $s) @empty @endforelse
ReceiptCustomerCashierTotal (UGX)StatusTime
{{ $s->receipt_number }} {{ $s->customer->name ?? 'Walk-in' }} {{ $s->user->name ?? '-' }} UGX {{ number_format((float)$s->total_amount) }} {{ $s->status }} {{ $s->sold_at?->format('Y-m-d H:i') }}
No sales recorded yet.
@endsection