@php $x_offset = $x_offset ?? 0; $x = $x_offset; $mostrar_totales = $mostrar_totales ?? true; @endphp @php $Ttotal=0; $Tno_gravado=0; $Texento=0; $Tgravado_27=0; $TIVA_27=0; $Tgravado_21=0; $TIVA_21=0; $Tgravado_105=0; $TIVA_105=0; $Tgravado_5=0; $TIVA_5=0; $Tgravado_2_5=0; $TIVA_2_5=0; $Tgravado_0=0; $TIVA_0=0; $TpercepIva=0; $TImps_Internos=0; $TImp_Combustibles=0; $TPerc_IIBB=0;@endphp @php $Tno_gravado_ABS=0; $Texento_ABS=0; $Tgravado_27_ABS=0; $TIVA_27_ABS=0; $Tgravado_21_ABS=0; $TIVA_21_ABS=0; $Tgravado_105_ABS=0; $TIVA_105_ABS=0; $Tgravado_5_ABS=0; $TIVA_5_ABS=0; $Tgravado_2_5_ABS=0; $TIVA_2_5_ABS=0; $Tgravado_0_ABS=0; $TIVA_0_ABS=0; $TpercepIva_ABS=0; $TImps_Internos_ABS=0; $TImp_Combustibles_ABS=0; $TPerc_IIBB_ABS=0;@endphp @forelse ($comprobantes as $key => $value) @php $Ttotal += $value->Total; $Tno_gravado += $value->no_gravado; $Tno_gravado_ABS += abs($value->no_gravado); $Texento += $value->exento; $Texento_ABS += abs($value->exento); $Tgravado_27 += $value->gravado_27; $Tgravado_27_ABS += abs($value->gravado_27); $TIVA_27 += $value->IVA_27; $TIVA_27_ABS += abs($value->IVA_27); $Tgravado_21 += $value->gravado_21; $Tgravado_21_ABS += abs($value->gravado_21); $TIVA_21 += $value->IVA_21; $TIVA_21_ABS += abs($value->IVA_21); $Tgravado_105 += $value->gravado_105; $Tgravado_105_ABS += abs($value->gravado_105); $TIVA_105 += $value->IVA_105; $TIVA_105_ABS += abs($value->IVA_105); $Tgravado_5 += $value->gravado_5; $Tgravado_5_ABS += abs($value->gravado_5); $TIVA_5 += $value->IVA_5; $TIVA_5_ABS += abs($value->IVA_5); $Tgravado_2_5 += $value->gravado_2_5; $Tgravado_2_5_ABS += abs($value->gravado_2_5); $TIVA_2_5 += $value->IVA_2_5; $TIVA_2_5_ABS += abs($value->IVA_2_5); $Tgravado_0 += $value->gravado_0; $Tgravado_0_ABS += abs($value->gravado_0); $TIVA_0 += $value->IVA_0; $TIVA_0_ABS += abs($value->IVA_0); $TpercepIva += $value->percepIva; $TpercepIva_ABS += abs($value->percepIva); $TImps_Internos += $value->Imps_Internos; $TImps_Internos_ABS += abs($value->Imps_Internos); $TPerc_IIBB += $value->Perc_IIBB; $TPerc_IIBB_ABS += abs($value->Perc_IIBB); @endphp @empty @endforelse @php // $columnas / $totales pueden venir precalculados sobre TODO el dataset (flujo chunked), // para que sean consistentes entre las distintas páginas/PDFs que después se mergean. // Si no vienen (flujo single-shot de siempre), se calculan sobre $comprobantes como antes. $mostrarCol = $columnas ?? [ 'no_gravado' => $Tno_gravado_ABS != 0, 'exento' => $Texento_ABS != 0, 'gravado_27' => $Tgravado_27_ABS != 0, 'IVA_27' => $TIVA_27_ABS != 0, 'gravado_21' => $Tgravado_21_ABS != 0, 'IVA_21' => $TIVA_21_ABS != 0, 'gravado_105' => $Tgravado_105_ABS != 0, 'IVA_105' => $TIVA_105_ABS != 0, 'gravado_5' => $Tgravado_5_ABS != 0, 'IVA_5' => $TIVA_5_ABS != 0, 'gravado_2_5' => $Tgravado_2_5_ABS != 0, 'IVA_2_5' => $TIVA_2_5_ABS != 0, 'gravado_0' => $Tgravado_0_ABS != 0, 'IVA_0' => $TIVA_0_ABS != 0, 'percepIva' => $TpercepIva_ABS != 0, 'Imps_Internos' => $TImps_Internos_ABS != 0, 'Perc_IIBB' => $TPerc_IIBB_ABS != 0, ]; $totalesFooter = $totales ?? [ 'Ttotal' => $Ttotal, 'no_gravado' => $Tno_gravado, 'exento' => $Texento, 'gravado_27' => $Tgravado_27, 'IVA_27' => $TIVA_27, 'gravado_21' => $Tgravado_21, 'IVA_21' => $TIVA_21, 'gravado_105' => $Tgravado_105, 'IVA_105' => $TIVA_105, 'gravado_5' => $Tgravado_5, 'IVA_5' => $TIVA_5, 'gravado_2_5' => $Tgravado_2_5, 'IVA_2_5' => $TIVA_2_5, 'gravado_0' => $Tgravado_0, 'IVA_0' => $TIVA_0, 'percepIva' => $TpercepIva, 'Imps_Internos' => $TImps_Internos, 'Perc_IIBB' => $TPerc_IIBB, ]; @endphp
| Libro IVA {{$operacion}} || {{ $person_current->field_name1 }}. CUIT: {{ $person_current->document }} || PERIODO: {{$anio}} - {{$mes}} | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Nº | Fechas | Comp. | SUC | NUM | Razon Social | CUIT | Total | @if ($mostrarCol['no_gravado'])No gravado | @endif @if ($mostrarCol['exento'])Exento | @endif @if ($mostrarCol['gravado_27'])Grav 27% | @endif @if ($mostrarCol['IVA_27'])IVA 27% | @endif @if ($mostrarCol['gravado_21'])Grav 21% | @endif @if ($mostrarCol['IVA_21'])IVA 21% | @endif @if ($mostrarCol['gravado_105'])Grav 10,5% | @endif @if ($mostrarCol['IVA_105'])IVA 10,5% | @endif @if ($mostrarCol['gravado_5'])Grav 5% | @endif @if ($mostrarCol['IVA_5'])IVA 5% | @endif @if ($mostrarCol['gravado_2_5'])Grav 2,5% | @endif @if ($mostrarCol['IVA_2_5'])IVA 2,5% | @endif @if ($mostrarCol['gravado_0'])Grav 0% | @endif @if ($mostrarCol['IVA_0'])IVA del 0% | @endif @if ($mostrarCol['percepIva'])Perc.IVA | @endif @if ($mostrarCol['Imps_Internos'])Imps. Internos | @endif @if ($mostrarCol['Perc_IIBB'])Perc. IIBB | @endif|
| {{ ++$x }} | {{ date("d/m/Y", strtotime($value->FechaComprobante)) }} | @if(strlen($value->TipoComprobante)>20){{ substr($value->TipoComprobante,0,18) }}... | @else{{ $value->TipoComprobante }} | @endif{{ str_pad($value->Suc,4,0,STR_PAD_LEFT) }} | {{ str_pad($value->Numero,8,0,STR_PAD_LEFT) }} | {{ substr($value->Proveedor, 0,25) }} | {{ str_replace('-', '', $value->Documento) }} | $ {{ number_format($value->Total, 2, ',', '.') }} | @if ($mostrarCol['no_gravado'])$ {{ number_format($value->no_gravado, 2, ',', '.') }} | @endif @if ($mostrarCol['exento'])$ {{ number_format($value->exento, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_27'])$ {{ number_format($value->gravado_27, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_27'])$ {{ number_format($value->IVA_27, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_21'])$ {{ number_format($value->gravado_21, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_21'])$ {{ number_format($value->IVA_21, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_105'])$ {{ number_format($value->gravado_105, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_105'])$ {{ number_format($value->IVA_105, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_5'])$ {{ number_format($value->gravado_5, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_5'])$ {{ number_format($value->IVA_5, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_2_5'])$ {{ number_format($value->gravado_2_5, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_2_5'])$ {{ number_format($value->IVA_2_5, 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_0'])$ {{ number_format($value->gravado_0, 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_0'])$ {{ number_format($value->IVA_0, 2, ',', '.') }} | @endif @if ($mostrarCol['percepIva'])$ {{ number_format($value->percepIva, 2, ',', '.') }} | @endif @if ($mostrarCol['Imps_Internos'])$ {{ number_format($value->Imps_Internos, 2, ',', '.') }} | @endif @if ($mostrarCol['Perc_IIBB'])$ {{ number_format($value->Perc_IIBB, 2, ',', '.') }} | @endif
| TOTALES | $ {{ number_format($totalesFooter['Ttotal'], 2, ',', '.') }} | @if ($mostrarCol['no_gravado'])$ {{ number_format($totalesFooter['no_gravado'], 2, ',', '.') }} | @endif @if ($mostrarCol['exento'])$ {{ number_format($totalesFooter['exento'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_27'])$ {{ number_format($totalesFooter['gravado_27'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_27'])$ {{ number_format($totalesFooter['IVA_27'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_21'])$ {{ number_format($totalesFooter['gravado_21'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_21'])$ {{ number_format($totalesFooter['IVA_21'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_105'])$ {{ number_format($totalesFooter['gravado_105'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_105'])$ {{ number_format($totalesFooter['IVA_105'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_5'])$ {{ number_format($totalesFooter['gravado_5'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_5'])$ {{ number_format($totalesFooter['IVA_5'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_2_5'])$ {{ number_format($totalesFooter['gravado_2_5'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_2_5'])$ {{ number_format($totalesFooter['IVA_2_5'], 2, ',', '.') }} | @endif @if ($mostrarCol['gravado_0'])$ {{ number_format($totalesFooter['gravado_0'], 2, ',', '.') }} | @endif @if ($mostrarCol['IVA_0'])$ {{ number_format($totalesFooter['IVA_0'], 2, ',', '.') }} | @endif @if ($mostrarCol['percepIva'])$ {{ number_format($totalesFooter['percepIva'], 2, ',', '.') }} | @endif @if ($mostrarCol['Imps_Internos'])$ {{ number_format($totalesFooter['Imps_Internos'], 2, ',', '.') }} | @endif @if ($mostrarCol['Perc_IIBB'])$ {{ number_format($totalesFooter['Perc_IIBB'], 2, ',', '.') }} | @endif|||||||