@extends('layouts.app') @section('title', 'Tableau de bord') @section('page-title', 'Tableau de bord') @section('content')
@if(($stats['facturesImpayees'] ?? 0) > 0)

Factures impayées

Montant total des factures impayées : {{ number_format((int) $stats['facturesImpayees'], 0, ',', ' ') }} FCFA. Pensez à relancer les clients ou à enregistrer les paiements.

Voir les factures impayées
@endif {{-- Stats cards --}}

Total ventes

{{ number_format((int) ($stats['totalVentes'] ?? 0), 0, ',', ' ') }} FCFA

Total achats

{{ number_format((int) ($stats['totalAchats'] ?? 0), 0, ',', ' ') }} FCFA

Net

{{ number_format((int) ($stats['net'] ?? 0), 0, ',', ' ') }} FCFA

Achats impayés

{{ number_format((int) ($stats['achatsImpayes'] ?? 0), 0, ',', ' ') }} FCFA

Retours d'achat

{{ number_format((int) ($stats['retoursAchat'] ?? 0), 0, ',', ' ') }} FCFA

Factures impayées

{{ number_format((int) ($stats['facturesImpayees'] ?? 0), 0, ',', ' ') }} FCFA

{{-- Chart: Évolution des ventes sur 30 jours par magasin --}}

Évolution des ventes sur les 30 derniers jours

Par magasin

{{-- Quick actions & Recent activity --}}

Activité récente

Voir tout
{{-- Dernier transfert --}} @if(($recentTransferts ?? null) && $recentTransferts->isNotEmpty()) @php $transfert = $recentTransferts->first(); @endphp

Transfert {{ $transfert->reference }}

{{ optional($transfert->magasinOrigine)->nom ?? 'N/A' }} → {{ optional($transfert->magasinDestination)->nom ?? 'N/A' }} • {{ $transfert->quantite }} unités @if($transfert->produit) • {{ $transfert->produit->designation ?? $transfert->produit->reference }} @endif

{{ optional($transfert->date_transfert)->diffForHumans() }}
@endif {{-- Dernière vente --}} @if(($recentVentes ?? null) && $recentVentes->isNotEmpty()) @php $vente = $recentVentes->first(); @endphp

Vente {{ $vente->reference }}

Client : {{ optional($vente->client)->nom ?? 'N/A' }} • {{ number_format((float) $vente->montant, 0, ',', ' ') }} FCFA

{{ optional($vente->date_vente)->diffForHumans() }}
@endif {{-- Dernière caution / nouveau client --}} @if(($recentCautions ?? null) && $recentCautions->isNotEmpty()) @php $caution = $recentCautions->first(); @endphp

Nouvelle caution client

{{ optional($caution->client)->nom ?? 'Client inconnu' }} • Caution : {{ number_format((float) $caution->montant, 0, ',', ' ') }} FCFA

{{ optional($caution->date_depot)->diffForHumans() }}
@endif @if( (!isset($recentTransferts) || $recentTransferts->isEmpty()) && (!isset($recentVentes) || $recentVentes->isEmpty()) && (!isset($recentCautions) || $recentCautions->isEmpty()) )
Aucune activité récente pour le moment.
@endif
{{-- Graphique des ventes (Chart.js) --}} @endsection