@php $fmt = fn ($n) => number_format((float) $n, 0); $summary = $summary ?? []; $priorSummary = $priorSummary ?? []; $comparison = $comparison ?? []; $insights = $insights ?? []; $operations = $operations ?? []; $flowChart = $flowChart ?? ['labels' => [], 'values' => []]; $monthlyPurchases = $monthlyPurchases ?? array_fill(0, 12, 0); $monthLabels = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; $heroTone = $insights['hero_tone'] ?? 'info'; $toneMap = ['success' => 'success', 'warning' => 'warning', 'info' => 'primary', 'secondary' => 'secondary']; $heroClass = 'alert-' . ($toneMap[$heroTone] ?? 'primary'); $pctBadge = function ($pct) { if ($pct === null) { return '—'; } $up = $pct >= 0; $icon = $up ? 'bx-up-arrow-alt' : 'bx-down-arrow-alt'; $cls = $up ? 'text-success' : 'text-danger'; return ' ' . number_format(abs($pct), 1) . '% vs prior year'; }; @endphp
{{ $insights['hero'] ?? '' }}
@foreach($insights['alerts'] ?? [] as $alert){{ $alert['text'] }}
@endforeach{{ $insights['management_sub'] ?? '' }}
Purchased FAQ compared with outbound sales, beverage transfers, and estimated stock still on hand.