Dashboard
{{-- Consolidated view: one row per brand so each can be compared at a glance. Only shown when no brand or supplier is picked; picking either narrows every card below to it. --}} @if ($brandBreakdown->isNotEmpty())
@if ($can['sales']) @endif @if ($can['purchases']) @endif @if ($can['inventory']) @endif @foreach ($brandBreakdown as $row) @if ($can['sales']) @endif @if ($can['purchases']) @endif @if ($can['inventory']) @endif @endforeach @if ($can['sales']) @endif @if ($can['purchases']) @endif @if ($can['inventory']) @endif
BrandSales Gross profitPurchasesStock value
{{ $row['name'] }}{{ number_format($row['sales'], 2) }} {{ number_format($row['profit'], 2) }}{{ number_format($row['purchases'], 2) }}{{ number_format($row['stock'], 2) }}
All brands{{ number_format($brandBreakdown->sum('sales'), 2) }} {{ number_format($brandBreakdown->sum('profit'), 2) }}{{ number_format($brandBreakdown->sum('purchases'), 2) }}{{ number_format($brandBreakdown->sum('stock'), 2) }}
@endif {{-- Headline KPIs: the three numbers this dashboard leads with, each with a trailing-12-day trend (independent of the picker above) and a period-over-period delta. --}} @if ($can['sales'] || $can['purchases'])
@if ($salesKpi) @php $tooltips = collect($trendDates)->map(fn ($d, $i) => "{$d}: ".number_format($salesKpi['trend'][$i], 2))->all(); @endphp
Sales in period
{{ number_format($salesKpi['total'], 2) }}
{{ $salesKpi['count'] }} sale(s)@if ($salesKpi['returns'] > 0) · net of {{ number_format($salesKpi['returns'], 2) }} returned @endif
@endif @if ($purchasesKpi) @php $tooltips = collect($trendDates)->map(fn ($d, $i) => "{$d}: ".number_format($purchasesKpi['trend'][$i], 2))->all(); @endphp
Purchases received in period
{{ number_format($purchasesKpi['total'], 2) }}
{{ $purchasesKpi['count'] }} receipt(s)@if ($purchasesKpi['returns'] > 0) · net of {{ number_format($purchasesKpi['returns'], 2) }} returned @endif
@endif @if ($profitKpi) @php $tooltips = collect($trendDates)->map(fn ($d, $i) => "{$d}: ".number_format($profitKpi['trend'][$i], 2))->all(); @endphp
Gross profit in period
{{ number_format($profitKpi['total'], 2) }}
@if ($profitKpi['scheme_benefit'] > 0)
+ {{ number_format($profitKpi['scheme_benefit'], 2) }} saved on free units received
@endif
@endif
@endif {{-- Secondary stats: quieter than the headline row (no big sparkline/delta), grouped by concern. --}}
@if ($can['inventory'] || $can['products']) @endif @if ($can['customers'] || $can['suppliers']) @endif
@if ($can['inventory'])

Fast-Moving Products

View all →
@if ($fastMoving->isEmpty()) @else
@foreach ($fastMoving as $product)
{{ $product->name }}
{{ $product->units_sold }} sold
@endforeach
@endif

Slow-Moving / Dead Stock

View all →
@if ($slowMoving->isEmpty()) @else
@foreach ($slowMoving as $product)
{{ $product->name }}
{{ $product->units_sold }} sold
@endforeach
@endif
@endif @if ($can['sales'] || $can['purchases'])
@if ($can['sales'])

Recent Sales in Period

@if ($recentSales->isEmpty()) @else @endif
@endif @if ($can['purchases'])

Recent Goods Received in Period

@if ($recentPurchases->isEmpty()) @else @endif
@endif
@endif