@extends('layouts.app') @section('content') @include('partials.dashboard-filter', [ 'filterId' => 'statistiques', 'filterRoute' => 'statistiques', 'pageTitle' => 'Statistiques', 'defaultLabel' => '1 an (' . $debutPeriode->locale('fr')->isoFormat('D MMM YYYY') . ' – ' . $finPeriode->locale('fr')->isoFormat('D MMM YYYY') . ')', ]) @if ($servicesModuleEnabled) {{-- Le choix de scope n'a de sens que si les deux modules (Produits et Services) coexistent : sans Services, "Global" et "Produits" renvoient toujours les mêmes chiffres, et cette barre ne ferait que prêter à confusion. --}}
Global Produits Services
@endif @if ($scope !== 'services')
Tous canaux Boutique Livraison
@endif {{-- Bandeau KPI unique : tous les chiffres-clés d'un coup d'œil, style uniforme --}}
{{ number_format($ca_total, 0, ' ', ' ') }} FCFA
Chiffre d'affaires
{{ number_format($gains_total, 0, ' ', ' ') }} FCFA
Gains
@if ($scope === 'global')
{{ number_format($marge_nette, 0, ' ', ' ') }} FCFA
Marge nette
{{ number_format($total_depenses, 0, ' ', ' ') }} FCFA
Dépenses
@endif
{{ number_format($panier_moyen, 0, ' ', ' ') }} FCFA
Panier moyen
{{ number_format($nb_transactions, 0, ' ', ' ') }}
Transactions
{{ number_format($taux_annulation, 1, ',', ' ') }} %
Taux de retours ({{ $nb_total_annules }})
@if ($scope !== 'services')
{{ number_format($stock_faible_count, 0, ' ', ' ') }}
Stock faible
{{ number_format($nouveaux_clients, 0, ' ', ' ') }}
Nouveaux clients
@endif
{{-- Tendance + répartition, côte à côte pour une lecture comparative directe --}}
Évolution du chiffre d'affaires
@if ($scope !== 'services' && $caParCategorie->isNotEmpty())
CA produits par catégorie
@endif
{{-- Palmarès produits / services, côte à côte --}}
@if ($scope !== 'services' && $topProduits->isNotEmpty())
Top 5 produits
@foreach ($topProduits as $item) @endforeach
Produit Qté vendue Montant
{{ $item->label }} {{ number_format($item->quantite, 0, ' ', ' ') }} {{ number_format($item->montant, 0, ' ', ' ') }} FCFA
@endif @if ($scope !== 'produits' && $servicesModuleEnabled && $topServices->isNotEmpty())
Top 5 services
@foreach ($topServices as $item) @endforeach
Service Qté vendue Montant
{{ $item->label }} {{ number_format($item->quantite, 0, ' ', ' ') }} {{ number_format($item->montant, 0, ' ', ' ') }} FCFA
@endif
{{-- Suivi des tailles/déclinaisons les plus vendues, pour anticiper les réassorts sur les tailles populaires (bonnets, tours de dos, tailles standard...) --}} @if ($scope !== 'services' && $topVariantes->isNotEmpty())
Tailles les plus vendues
@if ($channel === 'boutique') Boutique uniquement @elseif ($channel === 'livraison') Livraison uniquement @else Boutique + Livraison @endif
@foreach ($topVariantes as $item) @endforeach
Produit Taille Qté vendue Stock actuel Alerte
{{ $item->produit }} {{ $item->taille }} {{ number_format($item->quantite_vendue, 0, ' ', ' ') }} {{ $item->stock_actuel === null ? '—' : number_format($item->stock_actuel, 0, ' ', ' ') }} @if ($item->stock_actuel === null) Taille retirée @elseif ($item->stock_actuel <= 0) Rupture @elseif ($item->stock_actuel <= 3) Stock faible @else OK @endif
@endif @endsection