@extends('layouts.app') @section('content') @php $achats30j = \App\Models\Sale::where('client_id', $client->id) ->where('status', 'terminé') ->where('created_at', '>=', now()->subDays(30)) ->count(); $derniereVisite = $stats['derniere_visite'] ?? null; @endphp
| Référence | Date | Canal | Articles | Montant | Statut |
|---|---|---|---|---|---|
| {{ $sale->reference }} | {{ $sale->created_at->translatedFormat('d M Y') }} | {{ ($sale->type ?? 'boutique') === 'livraison' ? 'Livraison' : 'Boutique' }} |
|
{{ number_format($sale->montant_total, 0, ' ', ' ') }} FCFA | @php // Même convention de couleur que sales/return.blade.php : "terminé" et // "retourné" (un retour traité correctement) en vert, "en attente de // retour"/"en pause"/"en livraison" en orange, les vraies annulations // ("annulé", "livraison annulée") en rouge. $statusBadgeClass = in_array($sale->status, ['terminé', 'retourné']) ? 'bg-success bg-opacity-10 text-success border border-success border-opacity-25' : (in_array($sale->status, ['annulé', 'livraison annulée']) ? 'bg-danger bg-opacity-10 text-danger border border-danger border-opacity-25' : 'bg-warning bg-opacity-10 text-warning border border-warning border-opacity-25'); @endphp {{ ucfirst($sale->status) }} |
Les achats de ce client apparaîtront ici.
Client depuis le {{ $client->created_at->translatedFormat('d M Y') }}
{{ $client->notes }}