Résumé des Commissions de {{ $commercial->nom . ' ' . $commercial->prenom }}

#

DATE

CLIENT

VRP

PRIX TARIF

TAUX REMISE

CA HT

MARGE

COMMISSION TAUX

COMMISSION MONTANT

@forelse($ventesPaginate as $index => $vente)

{{ $vente->id_rdv }}

{{ $vente->date ? \Carbon\Carbon::parse($vente->date)->format('d/m/Y') : 'N/A' }}

{{ $vente->client->nom ?? '' }}

{{ $sale['vrp'] }}

{{ number_format($sale['prix_tarif'], 0, ',', ' ') }}€

{{ number_format($sale['taux_remise'], 1, ',', ' ') }}%

{{ number_format($sale['ca_ht'], 0, ',', ' ') }}€

{{ number_format($sale['marge'], 0, ',', ' ') }}€

{{ number_format($sale['commission_taux'], 2, ',', ' ') }}%

{{ number_format($sale['commission_montant'], 0, ',', ' ') }}€

@empty

Aucune commission trouvée pour les critères sélectionnés

@endforelse @if(count($commissionData) > 0)

TOTAL

-

{{ count($commissionData) }} vente{{ count($commissionData) > 1 ? 's' : '' }}

-

@php $totalPrixTarif = array_sum(array_column($commissionData, 'prix_tarif')); @endphp

{{ number_format($totalPrixTarif, 0, ',', ' ') }}€

@php $avgRemise = count($commissionData) > 0 ? array_sum(array_column($commissionData, 'taux_remise')) / count($commissionData) : 0; @endphp

{{ number_format($avgRemise, 1, ',', ' ') }}%

@php $totalCA = array_sum(array_column($commissionData, 'ca_ht')); @endphp

{{ number_format($totalCA, 0, ',', ' ') }}€

@php $totalMarge = array_sum(array_column($commissionData, 'marge')); @endphp

{{ number_format($totalMarge, 0, ',', ' ') }}€

@php $avgTaux = count($commissionData) > 0 ? array_sum(array_column($commissionData, 'commission_taux')) / count($commissionData) : 0; @endphp

{{ number_format($avgTaux, 2, ',', ' ') }}%

{{ number_format($totalCommission, 0, ',', ' ') }}€

@endif
@if(count($commissionData) > 0) Commission totale: {{ number_format($totalCommission, 0, ',', ' ') }} € @endif