@php use Illuminate\Support\Str; @endphp
@php $saldoAcumulado = 0; @endphp @foreach($registro->receipts as $key=> $receipt) @php if($receipt->type_receipt->credit){ $saldoAcumulado -= $receipt->pendiente; }else{ $saldoAcumulado += $receipt->pendiente; } @endphp @if($loop->first) @endif @endforeach
F. Emision Comprobantes Debe Haber Saldo
{{ date("d/m/Y", strtotime($receipt->receipt_date)) }} {{Str::limit($receipt->type_receipt->name, 15, '...') }} {{str_pad($receipt->code_ticket, 5, '0', STR_PAD_LEFT)}}-{{str_pad($receipt->number, 8, '0', STR_PAD_LEFT)}} {{$receipt->type_receipt->credit? "" : "$".number_format($receipt->pendiente, 2, '.', ',') }} {{$receipt->type_receipt->credit? "$".number_format($receipt->pendiente, 2, '.', ',') : "" }} ${{number_format($saldoAcumulado, 2, '.', ',')}}