@extends('layouts.app') @section('title', 'Reporte de Comisiones por Vendedor') @section('content')

Reporte de Comisiones por Vendedor

Visualice y analice todas las comisiones generadas y adjudicadas

@if(session('success')) @endif @if(session('error')) @endif
Total Ganadas

${{ number_format($stats['total_amount_earned'] ?? 0, 2) }}

USD
Total Perdidas

${{ number_format($stats['total_amount_lost'] ?? 0, 2) }}

USD
Pendientes

${{ number_format($stats['total_amount_pending'] ?? 0, 2) }}

USD
Pagadas

${{ number_format($stats['total_amount_paid'] ?? 0, 2) }}

USD
Filtros
Limpiar
Comisiones
@forelse($commissions as $comm) @empty @endforelse
Factura Tipo Doc. Vendedor Fec. Venta Fec. Pago Días P. Mon. Vta. Mon. Pago Monto Base (USD) % Comisión (USD) Estado
@if($comm->salesInvoice) {{ $comm->salesInvoice->invoice_number ?? 'N/A' }} @else N/A @endif {{ ($comm->document_type ?? 'invoice') == 'invoice' ? 'Factura' : 'Nota' }} {{ ($comm->salesman->first_name ?? 'N/A') }} {{ ($comm->salesman->last_name ?? '') }} {{ $comm->invoice_date ? (is_string($comm->invoice_date) ? \Carbon\Carbon::parse($comm->invoice_date)->format('d/m/Y') : $comm->invoice_date->format('d/m/Y')) : 'N/A' }} {{ $comm->payment_date ? (is_string($comm->payment_date) ? \Carbon\Carbon::parse($comm->payment_date)->format('d/m/Y') : $comm->payment_date->format('d/m/Y')) : '-' }} @if($comm->days_to_pay !== null && $comm->payment_days_limit !== null) {{ $comm->days_to_pay }} @else - @endif {{ $comm->sale_currency ?? '-' }} {{ $comm->payment_currency ?? '-' }} ${{ number_format($comm->commissionable_amount_usd ?? 0, 2) }} {{ number_format($comm->commission_rate_applied ?? 0, 2) }}% ${{ number_format($comm->commission_amount_usd ?? 0, 2) }} @php $statusColors = [ 'earned' => 'success', 'lost' => 'danger', 'paid' => 'info', 'pending' => 'warning', 'partial' => 'secondary', 'cancelled' => 'dark' ]; $statusColor = $statusColors[$comm->status ?? 'pending'] ?? 'secondary'; $statusText = ucfirst($comm->status ?? 'pending'); @endphp {{ $statusText }}

No hay comisiones que coincidan con los filtros seleccionados.

@endsection