@extends('layouts.prestataire') @section('title', 'Dashboard Paiements') @section('content')
Gérez tous vos revenus en un seul endroit
{{ number_format($stats['available_balance']['available'], 2) }} €
+ {{ number_format($stats['available_balance']['pending'], 2) }} € en transit
{{ number_format($stats['total_earned'], 2) }} €
Net après commission
{{ number_format($stats['this_month'], 2) }} €
@if($stats['evolution'] != 0){{ $stats['evolution'] > 0 ? '↑' : '↓' }} {{ abs($stats['evolution']) }}% vs mois dernier
@endif{{ number_format($stats['pending_amount'], 2) }} €
Paiements en cours
{{ number_format($stats['today'], 2) }} €
Reçu aujourd'hui
{{ $stats['completed_transactions'] }}
Sur {{ $stats['total_transactions'] }} totales
Services
{{ number_format($stats['by_type']['booking'], 2) }} €
Équipements
{{ number_format($stats['by_type']['equipment'], 2) }} €
Ventes Flash
{{ number_format($stats['by_type']['urgent_sale'], 2) }} €
Food
{{ number_format($stats['by_type']['food'], 2) }} €
| Type | Référence | Client | Description | Montant | Statut | Date | Actions |
|---|---|---|---|---|---|---|---|
| @php $typeConfig = [ 'booking' => ['icon' => '📅', 'bg' => 'bg-blue-100', 'text' => 'text-blue-800'], 'equipment' => ['icon' => '🔧', 'bg' => 'bg-purple-100', 'text' => 'text-purple-800'], 'urgent_sale' => ['icon' => '🔥', 'bg' => 'bg-orange-100', 'text' => 'text-orange-800'], 'food' => ['icon' => '🍽️', 'bg' => 'bg-green-100', 'text' => 'text-green-800'], ]; $config = $typeConfig[$payment['type']] ?? ['icon' => '💰', 'bg' => 'bg-gray-100', 'text' => 'text-gray-800']; @endphp {{ $config['icon'] }} {{ $payment['type_label'] }} | {{-- Référence --}}{{ $payment['reference'] }} | {{-- Client --}}
{{ $payment['client_name'] }}
{{ $payment['client_email'] }}
|
{{-- Description --}}
{{ $payment['title'] }}
@if($payment['payment_type'] === 'deposit')
⚡ Acompte
@elseif($payment['payment_type'] === 'balance')
âś“ Solde
@endif
@if(($payment['type'] ?? '') === 'equipment' && !empty($payment['rental']))
@php
$rentalRow = $payment['rental'];
$escrowRow = is_object($payment['escrow'] ?? null) ? (array) $payment['escrow'] : [];
$escrowMeta = [];
try {
$escrowMeta = !empty($escrowRow['metadata'] ?? null)
? (json_decode((string) $escrowRow['metadata'], true) ?: [])
: [];
} catch (\Throwable $e) {
$escrowMeta = [];
}
$depositAmount = (float) ($rentalRow->equipment->security_deposit ?? $rentalRow->security_deposit ?? ($escrowRow['deposit_amount'] ?? 0));
$depositStatus = strtolower((string) (($rentalRow->deposit_status ?? null) ?: ($escrowMeta['deposit_status'] ?? 'pending')));
@endphp
@if($depositAmount > 0)
Caution: {{ $depositStatus === 'returned' ? 'remboursée' : ($depositStatus === 'partial' ? 'partielle' : ($depositStatus === 'retained' ? 'retenue' : 'en attente')) }}
@endif
@endif
|
{{-- Montant avec détail déductions --}}
@php
$stripeFeePercent = (float) get_setting('stripe_fee_percent', '1.4');
$stripeFeeFixed = (float) get_setting('stripe_fee_fixed', '0.25');
$securityDeposit = (float) ($payment['security_deposit'] ?? 0);
$grossAmount = (float) ($payment['gross_amount'] ?? $payment['amount']);
@endphp
+{{ number_format($payment['net_amount'], 2) }} €
@if(($payment['type'] ?? '') === 'equipment' && $securityDeposit > 0)
Location: {{ number_format($payment['amount'], 2) }}€
Caution: {{ number_format($securityDeposit, 2) }}€ Débité: {{ number_format($grossAmount, 2) }}€ @else Brut: {{ number_format($payment['amount'], 2) }}€ @endif @if(($payment['platform_commission'] ?? 0) >= 0) -{{ number_format($payment['platform_commission'], 2) }}€ @else +{{ number_format(abs($payment['platform_commission']), 2) }}€ absorbé @endif -{{ number_format($payment['stripe_fee'] ?? 0, 2) }}€ Stripe |
{{-- Statut --}}
@php $statusConfig = [ 'completed' => ['label' => 'Complété', 'bg' => 'bg-green-100', 'text' => 'text-green-800'], 'pending' => ['label' => 'En attente', 'bg' => 'bg-yellow-100', 'text' => 'text-yellow-800'], 'processing' => ['label' => 'En cours', 'bg' => 'bg-blue-100', 'text' => 'text-blue-800'], 'refunded' => ['label' => 'Remboursé', 'bg' => 'bg-red-100', 'text' => 'text-red-800'], 'cancelled' => ['label' => 'Annulé', 'bg' => 'bg-gray-100', 'text' => 'text-gray-800'], ]; $sConfig = $statusConfig[$payment['status']] ?? ['label' => ucfirst($payment['status']), 'bg' => 'bg-gray-100', 'text' => 'text-gray-800']; @endphp {{ $sConfig['label'] }} | {{-- Date --}}
{{ \Carbon\Carbon::parse($payment['date'])->format('d/m/Y') }}
{{ \Carbon\Carbon::parse($payment['date'])->format('H:i') }}
|
{{-- Actions --}}
@php // Pour Stripe, garder l'ID complet (py_xxx), sinon extraire le numérique if ($payment['type'] === 'stripe') { $itemId = $payment['id']; } else { $parts = explode('_', $payment['id']); $itemId = end($parts); } @endphp Détails → |
Aucune transaction ne correspond à vos critères de recherche.
Sur chaque transaction, les déductions suivantes sont appliquées :
Total des déductions prélevées : {{ number_format($stats['total_commission'], 2) }} €