@foreach($empresa AS $value)

REPORTE ESTADO DE CUENTA POR CLIENTE

@php $today = Carbon\Carbon::now(); @endphp

Impreso por: {{ Auth::user()->name }}
El {{ \Carbon\Carbon::parse($today)->format('d M Y h:m:s a')}}

{{ $value->direccion }}
{{ $value->ciudad }}, {{ $value->provincia }}, República Dominicana.

@endforeach @foreach($datos AS $value) @php $cliente = $value->cliente; @endphp @endforeach
{{ $cliente }}
@php $num = 0; $totalgen = 0; $totalrec = 0; $totalpend = 0; @endphp @foreach($datos AS $value) @php $totalgen += $value->total; $totalrec += $value->recibido; @endphp @endforeach
# Fecha Factura # Total Recibido Pendiente
{{ $num += 1 }} {{ \Carbon\Carbon::parse($value->fecha)->format('d M Y') }} {{ str_pad($value->factura, 9, 'FAC-0000', STR_PAD_LEFT) }} RD${{ number_format($value->total, 2) }} RD${{ number_format($value->recibido, 2) }} RD${{ number_format($value->total - $value->recibido, 2) }}
RD${{ number_format($totalgen, 2) }} RD${{ number_format($totalrec, 2) }} RD${{ number_format($totalgen - $totalrec, 2) }}