@if (count($data_table) == 0)
{{ date('Y/m/d').', '.date('h:i') }}
REPORTE AMORTIZACIONES
FECHA: {{$data['fecha_cierre']}}
TERMINAL USUARIO - DNI
{{$terminal['terminal_nombre']}} {{$usuario['usuario_persona_nombre']}} - {{$usuario['usuario_numero_documento']}}

SIN FACTURAS.
@else @foreach ($data_table as $key => $valuet)
{{ date('Y/m/d').', '.date('h:i') }}
REPORTE AMORTIZACIONES
FECHA: {{$data['fecha_cierre']}}
TERMINAL USUARIO - DNI
{{$terminal['terminal_nombre']}} {{$key}}

@foreach ($valuet as $key4=>$value4) @php $montoFinal += $value4['total'] @endphp
{{$key4}}
INGRESO
@foreach ($value4['data'] as $key2=>$value2)
{{$key2}} @php $row = 1; @endphp @for ($key3 = 0; $key3 < sizeof($value2['registros']); $key3++) @php $next = false; if ($key3 > 0) { $facturaIte = $value2['registros'][$key3]['id_cp']; if ($facturaIte != $ultimaFactura) { $monto = $montoAcumulado; $ultimaFactura = $value2['registros'][$key3]['id_cp']; $key3--; $montoAcumulado = 0; $next = true; }else { if ($key3 == sizeof($value2['registros'])-1) { $monto = $value2['registros'][$key3]['monto'] + $montoAcumulado; $montoAcumulado = 0; $next = true; }else{ $montoAcumulado += $value2['registros'][$key3]['monto']; } } }else { if($key3==0 && sizeof($value2['registros'])==1){ $next = true; $monto = $value2['registros'][$key3]['monto']; }else{ $ultimaFactura = $value2['registros'][$key3]['id_cp']; $montoAcumulado += $value2['registros'][$key3]['monto']; } } @endphp @if ($next) @endif @endfor
# NRO GUIA SERIE/NUMERO CLIENTE MONTO
{{$row++}} {{$value2['registros'][$key3]['guias'][0]['numero_guia']}} {{$value2['registros'][$key3]['serie_comprobante']}}/{{$value2['registros'][$key3]['numero_comprobante']}} {{$value2["registros"][$key3]["cliente_razon_social"]}} S/. {{$monto}}
MONTO: S/. {{$value2['subtotal']}}
@endforeach
@endforeach
# NRO GUIA SERIE/NUMERO CLIENTE MONTO
MONTO FINAL: S/. {{$montoFinal}}
@php $montoFinal = 0; $countDataTable++; if(count($data_table)!=$countDataTable){ $pageBreak = "page_break"; }else{ $pageBreak = ""; } @endphp
@endforeach @endif