@php $previousColaborador = null; $totalVenta = 0; $totalVentaNueva = 0; $totalReposicion = 0; $totalCompetencia = 0; $comisionGenerada = 0; $totalDescuentoP = 0; $totalBono = 0; @endphp @foreach ($bonos as $row) @php $totalBono += $row['total']; @endphp @endforeach @foreach ($data as $row) @php if ($row['tipo_d'] != 'D') { $totalVenta += $row['prima_comisionable'] * ($row['porcentaje'] / 100); $total = $row['prima_comisionable'] * ($row['porcentaje'] / 100); } if ($row['recibo'] == 1) { $totalVentaNueva += $total; } elseif ($row['tipo_venta'] === 'REEXPEDICIÓN') { $totalReposicion += $total; } elseif ($row['recibo'] !== 1) { $totalCompetencia += $total; } if ($row['tipo_d'] == 'D') { $totalDescuentoP += $row['prima_comisionable']; } @endphp @endforeach @if ($colaborador != $previousColaborador) @if ($previousColaborador != null) @endif @php $previousColaborador = $colaborador->nombre; @endphp @endif @if ($previousColaborador != null)
{{ $colaborador->nombre }} {{ $colaborador->apellido_paterno }} {{ $colaborador->apellido_materno }} {{ $colaborador->rfc }}
@endif
FECHA {{ \Carbon\Carbon::parse($fecha)->format('d/m/Y') }} BONOS Y APOYOS $ {{ number_format($totalBono, 2) }}
VENTA NUEVA $ {{ number_format($totalVentaNueva, 2) }} COMISIÓN GENERADA $ {{ number_format($totalVenta, 2) }}
ARRASTRE $ {{ number_format($totalCompetencia, 2) }} DESCUENTO $ {{ number_format($totalDescuentoP ?? 0, 2) }}

@php $num = 1; $totalDescuento = 0; @endphp @foreach ($data as $row) @php $num++; if ($row['tipo_d'] == 'D') { $totalDescuento += $row['prima_comisionable']; } @endphp @endforeach @foreach ($bonos as $row) @php $num++; @endphp @endforeach @php $importeCalculado = ($totalBono + $totalVenta) - $totalDescuentoP; $tipoPersona = $colaborador->tipo_persona ?? 'Fisica'; $isMoral = strtolower($tipoPersona) === 'moral'; if ($isMoral) { $importe = $importeCalculado; $iva = $importe * 0.16; $retIsr = $importe * 0.0125; $retIva = $importe * 0.106667; $totalFinal = $importe + $iva - $retIsr - $retIva; } else { $importe = $importeCalculado / 1.16; $iva = $importeCalculado - $importe; $totalFinal = $importeCalculado; } @endphp @if($isMoral) @else @endif
NUM PÓLIZA / FOLIO Semana de Trabajo NOMBRE CONTRATANTE PRIMA CONCEPTO PORCENTAJE TOTAL
{{ $num }} {{ $row['poliza'] }} {{ $row['inicio_fecha'] . ' al ' . $row['fin_fecha'] }} {{ $row['contratante'] }} $ {{ number_format($row['prima_comisionable'], 2) }} {{ $row['tipo'].' '.$row['recibo'] }} {{ $row['porcentaje'] }} % $ @if ($row['tipo_d'] == 'D') - {{ number_format($row['prima_comisionable'], 2) }} @else {{ number_format($row['prima_comisionable'] * ($row['porcentaje'] / 100), 2, '.', ',') }} @endif
{{ $num }} $ {{ number_format($row['venta'], 2) }} @if ($row['descripcion'] == 'Pago bono manual') {{ $row['comentario'] }} @else {{ $row['descripcion'] }} @endif {{ $row['porcentaje'] }} % $ {{ number_format($row['total']) }}
SUBTOTAL $ {{ number_format($importe, 2) }}
IVA $ {{ number_format($iva, 2) }}
RET ISR - $ {{ number_format($retIsr, 2) }}
RET IVA - $ {{ number_format($retIva, 2) }}
IMPORTE $ {{ number_format($importe, 2) }}
IVA $ {{ number_format($iva, 2) }}
TOTAL $ {{ number_format($totalFinal, 2) }}
*Este documento no tiene ninguna validez oficial.