@extends('layouts.main') @section('body') @php( $page = 1 ) @php( $curline = 1 ) @php( $limite1 = 15 ) @php( $limite2 = 23 ) @php( $limite3 = 32 ) @php( $line_length = 50 ) @php( $total_prods = 0 ) @php( $row_color = '#eee' ) @include('pdf.vendor.cfdi33.sections.header') @include('pdf.vendor.cfdi33.sections.tableHeader') @php( $count_line = 1 ) @foreach ($xml['Comprobante']['Conceptos']['Concepto']['@atributos'] as $row) @if( strlen($row['descripcion']) >= $line_length || @$row['aduanas'][0]['@attributes']['numero'] || isset($row['Partes']) ) @if( strlen($row['descripcion']) >= $line_length ) @php( $curline += (strlen($row['descripcion']) / $line_length) ) @else @php( $curline += 1 ) @endif @if( strlen($row['descripcion']) >= $line_length && @$row['aduanas'][0]['@attributes']['numero'] ) @php( $curline += 1 ) @endif @if( isset($row['Partes']) ) @php( $curline += count($row['Partes']) ) @endif @else @php( $curline++ ) @endif @php( $total_prods += $row['cantidad'] ) @php( $row_color = ($count_line % 2 == 0) ? '#fff' : '#eee' ) @include('pdf.vendor.cfdi33.sections.tableRow', ['row' => $row, 'row_color' => $row_color]) @php( $count_line++ ) @if($curline >= $limite3)
Página {{ $page }}
@php( $page++ ) @include('pdf.vendor.cfdi33.sections.header') @include('pdf.vendor.cfdi33.sections.tableHeader') @php( $curline = 1 ) @endif @endforeach @php( $total_notes = count($xml['Comprobante']['@atributos']['Observaciones']) ) @if( $total_notes > 3 ) @php( $curline += ($count_notes - 3) ) @endif @if($curline <= $limite1) @if(is_null($xml['Comprobante']['Pagos'])) @php( $need_line = ($limite1 - $curline) - 1 ) @for($i=0; $i<$need_line; $i++) @endfor @endif
{{ number_format($total_prods, 2, '.', ',') }}  
 
@include('pdf.vendor.cfdi33.sections.totales') @if(!is_null($xml['Comprobante']['Pagos'])) @include('pdf.vendor.cfdi33.sections.payment') @endif @include('pdf.vendor.cfdi33.sections.footer') @elseif($curline <= $limite2) @include('pdf.vendor.cfdi33.sections.totales')

@include('pdf.vendor.cfdi33.sections.header') @if(!is_null($xml['Comprobante']['Pagos'])) @include('pdf.vendor.cfdi33.sections.payment') @else


@endif @include('pdf.vendor.cfdi33.sections.footer') @elseif($curline <= $limite3)

@include('pdf.vendor.cfdi33.sections.header') @include('pdf.vendor.cfdi33.sections.totales') @if(!is_null($xml['Comprobante']['Pagos'])) @include('pdf.vendor.cfdi33.sections.payment') @endif @include('pdf.vendor.cfdi33.sections.footer') @endif @stop