-- mejoradando mensaje de registro por falta de cuenta

This commit is contained in:
2023-01-20 06:18:22 -07:00
parent 839a16e5c4
commit 93aa84b582
2 changed files with 27 additions and 33 deletions

View File

@@ -1016,22 +1016,24 @@ Public Class ClsContabilidad
If ex1.Message.Contains("50015;") Then If ex1.Message.Contains("50015;") Then
OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("No se puede registrar una póliza en un ejercicio Cerrado", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("50024; La Cuenta no fue detectada") Then ElseIf ex1.Message.Contains("50024; La Cuenta no fue detectada") Then
Dim Strr As String = "" Dim dtt As DataTable = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable)
If HttpContext.Current.Application("GlobalDTContaConceptosContables") IsNot Nothing Then Dim StrMsg As String = ""
Dim dr As Data.DataRow = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimero(String.Format("CveConceptoContable = {0}", CveConceptoContable)) If dtt IsNot Nothing Then
Strr = dr("ConceptoContable").ToString Dim dr As Data.DataRow = dtt.FiltroPrimero("")
'If dr("AplicaClasificacion").ToString <> "No" Then If dr IsNot Nothing Then
' Strr = Strr + " - Clasificación: " + DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("", "") StrMsg = dr("ConceptoContable").ToString
'End If If dr("AplicaClasificacion").ToString = "True" Then
StrMsg = StrMsg + " - Clasificación: " + ClsPaginas.GlobalDTClasificaciones(CType(HttpContext.Current.Session("UsuarioSIG"), Usuario).CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("Clasificacion", "")
End If
End If
End If End If
OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", Strr), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then ElseIf ex1.Message.Contains("Vw_Val_Conta_CuentasResultados_SubProyectos") Then
Dim Concepto2 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) Dim Concepto2 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable")
OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto2), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then ElseIf ex1.Message.Contains("UK_Vw_Val_Conta_CuentasResultados_SubProyectos") Then
Dim Concepto3 As String = DirectCast(HttpContext.Current.Application("GlobalDTContaConceptosContables"), DataTable).FiltroPrimeroValor("ConceptoContable", String.Format("CveConceptoContable = {0}", CveConceptoContable)) Dim Concepto3 As String = ClsPaginas.GlobalDTContaConceptosContables(CveConceptoContable).FiltroPrimeroValor("ConceptoContable")
OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError(String.Format("El concepto '{0}' requiere centro de costo", Concepto3), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("50025;") Then ElseIf ex1.Message.Contains("50025;") Then
OnError("La empresa no tiene un formato de cuenta asignado.", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError("La empresa no tiene un formato de cuenta asignado.", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
ElseIf ex1.Message.Contains("50026;") Then ElseIf ex1.Message.Contains("50026;") Then

View File

@@ -872,14 +872,13 @@ Public Class ClsPaginas
#End Region #End Region
Public Shared Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjClasificaciones As New ClsClasificaciones Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then Application(AppNombre) = ObjClasificaciones.DtResultados If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
End If End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
@@ -888,25 +887,20 @@ Public Class ClsPaginas
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTClasificaciones = DirectCast(Application(AppNombre), DataTable) GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTRHActividades(CveEmpresa As Integer) As DataTable Property GlobalDTRHActividades(CveEmpresa As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTRHActividades-{0}", CveEmpresa)
@@ -3542,28 +3536,26 @@ Public Class ClsPaginas
Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable Public Shared Property GlobalDTContaConceptosContables(CveConceptoContable As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If HttpContext.Current.Application(AppNombre) Is Nothing Then
Using ObjContabilidad As New ClsContabilidad Using ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetConta_ConceptosContables() Then Application(AppNombre) = ObjContabilidad.DtResultados Else Application(AppNombre) = Nothing If ObjContabilidad.GetConta_ConceptosContables() Then HttpContext.Current.Application(AppNombre) = ObjContabilidad.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
End Using End Using
End If End If
If CveConceptoContable <> -1 Then If CveConceptoContable <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveConceptoContable = {0}", CveConceptoContable), "", DataViewRowState.CurrentRows)
GlobalDTContaConceptosContables = Dv.ToTable GlobalDTContaConceptosContables = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTContaConceptosContables = DirectCast(Application(AppNombre), DataTable) GlobalDTContaConceptosContables = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables") Dim AppNombre As String = String.Format("GlobalDTContaConceptosContables")
Application(AppNombre) = value HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
#End Region #End Region