Cliente: {{$cliente->nombre_cliente}}
@php $saldo = 0; @endphp @foreach ($data as $item) @php $tipo = ''; if($item?->documento?->tipo?->id == 1) $tipo = 'CCF'; if($item?->documento?->tipo?->id == 2) $tipo = 'FEX'; if($item?->documento?->tipo?->id == 3) $tipo = 'FAC'; if($item?->documento?->tipo?->id == 5) $tipo = 'SNE'; // Convertir la cadena de fecha a un objeto DateTime $fechaObjeto = new DateTime($item->fecha); $saldo = $saldo+$item->monto; @endphp @endforeach
Fecha Tipo Transacción Documento Fecha documento Monto Saldo
{{$fechaObjeto->format('d-m-Y')}} {{$item->tipo}} {{$tipo}} {{$item?->documento?->documento_code}} {{$fechaObjeto->format('d-m-Y')}} {{ number_format($item->monto, 2)}} {{ number_format($saldo, 2)}}