{{ strtoupper(substr($client->company_name ?: $client->first_name, 0, 1)) }}

{{ $client->company_name ?: $client->full_name }}

{{ $client->client_code }} - Résumé fidélité

@can('create', App\Models\Fidelisation::class) Ajouter des points @endcan Voir le client Retour

Niveau actuel

@php $levelColors = [ 'bronze' => 'text-amber-600', 'silver' => 'text-gray-600', 'gold' => 'text-yellow-600', 'platinum' => 'text-purple-600', ]; $levelLabels = [ 'bronze' => 'Bronze', 'silver' => 'Argent', 'gold' => 'Or', 'platinum' => 'Platine', ]; $levelBgColors = [ 'bronze' => 'bg-amber-100 dark:bg-amber-900/20', 'silver' => 'bg-gray-200 dark:bg-gray-600', 'gold' => 'bg-yellow-100 dark:bg-yellow-900/20', 'platinum' => 'bg-purple-100 dark:bg-purple-900/20', ]; @endphp

{{ $levelLabels[$stats['current_level']] ?? 'Bronze' }}

Points totaux

{{ number_format($stats['total_points']) }}

Points gagnés

+{{ number_format($stats['total_earned']) }}

Points dépensés

-{{ number_format($stats['total_spent']) }}

Progression

@php $currentLevel = $stats['current_level'] ?? 'bronze'; $totalPoints = $stats['total_points']; $levels = [ 'bronze' => ['min' => 0, 'max' => 999, 'next' => 'silver', 'next_min' => 1000], 'silver' => ['min' => 1000, 'max' => 4999, 'next' => 'gold', 'next_min' => 5000], 'gold' => ['min' => 5000, 'max' => 9999, 'next' => 'platinum', 'next_min' => 10000], 'platinum' => ['min' => 10000, 'max' => PHP_INT_MAX, 'next' => null, 'next_min' => null], ]; $currentLevelInfo = $levels[$currentLevel] ?? $levels['bronze']; $progress = 100; $pointsToNext = 0; if ($currentLevelInfo['next']) { $range = $currentLevelInfo['next_min'] - $currentLevelInfo['min']; $pointsInRange = $totalPoints - $currentLevelInfo['min']; $progress = min(100, ($pointsInRange / $range) * 100); $pointsToNext = $currentLevelInfo['next_min'] - $totalPoints; } @endphp
{{ $levelLabels[$currentLevel] ?? 'Bronze' }}
@if($currentLevelInfo['next']) {{ $levelLabels[$currentLevelInfo['next']] ?? '' }} @else Max @endif
@if($currentLevelInfo['next'])

Plus que {{ number_format($pointsToNext) }} points pour atteindre le niveau {{ $levelLabels[$currentLevelInfo['next']] ?? '' }}

@else

🎉 Félicitations ! Ce client a atteint le niveau maximum !

@endif

Historique des actions

@php $actionTypes = [ 'purchase' => 'Achat', 'referral' => 'Parrainage', 'feedback' => 'Feedback', 'loyalty_bonus' => 'Bonus fidélité', 'manual_adjustment' => 'Ajustement', ]; @endphp @forelse($fidelisations as $fidelisation) @empty @endforelse
Date Type Points gagnés Points dépensés Net Niveau Actions
{{ $fidelisation->action_date?->format('d/m/Y') }}
@if($fidelisation->expiry_date)
Expire: {{ $fidelisation->expiry_date->format('d/m/Y') }}
@endif
{{ $actionTypes[$fidelisation->action_type] ?? $fidelisation->action_type }} @if($fidelisation->points_earned > 0) +{{ number_format($fidelisation->points_earned) }} @else - @endif @if($fidelisation->points_spent > 0) -{{ number_format($fidelisation->points_spent) }} @else - @endif {{ $fidelisation->points >= 0 ? '+' : '' }}{{ number_format($fidelisation->points) }} {{ $levelLabels[$fidelisation->level] ?? 'Bronze' }} Voir

Aucune action de fidélisation pour ce client

@can('create', App\Models\Fidelisation::class) Ajouter des points @endcan
@if($fidelisations->hasPages())
{{ $fidelisations->links() }}
@endif