{{-- ACTIVOS --}}

ACTIVOS

@foreach ($activos as $cuenta) {{-- OCULTAR CUENTAS SIN ACTIVIDAD REAL --}} @php $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $nivel = $cuenta['nivel']; $codigo = $cuenta['codigo']; $len = strlen($codigo); // ESTILOS $rowClass = 'bg-white'; $textClass = ''; $fontClass = ''; // NIVEL 1 (1 dígito) if ($len == 1) { $fontClass = 'font-extrabold text-gray-900 text-sm'; } // NIVEL 2 (2 dígitos → grupo) elseif ($len == 2) { $rowClass = 'bg-gray-100'; $fontClass = 'font-bold text-gray-800'; } // NIVEL 3 (4 dígitos → subgrupo) elseif ($len == 4) { $fontClass = 'font-semibold text-gray-700'; } // NIVEL 4+ (cuentas de movimiento) else { $fontClass = 'text-gray-600'; } @endphp {{-- CÓDIGO con sangría --}} {{-- NOMBRE con sangría --}} @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos Total Saldo final
{{ $codigo }} {{ $cuenta['nombre'] }} {{ number_format($cuenta['saldo_anterior'], 0, ',', '.') }} {{ number_format($cuenta['debe'], 0, ',', '.') }} {{ number_format($cuenta['haber'], 0, ',', '.') }} {{ number_format($cuenta['total'], 0, ',', '.') }} {{ number_format($cuenta['total_final'], 0, ',', '.') }}
TOTAL ACTIVOS {{ number_format($totalActivos, 0, ',', '.') }}
{{-- FIN ACTIVOS --}} {{-- PASIVOS --}}

PASIVOS

@foreach ($pasivos as $cuenta) @php $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $nivel = $cuenta['nivel']; $codigo = $cuenta['codigo']; $len = strlen($codigo); $rowClass = 'bg-white'; $fontClass = ''; if ($len == 1) { $fontClass = 'font-extrabold text-gray-900 text-sm'; } elseif ($len == 2) { $rowClass = 'bg-gray-100'; $fontClass = 'font-bold text-gray-800'; } elseif ($len == 4) { $fontClass = 'font-semibold text-gray-700'; } else { $fontClass = 'text-gray-600'; } @endphp @endforeach {{-- TOTAL PASIVOS --}}
Código Nombre Saldo anterior Débitos Créditos Total Saldo final
{{ $codigo }} {{ $cuenta['nombre'] }} {{ number_format($cuenta['saldo_anterior'], 0, ',', '.') }} {{ number_format($cuenta['debe'], 0, ',', '.') }} {{ number_format($cuenta['haber'], 0, ',', '.') }} {{ number_format($cuenta['total'], 0, ',', '.') }} {{ number_format($cuenta['total_final'], 0, ',', '.') }}
TOTAL PASIVOS {{ number_format($totalPasivos, 0, ',', '.') }}
{{-- FIN PASIVOS --}} {{-- PATRIMONIO --}}

PATRIMONIO

@foreach ($patrimonio as $cuenta) @php // Ocultar cuentas completamente sin actividad $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $nivel = $cuenta['nivel']; $codigo = $cuenta['codigo']; $len = strlen($codigo); // ESTILOS PROFESIONALES $rowClass = 'bg-white'; $fontClass = ''; // Nivel 1 → Muy importante if ($len == 1) { $fontClass = 'font-extrabold text-gray-900 text-sm'; } // Nivel 2 → Grupo (fondo gris) elseif ($len == 2) { $rowClass = 'bg-gray-100'; $fontClass = 'font-bold text-gray-800'; } // Nivel 3 → Subgrupo elseif ($len == 4) { $fontClass = 'font-semibold text-gray-700'; } // Niveles 4+ → cuentas de movimiento else { $fontClass = 'text-gray-600'; } @endphp {{-- Código --}} {{-- Nombre --}} {{-- Saldos --}} @endforeach {{-- TOTAL PATRIMONIO --}}
Código Nombre Saldo anterior Débitos Créditos Total Saldo final
{{ $codigo }} {{ $cuenta['nombre'] }} {{ number_format($cuenta['saldo_anterior'], 0, ',', '.') }} {{ number_format($cuenta['debe'], 0, ',', '.') }} {{ number_format($cuenta['haber'], 0, ',', '.') }} {{ number_format($cuenta['total'], 0, ',', '.') }} {{ number_format($cuenta['total_final'], 0, ',', '.') }}
TOTAL PATRIMONIO {{ number_format($totalPatrimonio, 0, ',', '.') }}
{{-- FIN PATRIMONIO --}} {{-- Modal de carga --}}

Recopilando Cuentas...

Por favor, espera un momento