Selecciona los digitos
{{-- ACTIVOS --}}

ACTIVOS

@foreach ($activos as $cuenta) @php // DETECTAR SI LA CUENTA NO TIENE MOVIMIENTO $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; // Debe venir desde Livewire $len = strlen($codigo); // ESTILOS SEGÚN GRUPO $rowClass = 'bg-white'; $fontClass = ''; if ($len == 1) { // Clase principal (Activo) $fontClass = 'font-extrabold text-gray-900 text-sm'; } elseif ($len == 2) { // Grupo 11, 12, 13, etc. $rowClass = 'bg-gray-100'; $fontClass = 'font-bold text-gray-800'; } elseif ($len == 4) { // Subgrupo 1105, 1110, 1120 $fontClass = 'font-semibold text-gray-700'; } else { // Cuentas de movimiento 110505, 110510, etc. $fontClass = 'text-gray-600'; } // Sangría visual por nivel $indent = ($nivel - 1) * 12; @endphp {{-- CÓDIGO --}} {{-- NOMBRE --}} @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL ACTIVOS {{ number_format($totalActivos, 0, ',', '.') }}
{{-- FIN ACTIVOS --}} {{-- PASIVOS --}}

PASIVOS

@foreach ($pasivos as $cuenta) @php // OCULTAR CUENTAS SIN MOVIMIENTO REAL $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; $len = strlen($codigo); // ESTILOS SEGÚN GRUPO $rowClass = 'bg-white'; $fontClass = ''; if ($len == 1) { // Clase principal (Pasivo) $fontClass = 'font-extrabold text-gray-900 text-sm'; } elseif ($len == 2) { // Grupo 21, 22, 23, etc. $rowClass = 'bg-gray-100'; $fontClass = 'font-bold text-gray-800'; } elseif ($len == 4) { // Subgrupo 2105, 2205, etc. $fontClass = 'font-semibold text-gray-700'; } else { // Cuentas de movimiento $fontClass = 'text-gray-600'; } // Sangría visual por nivel $indent = ($nivel - 1) * 12; @endphp {{-- CÓDIGO --}} {{-- NOMBRE --}} @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL PASIVOS {{ number_format($totalPasivos, 0, ',', '.') }}
{{-- FIN PASIVOS --}} {{-- PATRIMONIO --}}

PATRIMONIO

@foreach ($patrimonio as $cuenta) @php $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; $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'; } $indent = ($nivel - 1) * 12; @endphp @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL PATRIMONIO {{ number_format($totalPatrimonio, 0, ',', '.') }}
{{-- FIN PATRIMONIO --}} {{-- VENTAS / INGRESOS --}}

VENTAS

@foreach ($ventas as $cuenta) @php // OCULTAR CUENTAS SIN MOVIMIENTO $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; $len = strlen($codigo); // ESTILOS VISUALES $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'; } // sangría según nivel $indent = ($nivel - 1) * 12; @endphp @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL VENTAS {{ number_format($totalVentas, 0, ',', '.') }}
{{-- FIN VENTAS --}} {{-- GASTOS --}}

GASTOS

@foreach ($gastos as $cuenta) @php $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; $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'; } $indent = ($nivel - 1) * 12; @endphp @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL GASTOS {{ number_format($totalGastos, 0, ',', '.') }}
{{-- FIN GASTOS --}} {{-- COSTOS --}}

COSTOS DE VENTAS

@foreach ($costos as $cuenta) @php $sin_actividad = $cuenta['saldo_anterior'] == 0 && $cuenta['debe'] == 0 && $cuenta['haber'] == 0 && $cuenta['total_final'] == 0; if ($sin_actividad) { continue; } $codigo = $cuenta['codigo']; $nivel = $cuenta['nivel']; $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'; } $indent = ($nivel - 1) * 12; @endphp @endforeach {{-- TOTAL GENERAL --}}
Código Nombre Saldo anterior Débitos Créditos 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_final'], 0, ',', '.') }}
TOTAL COSTOS {{ number_format($totalCostos, 0, ',', '.') }}
{{-- FIN COSTOS --}} {{-- RESULTADO DEL PERIODO --}}

RESULTADO DEL PERIODO

{{-- INGRESOS --}}

INGRESOS (Ventas)

{{ number_format($ingresosPeriodo, 0, ',', '.') }}

{{-- GASTOS --}}

GASTOS

{{ number_format($gastosPeriodo, 0, ',', '.') }}

{{-- COSTOS --}}

COSTOS DE VENTAS

{{ number_format($costosVentaPeriodo, 0, ',', '.') }}

{{-- RESULTADO FINAL --}}

RESULTADO NETO DEL PERIODO

@php $resultado = $ingresosPeriodo - $gastosPeriodo - $costosVentaPeriodo; @endphp

{{ number_format($resultado, 0, ',', '.') }}

{{-- Bancos --}} @foreach ($bancos as $banco) @endforeach {{-- Modal de carga --}}

Recopilando Cuentas...

Por favor, espera un momento