@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

@if (count($income_records) > 0) @endif @foreach ($income_records as $key => $value) @if (count($income_records) > 0) @endisset @endforeach
# Tipo transacción Método de pago Tipo documento Documento Fecha emisión Cliente/Proveedor N° Documento Referencia Moneda T.Pagado Total
{{ $loop->iteration }} {{ $value['type_transaction'] }} {{ $value['payment_method_description'] }} {{ $value['document_type_description'] }} {{ $value['number'] }} {{ $value['date_of_issue'] }} {{ $value['customer_name'] }} {{ $value['customer_number'] }} {{$value['reference']}} {{ $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' }} @php $value['total_string'] = str_replace('-', '', $value['total_string']); @endphp {{ $value['total_string'] }}
@endif