@php $all_documents = collect($data['all_documents'])->sortBy('order_number_key'); $income_records = $all_documents->where('type_transaction_prefix', 'income'); $egress_records = $all_documents->where('type_transaction_prefix', 'egress'); @endphp @if (count($income_records) > 0)

Ingresos

@foreach($income_records as $key => $value) @endforeach
# Tipo transacción Tipo documento Documento Fecha emisión Cliente/Proveedor N° Documento Moneda T.Pagado Total
{{ $loop->iteration }} {{ $value['type_transaction'] }} {{ $value['document_type_description'] }} {{ $value['number'] }} {{ $value['date_of_issue'] }} {{ $value['customer_name'] }} {{ $value['customer_number'] }} {{ $value['currency_type_id'] }} {{ $value['total_payments']??'0.00' }} {{ $value['total_string'] }}
@endif @if (count($egress_records) > 0)

Egresos

@foreach($egress_records as $key => $value) @endforeach
# Tipo transacción Tipo documento Documento Fecha emisión Cliente/Proveedor N° Documento Moneda T.Pagado Total
{{ $loop->iteration }} {{ $value['type_transaction'] }} {{ $value['document_type_description'] }} {{ $value['number'] }} {{ $value['date_of_issue'] }} {{ $value['customer_name'] }} {{ $value['customer_number'] }} {{ $value['currency_type_id'] }} {{ $value['total_payments']??'0.00' }} {{ $value['total_string'] }}
@endif