@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['tipo_venta'] === 'VENTA NUEVA') { $totalVentaNueva += $total; } elseif ($row['tipo_venta'] === 'REEXPEDICIÓN') { $totalReposicion += $total; } elseif ($row['tipo_venta'] === 'COMPETENCIA') { $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) }}
COMPETENCIA $ {{ number_format($totalCompetencia, 2) }} DESCUENTO $ {{ number_format($totalDescuentoP ?? 0, 2) }}
REEXPEDICIÓN $ {{ number_format($totalReposicion, 2) }} COMISIÓN TOTAL $ {{ number_format(($totalBono + $totalVenta) - $totalDescuentoP, 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
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']) }}
TOTAL $ {{ number_format(($totalBono + $totalVenta) - $totalDescuentoP, 2) }}
*Este documento no tiene ninguna validez oficial.