@php //fuenets y usos operacionales $fuentes = $data['detalle']->where('tipo', 'FUENTE_OPERACIONAL'); $usos = $data['detalle']->where('tipo', 'USO_OPERACIONAL'); //totales de t=fuentes y usois operacionles $total_fuentes_ant = $fuentes->sum('saldo_anterior'); $total_usos_ant = $usos->sum('saldo_anterior'); $total_fuentes_act = $fuentes->sum('saldo_inicial'); $total_usos_act = $usos->sum('saldo_inicial'); /////////////////////////////////////////////////////////////////////// //fuentes y ussos no operacionales $fuentes_no_op = $data['detalle']->where('tipo', 'FUENTES_NO_OPERACIONALES'); $usos_no_op = $data['detalle']->where('tipo', 'USO_NO_OPERACIONAL'); //totales de fuentes y usois no operacionles $total_fuentes_noop_ant = $fuentes_no_op->sum('saldo_anterior'); $total_usos_noop_ant = $usos_no_op->sum('saldo_anterior'); $total_fuentes_noop_act = $fuentes_no_op->sum('saldo_inicial'); $total_usos_noop_act = $usos_no_op->sum('saldo_inicial'); ////////////////////////////////////////////////////////////////////////// $res_oper_ant = $total_fuentes_ant - $total_usos_ant; $res_no_oper_ant = $total_fuentes_noop_ant - $total_usos_noop_ant; $saldo_final_act = $saldo_inicial + $data['resultado_operacional_neto'] + $data['resultado_no_operacional_neto']; $saldo_inicial_ant = $saldo_inicial_anterior; $saldo_final_ant = $saldo_inicial_ant + $res_oper_ant + $res_no_oper_ant ?? 0; @endphp
RED NACIONAL DE HOSPITALES
ESTADO DE FLUJO DE FONDOS
DEL: {{ $fecha_desde }} AL {{ $fecha_hasta }}
{{-- DISPONIBILIDADES INICIALES --}} {{-- RESULTADO OPERACIONAL NETO --}} {{-- (+) FUENTES OPERACIONALES --}} @foreach ($fuentes as $item) @endforeach {{-- (-) USOS OPERACIONALES --}} @foreach ($usos as $item) @endforeach {{-- NO NO OPERACIONAL NETO --}} {{-- (+) FUENTES OPERACIONALES --}} @foreach ($fuentes_no_op as $item) @endforeach {{-- (-) USOS OPERACIONALES --}} @foreach ($usos_no_op as $item) @endforeach {{-- DISPONIBILIDADES FINALES --}}
ESTRUCTURA CORRIENTE ($) ANTERIOR ($)
DISPONIBILIDADES INICIALES ${{ number_format($saldo_inicial, 2) }} ${{ number_format($saldo_inicial_ant, 2) }}
Saldo Inicial ${{ number_format($saldo_inicial, 2) }} ${{ number_format($saldo_inicial_ant, 2) }}
RESULTADO OPERACIONAL NETO ${{ number_format($data['resultado_operacional_neto'], 2) }} ${{ number_format($res_oper_ant, 2) }}
(+) FUENTES OPERACIONALES ${{ number_format($total_fuentes_act, 2) }} ${{ number_format($total_fuentes_ant, 2) }}
{{ $item['nombre_cuenta'] }} {{ number_format($item['saldo_inicial'], 2) }} {{ number_format($item['saldo_anterior'], 2) }}
(-) USOS OPERACIONALES ${{ number_format($total_usos_act, 2) }} ${{ number_format($total_usos_ant, 2) }}
{{ $item['nombre_cuenta'] }} {{ number_format($item['saldo_inicial'], 2) }} {{ number_format($item['saldo_anterior'], 2) }}
RESULTADO NO OPERACIONAL NETO ${{ number_format($data['resultado_no_operacional_neto'], 2) }} ${{ number_format($res_no_oper_ant, 2) }}
(+) FUENTES NO OPERACIONALES ${{ number_format($total_fuentes_noop_act, 2) }} ${{ number_format($total_fuentes_noop_ant, 2) }}
{{ $item['nombre_cuenta'] }} {{ number_format($item['saldo_inicial'], 2) }} {{ number_format($item['saldo_anterior'], 2) }}
(-) USOS NO OPERACIONALES ${{ number_format($total_usos_noop_act, 2) }} ${{ number_format($total_usos_noop_ant, 2) }}
{{ $item['nombre_cuenta'] }} {{ number_format($item['saldo_inicial'], 2) }} {{ number_format($item['saldo_anterior'], 2) }}
DISPONIBILIDADES FINALES AL {{ $fecha_hasta }} ${{ number_format($saldo_final_act, 2) }} ${{ number_format($saldo_final_ant, 2) }}