@extends('layouts.app') @section('title','Tableau de bord') @section('page-title','Tableau de bord') @section('topbar-actions') {{ now()->isoFormat('dddd D MMMM YYYY') }} @endsection @section('content') {{-- ── Stats row ──────────────────────────────────────────── --}}
{{-- ── Chiffre d'affaires par mois (retour utilisateur INSTALL.md 17/08, point 8) : vue par année + graphique en barres SVG fait à la main (pas de librairie externe, cohérent avec la règle "zéro nouvelle dépendance" déjà actée à l'étape 4 pour éviter une lib PDF). ────── --}} @php $moisLabels = ['Jan','Fév','Mar','Avr','Mai','Juin','Juil','Août','Sep','Oct','Nov','Déc']; $maxTotal = max($revenueChart->max('total'), 1); $chartW = 760; $chartH = 180; $barGap = 6; $barW = ($chartW / 12) - $barGap; @endphp
Chiffre d'affaires
@foreach($revenueChart as $i => $m) @php $barH = $maxTotal > 0 ? max(($m['total'] / $maxTotal) * $chartH, $m['total'] > 0 ? 3 : 0) : 0; $x = $i * ($barW + $barGap); $y = $chartH - $barH; @endphp {{ $moisLabels[$i] }} {{ $year }} — {{ number_format($m['total'],0,',',' ') }} XAF ({{ $m['nb'] }} vente(s)) {{ $moisLabels[$i] }} @endforeach
@foreach($revenueChart as $i => $m) @endforeach
MoisVentesChiffre d'affaires
{{ $moisLabels[$i] }} {{ $year }} {{ $m['nb'] }} {{ number_format($m['total'],0,',',' ') }} XAF
{{-- ── Relances à faire (retour utilisateur INSTALL.md 17/08, point 2) ── --}}
Relances à faire
@forelse($dueFollowUps as $fu) @empty @endforelse
ClientDateNote
{{ $fu->client?->name }} {{ $fu->scheduled_date->format('d/m/Y H:i') }} {{ $fu->notes ?? '—' }}
@csrf @method('PUT')

Aucune relance en attente ✓

{{-- ── Main grid ──────────────────────────────────────────── --}}
{{-- Recent Sales --}}
Dernières ventes
Voir tout →
@forelse($recentSales as $sale) @empty @endforelse
RéférenceClientMontantStatut
{{ $sale->reference }} {{ $sale->client?->name ?? '—' }} {{ number_format($sale->amount,0,',',' ') }} XAF {{ $sale->status_label }}

Aucune vente

{{-- Low stock --}}
Stock critique
Voir tout →
@forelse($lowStockProducts as $p) @empty @endforelse
ProduitRéf.StockSeuil
{{ $p->name }} {{ $p->reference }} {{ $p->stock }} {{ $p->alert_stock }}

Stocks OK ✓

{{-- ── Recent movements + Quick actions ──────────────────── --}}
{{-- Movements --}}
Derniers mouvements de stock
Voir tout →
@forelse($recentMovements as $mv) @empty @endforelse
ProduitTypeQtéParDate
{{ $mv->product?->name ?? '—' }} {{ $mv->type_label }} {{ $mv->type==='out' ? '-' : '+' }}{{ $mv->quantity }} {{ $mv->user?->name ?? '—' }} {{ $mv->created_at->format('d/m H:i') }}

Aucun mouvement

{{-- Quick actions --}}
Actions rapides
@endsection