| {{ $index + 1 }} |
{{ $comm->salesInvoice->invoice_number ?? 'N/A' }} |
{{ ($comm->document_type ?? 'invoice') == 'invoice' ? 'Factura' : 'Nota' }}
|
{{ ($comm->salesman->first_name ?? '') . ' ' . ($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)
{{ $comm->days_to_pay }}
@elseif($comm->invoice_date)
{{ \Carbon\Carbon::parse($comm->invoice_date)->diffInDays(now()) }}
@else
-
@endif
|
{{ $comm->payment_days_limit ?? '-' }} |
${{ number_format($comm->commissionable_amount_usd ?? 0, 2) }} |
{{ $comm->commissionable_base === 'subtotal' ? 'Subtotal' : 'Total' }}
|
{{ number_format($comm->commission_rate_applied ?? 0, 2) }}% |
${{ number_format($comm->commission_amount_usd ?? 0, 2) }} |
${{ number_format($paidAmount, 2) }} |
${{ number_format($remainingAmount, 2) }} |
@php
$statusClass = 'status-' . ($comm->status ?? 'pending');
if ($isOverdue && $comm->status === 'pending') {
$statusClass = 'status-overdue';
}
@endphp
@if($isOverdue && $comm->status === 'pending')
Fuera de Tiempo
@else
{{ $comm->status_text }}
@endif
|
@if($isOverdue && $comm->status === 'pending')
Comisión fuera de tiempo - Factura no pagada
@elseif(!$isInvoicePaid && $comm->status === 'pending')
En espera - Factura pendiente de pago
@elseif($comm->status === 'lost')
Comisión perdida - Excedió el límite de días
@else
-
@endif
|
@empty