Saldos Iniciales Correcion validacion Clasificaiones

This commit is contained in:
Oscar Irigoyen
2023-01-18 08:18:46 -07:00
parent 3fe6851ef3
commit e5bd328ed2

View File

@@ -647,7 +647,7 @@ Partial Class General_SaldosIniciales
Dim DTCuentasContables As New DataTable
If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172) Then
If UsuarioActual.Empresa.TipoContabilizacion = 1 Or UsuarioActual.CveEmpresa.Contiene(172, 174) Then
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
@@ -2344,9 +2344,42 @@ Partial Class General_SaldosIniciales
Private Sub ProcesaClasificaciones(dt As DataTable, dTCuentasContables As DataTable)
Dim ErrorProceso As Boolean = False
Dim SBMensajesCuentasNoEncontradas As New StringBuilder
For Each dRow As DataRow In dt.FiltraParametros(" LEN(Clasificacion) > 0 ").Rows
Dim Clasificacion As String = dRow("Clasificacion").ToString().Trim.Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString().Trim.Replace("-", "").Replace("\r\n", "").Replace(vbCrLf, "").Replace(vbCr, "")
Dim CveCuentaContableIngreso As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableIngreso}'").ToEntero()
Dim CveCuentaContableGasto As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableGasto}'").ToEntero()
If CuentaContableIngreso.Trim.Length > 0 AndAlso CveCuentaContableIngreso <= 0 Then
SBMensajesCuentasNoEncontradas.AppendLine($"Clasificación {Clasificacion} no se encontro la cuenta de ingreso {CuentaContableIngreso}.<br/>")
ErrorProceso = True
End If
If CuentaContableGasto.Trim.Length > 0 AndAlso CveCuentaContableGasto <= 0 Then
SBMensajesCuentasNoEncontradas.AppendLine($"Clasificación {Clasificacion} no se encontro la cuenta de gasto {CuentaContableGasto}.<br/>")
ErrorProceso = True
End If
Next
If ErrorProceso Then
Alert($"Cuentas no encontradas.<br/>{SBMensajesCuentasNoEncontradas.ToString}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjClasificaciones As New ClsClasificaciones
Dim ObjConta As New ClsContabilidad(ObjClasificaciones.IniciaTransacSQL)
Dim ErrorProceso As Boolean = False
Dim Contador As Integer = 0
@@ -2411,15 +2444,15 @@ Partial Class General_SaldosIniciales
Dim CveCuentaContableIngreso As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableIngreso}'").ToEntero()
Dim CveCuentaContableGasto As Integer = dTCuentasContables.FiltroPrimeroValor("CveCuenta", $"Codigo ='{CuentaContableGasto}'").ToEntero()
If CuentaContableIngreso.Trim.Length > 0 AndAlso CveCuentaContableIngreso <= 0 Then
Alert($"Clasificación {Clasificacion} no se encontro la cuenta de ingreso {CuentaContableIngreso}.", TipoMensaje.MsgAdvertencia)
ErrorProceso = True
End If
'If CuentaContableIngreso.Trim.Length > 0 AndAlso CveCuentaContableIngreso <= 0 Then
' Alert($"Clasificación {Clasificacion} no se encontro la cuenta de ingreso {CuentaContableIngreso}.", TipoMensaje.MsgAdvertencia)
' ErrorProceso = True
'End If
If CuentaContableGasto.Trim.Length > 0 AndAlso CveCuentaContableGasto <= 0 Then
Alert($"Clasificación {Clasificacion} no se encontro la cuenta de gasto {CuentaContableGasto}.", TipoMensaje.MsgAdvertencia)
ErrorProceso = True
End If
'If CuentaContableGasto.Trim.Length > 0 AndAlso CveCuentaContableGasto <= 0 Then
' Alert($"Clasificación {Clasificacion} no se encontro la cuenta de gasto {CuentaContableGasto}.", TipoMensaje.MsgAdvertencia)
' ErrorProceso = True
'End If
Dim CveClasificaionTemp = DTClasificaiones.FiltroPrimeroValor("CveClasificacion", $"Clasificacion='{Clasificacion}'").ToEntero()
@@ -2435,9 +2468,17 @@ Partial Class General_SaldosIniciales
CveClasificacion = ObjClasificaciones.CveClasificacion
If Not CveClasificacion > 0 Then
If CveClasificacion > 0 Then
If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
DTClasificaiones = ObjClasificaciones.DtResultados
End If
Else
ErrorProceso = True
End If
Else
ErrorProceso = True
End If