-cambios en globalsDT2

This commit is contained in:
janeth arvizu
2020-01-02 12:55:04 -07:00
parent 7dcdf8bc22
commit b9f942cb72
30 changed files with 878 additions and 649 deletions

View File

@@ -435,7 +435,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores Dim P As New ClsCompProveedores
If P.GetProveedorClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose() P.Dispose()
End If End If
@@ -449,8 +449,9 @@ Public Class ClsPaginas
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTProveedorClasificacion{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTProveedorSucursales(CveProveedor As Integer, CveEmpresa As Integer) As DataTable Property GlobalDTProveedorSucursales(CveProveedor As Integer, CveEmpresa As Integer) As DataTable
@@ -459,7 +460,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim P As New ClsCompProveedores Dim P As New ClsCompProveedores
If P.GetSucursales(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = P.DtResultados If P.GetSucursales(-1, CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose() P.Dispose()
End If End If
@@ -473,8 +474,9 @@ Public Class ClsPaginas
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTProveedorSucursales{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTRoles(CveEmpresa As Integer) As DataTable Property GlobalDTRoles(CveEmpresa As Integer) As DataTable
@@ -755,37 +757,36 @@ Public Class ClsPaginas
Application("GlobalDTSATUsosCFDI") = value Application("GlobalDTSATUsosCFDI") = value
End Set End Set
End Property End Property
Public Shared Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable Public Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
'sino existe, recarga los datos 'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida() Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
'If ObjUnidadesMedida.GetUnidadesMedidaAlias() Then Application("GlobalDTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados Else Application("GlobalDTUnidadesMedidaAlias") = Nothing
ObjUnidadesMedida.Dispose() ObjUnidadesMedida.Dispose()
End If End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) GlobalDTUnidadesMedida = DirectCast(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("GlobalDTUnidadesMedida{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTUnidadesMedida{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
'sino existe, recarga los datos 'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim ObjUnidadesMedida As New ClsUnidadesMedida() Dim ObjUnidadesMedida As New ClsUnidadesMedida()
If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados Else Application(AppNombre) = Nothing If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose() ObjUnidadesMedida.Dispose()
End If End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
@@ -797,8 +798,11 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTUnidadesMedidaAlias{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
'Dim ObjUnidadesMedida As New ClsUnidadesMedida()
'If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
'ObjUnidadesMedida.Dispose()
End Set End Set
End Property End Property
Property GlobalDTEstatusOrdenCompra() As DataTable Property GlobalDTEstatusOrdenCompra() As DataTable
@@ -879,20 +883,18 @@ Public Class ClsPaginas
Application("GlobalDTProyectos") = value Application("GlobalDTProyectos") = value
End Set End Set
End Property End Property
Public Shared Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
'sino existe, recarga los datos 'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then If DirectCast(Application(AppNombre), DataTable) Is Nothing Or (DirectCast(Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
HttpContext.Current.Application(AppNombre) = P.DtResultados
End If
P.Dispose() P.Dispose()
Dim msg As String = "aqui no se carga subproyectos" Dim msg As String = "aqui no se carga subproyectos"
If HttpContext.Current.Request IsNot Nothing Then If Request IsNot Nothing Then
msg = msg & HttpContext.Current.Request.ServerVariables("URL") msg = msg & Request.ServerVariables("URL")
End If End If
msg.GuardaLog() msg.GuardaLog()
@@ -905,26 +907,18 @@ Public Class ClsPaginas
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) GlobalDTSubProyectos = DirectCast(Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(ByVal value As DataTable) Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
If value Is Nothing OrElse value.Rows.Count = 0 Then Application(AppNombre) = value
Dim msg As String = "aqui no se carga subproyectos"
If HttpContext.Current.Request IsNot Nothing Then
msg = msg & HttpContext.Current.Request.ServerVariables("URL")
End If
msg.GuardaLog()
End If
HttpContext.Current.Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
@@ -1179,20 +1173,20 @@ Public Class ClsPaginas
ObjPS.Dispose() ObjPS.Dispose()
End Get End Get
End Property End Property
Public Shared Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable Public Property GlobalDTPSSimplificado(CveEmpresa As Integer, Optional CveClasificacion As Integer = -1, Optional PSCodigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
'sino existe, recarga los datos 'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(-1) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable() Else HttpContext.Current.Application("GlobalDTPSSimplificado") = Nothing If ObjPS.GetPSSimplificado(CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose() ObjPS.Dispose()
End If End If
Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)) Dim Cons = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow))
Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa)) Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion)) If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
@@ -1207,12 +1201,12 @@ Public Class ClsPaginas
End Try End Try
Else Else
GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable GlobalDTPSSimplificado = DirectCast(Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Property GlobalDTProductosServiciosAlias(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
@@ -1221,9 +1215,8 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAlias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing If ObjPS.GetPSAlias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose() ObjPS.Dispose()
End If End If
@@ -1241,20 +1234,19 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTProductosServiciosAlias{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Public Shared Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable Public Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
'sino existe, recarga los datos 'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing If ObjPS.GetPSEquivalencias(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose() ObjPS.Dispose()
End If End If
End If End If
@@ -1264,16 +1256,17 @@ Public Class ClsPaginas
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM) If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) GlobalDTProductosServiciosEquivalencias = DirectCast(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("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable Property GlobalDTProductosServiciosCaracteristicas(CveEmpresa As Integer) As DataTable
@@ -1299,7 +1292,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose() ObjPS.Dispose()
End If End If
@@ -1317,8 +1310,9 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTPSAdicionales{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable Property GlobalDTProductosServiciosCaracteristicasOpciones(CveEmpresa As Integer) As DataTable
@@ -1374,7 +1368,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjPS As New ClsProductosServicios Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados Else Application(AppNombre) = Nothing If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose() ObjPS.Dispose()
End If End If
@@ -1391,8 +1385,11 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTImpuestosLocales{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSImpuestosLocales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
'ObjPS.Dispose()
End Set End Set
End Property End Property
'Bancos 'Bancos
@@ -1516,7 +1513,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose() ObjClientes.Dispose()
End If End If
@@ -1536,8 +1533,8 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
@@ -1546,7 +1543,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes Dim ObjClientes As New ClsClientes
If ObjClientes.GetClienteClasificacion(UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados Else Application(AppNombre) = Nothing If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose() ObjClientes.Dispose()
End If End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
@@ -1559,8 +1556,8 @@ Public Class ClsPaginas
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
@@ -1580,16 +1577,24 @@ Public Class ClsPaginas
'Variables para Ventas 'Variables para Ventas
Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable Property GlobalDTVendedores(CveEmpresa As Integer, Optional Estatus As Boolean = True, Optional VendedorTipo As Integer = 1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTVendedores{0}", CveEmpresa)
'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then
Dim ObjVendedores As New ClsVtaVendedores
If ObjVendedores.GetVendedores(-1) Then Application(AppNombre) = ObjVendedores.DtResultados
ObjVendedores.Dispose()
End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTVendedores"), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0} AND CveEstatus = {1} AND VendedorTipo = {2}", CveEmpresa, If(Estatus, 1, 0), VendedorTipo), "", DataViewRowState.CurrentRows)
GlobalDTVendedores = Dv.ToTable GlobalDTVendedores = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTVendedores = DirectCast(Application("GlobalDTVendedores"), DataTable) GlobalDTVendedores = DirectCast(Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTVendedores") = value Dim AppNombre As String = String.Format("GlobalDTVendedores{0}", CveEmpresa)
Application(AppNombre) = value
End Set End Set
End Property End Property
Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable Property GlobalDTClientesCorporativo(CveEmpresa As Integer) As DataTable
@@ -1612,7 +1617,7 @@ Public Class ClsPaginas
'sino existe, recarga los datos 'sino existe, recarga los datos
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjProveedores As New ClsCompProveedores Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados Else Application(AppNombre) = Nothing If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
ObjProveedores.Dispose() ObjProveedores.Dispose()
End If End If
@@ -1626,8 +1631,11 @@ Public Class ClsPaginas
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa) Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
Application(AppNombre) = value Application(AppNombre) = value
'Dim ObjProveedores As New ClsCompProveedores
'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then Application(AppNombre) = ObjProveedores.DtResultados
'ObjProveedores.Dispose()
End Set End Set
End Property End Property
'EstatusFactura 'EstatusFactura
@@ -3228,7 +3236,36 @@ Public Class ClsPaginas
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTAcumTiposUso") = value Application("GlobalDTAcumTiposUso") = value
End Set End Set
End Property End Property
Property GlobalDTAcumGarantiasMesesTipoUso(CveEmpresa As Integer, CveMarca As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso{0}", CveEmpresa)
If Application(AppNombre) Is Nothing Then
Dim ObjAcumuladores As New ClsAcumuladores()
If ObjAcumuladores.GarantiasMesesGet(-1, -1) Then Application(AppNombre) = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"})
ObjAcumuladores.Dispose()
End If
If CveMarca <> -1 Then
Dim Str As StringBuilder = New StringBuilder()
If CveMarca <> -1 Then Str.AppendFormat("CveMarca = {0}", CveMarca)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAcumGarantiasMesesTipoUso = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAcumGarantiasMesesTipoUso = DirectCast(Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTAcumGarantiasMesesTipoUso{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
Property GlobalDTAcumTamaños() As DataTable Property GlobalDTAcumTamaños() As DataTable
Get Get
GlobalDTAcumTamaños = DirectCast(Application("GlobalDTAcumTamaños"), DataTable) GlobalDTAcumTamaños = DirectCast(Application("GlobalDTAcumTamaños"), DataTable)

View File

@@ -2630,7 +2630,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador) importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago FechaMovimiento = ObjFactura.FechaPago
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -2705,7 +2705,7 @@ Namespace Modelos
importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador) importeMovimiento = ((TmpDTDetalle.SUM("TotalImporte", String.Format("CveClasificacion = {0} And CveSubProyecto = {1}", Row2("CveClasificacion"), Row2("CveSubProyecto"))).ToString.ToDecimal) * ValorMultiplicador)
importeMX = importeMovimiento * tipoCambio * Multiplicador importeMX = importeMovimiento * tipoCambio * Multiplicador
FechaMovimiento = ObjFactura.FechaPago FechaMovimiento = ObjFactura.FechaPago
Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, ClsPaginas.GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}" Concepto = $"{ObjFactura.SerieFolio} {If(Row2("CveClasificacion").ToString.ToEntero > 0, GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Clasificacion", $"CveClasificacion = {Row2("CveClasificacion").ToString}"), "")} - {If(Row2("CveSubProyecto").ToString.ToEntero > 0, GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa).FiltroPrimeroValor("SubProyecto", $"CveSubProyecto = {Row2("CveSubProyecto").ToString}"), "Sin SubProyecto Asignado")}"
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas 'Nota cuando es Nota de crédiot, debe de tomar el devoluciones y rebajas
@@ -3204,7 +3204,7 @@ Namespace Modelos
If UsuarioActual.CveEmpresa = 1 Then If UsuarioActual.CveEmpresa = 1 Then
DtEquivalencias = New DataTable DtEquivalencias = New DataTable
DtEquivalencias = ClsPaginas.GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa) DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'") Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
@@ -5446,11 +5446,11 @@ Namespace Modelos
Public Sub SetSubProyecto() Public Sub SetSubProyecto()
If CveSubProyecto > 0 Then If CveSubProyecto > 0 Then
SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If End If
End Sub End Sub
Public Sub SetSubProyectoMatriz() Public Sub SetSubProyectoMatriz()
Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row) SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If End If
@@ -5496,12 +5496,12 @@ Namespace Modelos
End Sub End Sub
Public Sub SetSubProyecto(obj As ClsPaginas) Public Sub SetSubProyecto(obj As ClsPaginas)
If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then If CveSubProyecto > 0 AndAlso Not IsNothing(obj) Then
SubProyecto = New Modelos.SubProyectoModel(ClsPaginas.GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}")) SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero($"CveSubProyecto = {CveSubProyecto}"))
End If End If
End Sub End Sub
Public Sub SetSubProyectoMatriz(obj As ClsPaginas) Public Sub SetSubProyectoMatriz(obj As ClsPaginas)
If Not IsNothing(obj) Then If Not IsNothing(obj) Then
Dim Row As Data.DataRow = ClsPaginas.GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1") Dim Row As Data.DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=obj.UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1")
If Not IsNothing(Row) Then If Not IsNothing(Row) Then
SubProyectoMatriz = New Modelos.SubProyectoModel(Row) SubProyectoMatriz = New Modelos.SubProyectoModel(Row)
End If End If
@@ -5937,6 +5937,27 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTProveedoresCuentas") = value HttpContext.Current.Application("GlobalDTProveedoresCuentas") = value
End Set End Set
End Property End Property
Public ReadOnly Property GlobalDTProductosServiciosEquivalencias(CvePS As Integer, CveUM As Integer, CveEmpresa As Integer) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTProductosServiciosEquivalencias{0}", CveEmpresa)
If CvePS <> -1 OrElse CveUM <> -1 Then
Dim StrSQL As New StringBuilder
If CvePS <> -1 Then StrSQL.AppendFormat(" AND CvePS = {0}", CvePS)
If CveUM <> -1 Then StrSQL.AppendFormat(" AND CveUM = {0}", CveUM)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosEquivalencias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProductosServiciosEquivalencias = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
End Property
Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable
Get Get
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
@@ -6245,34 +6266,34 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set End Set
End Property End Property
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable ' GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable) ' GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUnidadesMedida") = value ' HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedidaAlias = Dv.ToTable ' GlobalDTUnidadesMedidaAlias = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable) ' GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value ' HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTEstatusOrdenCompra() As DataTable Property GlobalDTEstatusOrdenCompra() As DataTable
Get Get
GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable) GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable)
@@ -6341,6 +6362,45 @@ Namespace Modelos
End Set End Set
End Property End Property
Public Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(HttpContext.Current.Application(AppNombre), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application(AppNombre), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application(AppNombre), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = P.DtResultados
P.Dispose()
Dim msg As String = "aqui no se carga subproyectos"
If HttpContext.Current.Request IsNot Nothing Then
msg = msg & HttpContext.Current.Request.ServerVariables("URL")
End If
msg.GuardaLog()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose()
Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(ByVal value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTSubProyectos{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get Get
@@ -6698,51 +6758,64 @@ Namespace Modelos
'Fin Ruta 'Fin Ruta
'Cliente 'Cliente
Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get Get
If CveEmpresa <> -1 Then Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
'sino existe, recarga los datos
Dim StrSQL As New StringBuilder If HttpContext.Current.Application(AppNombre) Is Nothing Then
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) Dim ObjClientes As New ClsClientes
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose()
If HttpContext.Current.Application("GlobalDTCliente") Is Nothing Then End If
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then HttpContext.Current.Application("GlobalDTCliente") = ObjClientes.DtResultados Else HttpContext.Current.Application("GlobalDTCliente") = Nothing
ObjClientes.Dispose() If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) Dim StrSQL As New StringBuilder
GlobalDTCliente = Dv.ToTable StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
Dv.Dispose() If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
Else Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) GlobalDTCliente = Dv.ToTable
GlobalDTCliente = Dv.ToTable Dv.Dispose()
Dv.Dispose()
End If Else
GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
Else End If
GlobalDTCliente = DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable) End Get
End If Set(value As DataTable)
End Get Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
Set(value As DataTable) HttpContext.Current.Application(AppNombre) = value
HttpContext.Current.Application("GlobalDTCliente") = value 'Dim ObjClientes As New ClsClientes
End Set 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
End Property 'ObjClientes.Dispose()
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable End Set
Get End Property
If CveEmpresa <> -1 Then Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
Get
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
GlobalDTClienteClasificaciones = Dv.ToTable 'sino existe, recarga los datos
Dv.Dispose() If HttpContext.Current.Application(AppNombre) Is Nothing Then
Else Dim ObjClientes As New ClsClientes
GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable) If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
End If ObjClientes.Dispose()
End Get End If
Set(value As DataTable) If CveEmpresa <> -1 Then
HttpContext.Current.Application("GlobalDTClasificacionesCliente") = value
End Set Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClienteClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
'ObjClientes.Dispose()
End Set
End Property End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable
Get Get

View File

@@ -356,13 +356,15 @@ Public Class Timbrado
Else Else
conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654") conector.EstableceCredenciales("vSGxMFWnNRy/nDoowxqrqw==|Sia123654")
End If End If
MsgCancelacion.AppendFormat("-3.2")
Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacionAck Dim resultadoCancelacion As Profact.TimbraCFDI.ResultadoCancelacionAck
resultadoCancelacion = conector.CancelaCFDIAck(RFCEmisor, FolioFiscal) resultadoCancelacion = conector.CancelaCFDIAck(RFCEmisor, FolioFiscal)
CancelacionFecha = Now CancelacionFecha = Now
Dim resp As Profact.TimbraCFDI.ResultadoConsulta Dim resp As Profact.TimbraCFDI.ResultadoConsulta
resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal) resp = conector.ObtieneCFDI(RFCEmisor, FolioFiscal)
MsgCancelacion.AppendFormat("-3.3")
If resultadoCancelacion.Exitoso Then If resultadoCancelacion.Exitoso Then
MsgCancelacion.AppendFormat("-3.4")
CancelacionMensaje = resultadoCancelacion.Descripcion CancelacionMensaje = resultadoCancelacion.Descripcion
Dim xmlDoc As New System.Xml.XmlDocument() Dim xmlDoc As New System.Xml.XmlDocument()
@@ -372,20 +374,22 @@ Public Class Timbrado
xmlDoc.LoadXml(resp.Xml) xmlDoc.LoadXml(resp.Xml)
End Try End Try
MsgCancelacion.AppendFormat("-3.4.1")
Dim xpath As String = "Acuse/Folios" Dim xpath As String = "Acuse/Folios"
Dim nodes = xmlDoc.SelectNodes(xpath) Dim nodes = xmlDoc.SelectNodes(xpath)
CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero CancelacionState = xmlDoc.GetElementsByTagName("EstatusUUID")(0).InnerText.ToEntero
MsgCancelacion.AppendFormat("-3.4.2")
xpath = "Acuse/Signature" xpath = "Acuse/Signature"
nodes = xmlDoc.SelectNodes(xpath) nodes = xmlDoc.SelectNodes(xpath)
MsgCancelacion.AppendFormat("-3.4.3")
CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText CancelacionAcuse = xmlDoc.GetElementsByTagName("SignatureValue")(0).InnerText
CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate CancelacionFecha = xmlDoc.SelectSingleNode("Acuse").Attributes("Fecha").Value.ToDate
Retorno = True Retorno = True
Else Else
MsgCancelacion.AppendFormat("-3.5")
CancelacionAcuse = resp.NumeroError CancelacionAcuse = resp.NumeroError
CancelacionMensaje = resultadoCancelacion.Xml
Retorno = False Retorno = False
End If End If

View File

@@ -50,10 +50,10 @@ Namespace Extensiones
Public Function CadenaConexion() As String Public Function CadenaConexion() As String
Dim BaseDatos As String = "Ventas" Dim BaseDatos As String = "Ventas"
If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then 'If Not IsNothing(System.Web.HttpContext.Current) AndAlso Not IsNothing(System.Web.HttpContext.Current.Session) Then
BaseDatos = CType(System.Web.HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.BaseDatosNombre ' BaseDatos = CType(System.Web.HttpContext.Current.Session("UsuarioSIG"), Usuario).Empresa.BaseDatosNombre
End If 'End If
Return String.Format("Data Source=192.168.0.2;Initial Catalog={0};User Id=JCaudillo;Password=JCau127*953;pooling=True; Min Pool Size=10;Application Name=SIG;", BaseDatos) Return String.Format("Data Source=192.168.0.2;Initial Catalog={0};User Id=JCaudillo;Password=JCau127*953;pooling=True; Min Pool Size=10;Application Name=SIG;", BaseDatos)

View File

@@ -1562,34 +1562,34 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value HttpContext.Current.Application("GlobalDTSATUsosCFDI") = value
End Set End Set
End Property End Property
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable ' GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable) ' GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedida"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUnidadesMedida") = value ' HttpContext.Current.Application("GlobalDTUnidadesMedida") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedidaAlias(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedidaAlias = Dv.ToTable ' GlobalDTUnidadesMedidaAlias = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable) ' GlobalDTUnidadesMedidaAlias = DirectCast(HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value ' HttpContext.Current.Application("GlobalDTUnidadesMedidaAlias") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTEstatusOrdenCompra() As DataTable Property GlobalDTEstatusOrdenCompra() As DataTable
Get Get
GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable) GlobalDTEstatusOrdenCompra = DirectCast(HttpContext.Current.Application("GlobalDTEstatusOrdenCompra"), DataTable)
@@ -1657,44 +1657,44 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
HttpContext.Current.Application("GlobalDTProyectos") = value HttpContext.Current.Application("GlobalDTProyectos") = value
End Set End Set
End Property End Property
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable 'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get ' Get
If DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then ' If DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos ' Dim P As New ClsSubProyectos
If P.GetSubProyectos Then ' If P.GetSubProyectos Then
HttpContext.Current.Application("GlobalDTSubProyectos") = P.DtResultados ' HttpContext.Current.Application("GlobalDTSubProyectos") = P.DtResultados
End If ' End If
P.Dispose() ' P.Dispose()
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
End If ' End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then ' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder ' Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) ' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) ' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) ' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable ' GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable) ' GlobalDTSubProyectos = DirectCast(HttpContext.Current.Application("GlobalDTSubProyectos"), DataTable)
End If ' End If
End Get ' End Get
Set(ByVal value As DataTable) ' Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then ' If value Is Nothing OrElse value.Rows.Count = 0 Then
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
End If ' End If
HttpContext.Current.Application("GlobalDTSubProyectos") = value ' HttpContext.Current.Application("GlobalDTSubProyectos") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable Property GlobalDTSubProyectosUsuarios(CveUsuario As Integer, CveProyecto As Integer, CveEmpresa As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEstatus As Integer = -1) As DataTable
Get Get
@@ -2085,48 +2085,61 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
'Cliente 'Cliente
Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim StrSQL As New StringBuilder Dim StrSQL As New StringBuilder
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus)
If HttpContext.Current.Application("GlobalDTCliente") Is Nothing Then Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
Dim ObjClientes As New ClsClientes GlobalDTCliente = Dv.ToTable
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then HttpContext.Current.Application("GlobalDTCliente") = ObjClientes.DtResultados Else HttpContext.Current.Application("GlobalDTCliente") = Nothing Dv.Dispose()
ObjClientes.Dispose()
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
Else
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable
Dv.Dispose()
End If
Else Else
GlobalDTCliente = DirectCast(HttpContext.Current.Application("GlobalDTCliente"), DataTable) GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
HttpContext.Current.Application("GlobalDTCliente") = value Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then Application(AppNombre) = ObjClientes.DtResultados
'ObjClientes.Dispose()
End Set End Set
End Property End Property
Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable Property GlobalDTClienteClasificaciones(CveEmpresa As Integer) As DataTable
Get Get
Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClienteClasificacion(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose()
End If
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClienteClasificaciones = Dv.ToTable GlobalDTClienteClasificaciones = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClienteClasificaciones"), DataTable) GlobalDTClienteClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificacionesCliente") = value Dim AppNombre As String = String.Format("GlobalDTClienteClasificaciones{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
'Dim ObjClientes As New ClsClientes
'If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
'ObjClientes.Dispose()
End Set End Set
End Property End Property
Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable Property GlobalDTEstatusOrdenServicios(CveEmpresa As Integer) As DataTable

View File

@@ -182,22 +182,38 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
context.Response.Write("") context.Response.Write("")
Else Else
CveEmpresa = usuario.CveEmpresa CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTCliente"), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then 'sino existe, recarga los datos
DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'") If context.Application(AppNombre) Is Nothing Then
End If Dim ObjClientes As New ClsClientes
End If If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
context.Application(AppNombre) = ObjClientes.DtResultados
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then End If
DtRetorno.Columns("CveCliente").ColumnName = "id" ObjClientes.Dispose()
DtRetorno.Columns("NombreComercial").ColumnName = "text" End If
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno) 'Dim ObjClientes As New ClsClientes
Else 'If ObjClientes.GetClientes(-1, Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
context.Response.Write("[]") ' DtRetorno = ObjClientes.DtResultados
End If 'End If
'ObjClientes.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"NombreComercial like '%{Name}%'")
End If
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CveCliente").ColumnName = "id"
DtRetorno.Columns("NombreComercial").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
Return retorno Return retorno
End Function End Function
#End Region #End Region
@@ -213,22 +229,37 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
context.Response.Write("") context.Response.Write("")
Else Else
CveEmpresa = usuario.CveEmpresa CveEmpresa = usuario.CveEmpresa
Dim Name = IfNull(context.Request("Name"), "-1").ToString Dim Name = IfNull(context.Request("Name"), "-1").ToString
Dim dt As DataTable = DirectCast(context.Application("GlobalDTCompProveedores"), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}") Dim AppNombre As String = String.Format("GlobalDTCompProveedores{0}", CveEmpresa)
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then 'sino existe, recarga los datos
DtRetorno = dt.FiltraParametros($"RazonSocial like '%{Name}%'") If context.Application(AppNombre) Is Nothing Then
End If Dim ObjProveedores As New ClsCompProveedores
End If If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
context.Application(AppNombre) = ObjProveedores.DtResultados
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then End If
DtRetorno.Columns("CveProveedor").ColumnName = "id" ObjProveedores.Dispose()
DtRetorno.Columns("RazonSocial").ColumnName = "text" End If
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno) 'Dim ObjProveedores As New ClsCompProveedores
Else 'If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, -1, "-1", Name, "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa) Then
context.Response.Write("[]") ' DtRetorno = ObjProveedores.DtResultados
End If 'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros($"CveEmpresa = {CveEmpresa}")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros($"RazonSocial like '%{Name}%'")
End If
End If
If DtRetorno IsNot Nothing AndAlso DtRetorno.Rows.Count > 0 Then
DtRetorno.Columns("CveProveedor").ColumnName = "id"
DtRetorno.Columns("RazonSocial").ColumnName = "text"
retorno = JsonConvert.SerializeObject(DtRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
Return retorno Return retorno
End Function End Function
#End Region #End Region
@@ -345,90 +376,99 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If End If
If UsaGlobal Then If UsaGlobal Then
'se recarga el global, y el clspaginas, son los unicos 2 lugares
Dim AppNombre As String = String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)
If context.Application(String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)) Is Nothing Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSSimplificado(CveEmpresa) Then context.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
ObjPS.Dispose()
End If
Dim DTPS = DirectCast(context.Application(AppNombre), EnumerableRowCollection(Of DataRow))
'Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
If DTPS IsNot Nothing Then
'APLICACION DE FILTROS
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If Estatus = 1 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
ElseIf Estatus = -1 Then
End If
'If FuePorXml >= 0 Then
' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!FuePorXML) = FuePorXml))
'End If
If Name <> "-1" Then
If PSCodigoDescripcion = "PSCodigo" Then
DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
Else
DTPS = DTPS.Where((Function(a) a!PSCodigoClasificacion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
End If
End If
If CveClasificacion > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
ElseIf CveClasificacion = -1 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
End If
If AplicaParaVenta > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = 1))
End If
'If CveSubFamilia > 0 Then
' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) = CveSubFamilia))
' 'ElseIf CveSubFamilia = -1 Then
' 'DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) > 0))
'End If
If CveClasificacionPresupuesto > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
End If
If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
If Pagina <> "-1" Then
If Pagina = "Compras" Then
DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
ElseIf Pagina = "Compras2" Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
ElseIf Pagina = "Inventarios" Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
End If
End If
'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
Try
DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"})
Catch ex As Exception
DtPSRetorno = Nothing
End Try
End If
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CvePS").ColumnName = "id"
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
If PSCodigoDescripcion = "PSCodigo" Then
DtPSRetorno.Columns().Remove("PSCodigoClasificacion")
Else
DtPSRetorno.Columns().Remove("PSCodigo")
End If
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
End If
'Dim DTPS = DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable
If DTPS IsNot Nothing Then
'APLICACION DE FILTROS
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
If Estatus = 1 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveEstado) = 1))
ElseIf Estatus = -1 Then
End If
'If FuePorXml >= 0 Then
' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!FuePorXML) = FuePorXml))
'End If
If Name <> "-1" Then
If PSCodigoDescripcion = "PSCodigo" Then
DTPS = DTPS.Where((Function(a) a!PSCodigo.ToString.ToLower Like ("*" + Name.ToLower + "*")))
Else
DTPS = DTPS.Where((Function(a) a!PSCodigoClasificacion.ToString.ToLower Like ("*" + Name.ToLower + "*")))
End If
End If
If CveClasificacion > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
ElseIf CveClasificacion = -1 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacion) >= 0))
End If
If AplicaParaVenta > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = 1))
End If
'If CveSubFamilia > 0 Then
' DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) = CveSubFamilia))
' 'ElseIf CveSubFamilia = -1 Then
' 'DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveSubFamilia) > 0))
'End If
If CveClasificacionPresupuesto > 0 Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveClasificacionPresupuesto) = CveClasificacionPresupuesto))
End If
If UsoClasificacion > 0 Then DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!UsoClasificacion) = UsoClasificacion))
If Pagina <> "-1" Then
If Pagina = "Compras" Then
DTPS = DTPS.Where((Function(a) a!CveTipoPS = 1 AndAlso a!CveEstado = 1))
ElseIf Pagina = "Compras2" Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 1 AndAlso (Convert.ToInt32(a!CveEstado) = 1 OrElse Convert.ToInt32(a!CveEstado) = 2)))
ElseIf Pagina = "Inventarios" Then
DTPS = DTPS.Where((Function(a) Convert.ToInt32(a!CveTipoPS) = 2))
End If
End If
'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
Try
DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"})
Catch ex As Exception
DtPSRetorno = Nothing
End Try
End If
End If
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
DtPSRetorno.Columns("CvePS").ColumnName = "id"
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
If PSCodigoDescripcion = "PSCodigo" Then
DtPSRetorno.Columns().Remove("PSCodigoClasificacion")
Else
DtPSRetorno.Columns().Remove("PSCodigo")
End If
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
context.Response.Write(retorno)
Else
context.Response.Write("[]")
End If
End If
Return retorno Return retorno
End Function End Function
#End Region #End Region
@@ -574,17 +614,12 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
Dim UsaGlobal As Boolean = True Dim UsaGlobal As Boolean = True
If UsaGlobal Then If UsaGlobal Then
Dim DTPS = DirectCast(context.Application(String.Format("GlobalDTPSSimplificado{0}", CveEmpresa)), EnumerableRowCollection(Of DataRow))
Dim DTPS = ClsPaginas.GlobalDTPSSimplificado(CveEmpresa).AsEnumerable ' DirectCast(context.Application("GlobalDTPSSimplificado"), EnumerableRowCollection(Of DataRow))
If DTPS IsNot Nothing Then If DTPS IsNot Nothing Then

View File

@@ -496,7 +496,7 @@ Partial Class Bancos_ProveedoresAbonar
ViewState("CveCuentaComplementaria") = ObjProveedor.CveCuentaProveedoresComplementaria ViewState("CveCuentaComplementaria") = ObjProveedor.CveCuentaProveedoresComplementaria
If Serie <> "" AndAlso Serie <> "-1" Then If Serie <> "" AndAlso Serie <> "-1" Then
Dim dr As DataRow = GlobalDTProveedorSucursales(CveProveedor).FiltroPrimero(String.Format("Serie = '{0}'", Serie)) Dim dr As DataRow = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("Serie = '{0}'", Serie))
If dr IsNot Nothing Then If dr IsNot Nothing Then
TxtObservaciones.Text = String.Format("Suc. {0}", dr("ProveedorSucursal")) TxtObservaciones.Text = String.Format("Suc. {0}", dr("ProveedorSucursal"))
HdnObs.Value = TxtObservaciones.Text HdnObs.Value = TxtObservaciones.Text

View File

@@ -112,7 +112,7 @@ Partial Class Ventas_RepRecuperacionDetalle
DivProveedores.Visible = True DivProveedores.Visible = True
Dim ObjProveedores As New ClsCompProveedores Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetSucursales(CveProveedor) Then If ObjProveedores.GetSucursales(CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedores.DtResultados.Rows.Count > 0 Then If ObjProveedores.DtResultados.Rows.Count > 0 Then
DdlProveedorSucursal.DataSource = ObjProveedores.DtResultados DdlProveedorSucursal.DataSource = ObjProveedores.DtResultados
End If End If

View File

@@ -4140,8 +4140,9 @@ Partial Class Compras_Compras
'si hay necesidad de actualizar el globaldtps 'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then If RegeneraPS Then
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDT(Nothing)
End If End If
Dim CvePlantillaPrePoliza As Integer Dim CvePlantillaPrePoliza As Integer
@@ -17504,15 +17505,17 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub RecargaGlobalEquivalencias() Private Sub RecargaGlobalEquivalencias()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
Hilo.Start() 'Hilo.Start()
GeneraGlobalEquivalencias()
End Sub End Sub
Private Sub GeneraGlobalEquivalencias() Private Sub GeneraGlobalEquivalencias()
Dim ObjPS = New ClsProductosServicios GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
If ObjPS.GetPSEquivalencias(-1, -1) Then 'Dim ObjPS = New ClsProductosServicios
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados 'If ObjPS.GetPSEquivalencias(-1, -1) Then
End If ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
ObjPS.Dispose() 'End If
'ObjPS.Dispose()
End Sub End Sub
#End Region #End Region
@@ -17664,23 +17667,26 @@ Partial Class Compras_Compras
End Sub End Sub
Private Sub RecargaGlobalUM() Private Sub RecargaGlobalUM()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalUM) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalUM)
Hilo.Start() 'Hilo.Start()
GeneraGlobalUM()
End Sub End Sub
Private Sub GeneraGlobalUM() Private Sub GeneraGlobalUM()
Dim ObjPS = New ClsProductosServicios GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Dim OjbUM As New ClsUnidadesMedida GlobalDTUnidadesMedidaAlias(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS = New ClsProductosServicios
If ObjPS.GetPSEquivalencias(-1, -1) Then 'Dim OjbUM As New ClsUnidadesMedida
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
End If 'If ObjPS.GetPSEquivalencias(-1, -1) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
If OjbUM.GetUnidadesMedidaAlias(-1) Then 'End If
GlobalDTUnidadesMedidaAlias = OjbUM.DtResultados
End If 'If OjbUM.GetUnidadesMedidaAlias(-1) Then
' GlobalDTUnidadesMedidaAlias = OjbUM.DtResultados
ObjPS.Dispose() 'End If
OjbUM.Dispose()
'ObjPS.Dispose()
'OjbUM.Dispose()
End Sub End Sub
#End Region #End Region
@@ -19068,7 +19074,7 @@ Partial Class Compras_Compras
RecargaPSGlobal() RecargaPSGlobal()
End Sub End Sub
Private Sub RecargaPSGlobal() Private Sub RecargaPSGlobal()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios 'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable()

View File

@@ -1498,7 +1498,7 @@ Partial Class Compras_Proveedores
Next Next
End If End If
If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
End If End If
Next Next
End If End If
@@ -1533,8 +1533,8 @@ Partial Class Compras_Proveedores
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit() If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
'ACTUALIZAR GLOBAL 'ACTUALIZAR GLOBAL
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
GlobalDTCompProveedores(-1) = ObjProveedores.DtResultados GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = ObjProveedores.DtResultados
Else Else
ErrorBancos = True ErrorBancos = True
End If End If
@@ -1617,8 +1617,8 @@ Partial Class Compras_Proveedores
If tIdContaProveedor > 0 AndAlso CreoCuenta Then ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, tIdContaProveedor) If tIdContaProveedor > 0 AndAlso CreoCuenta Then ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, tIdContaProveedor)
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
GlobalDTCompProveedores(-1) = ObjProveedores.DtResultados GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = ObjProveedores.DtResultados
End If End If
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
@@ -2016,7 +2016,7 @@ Partial Class Compras_Proveedores
Public Sub CargaProveedorSucursales() Public Sub CargaProveedorSucursales()
CveTempSucursal = -1 CveTempSucursal = -1
TempDTSucursales = GlobalDTProveedorSucursales(CveProveedor) TempDTSucursales = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
TempDTSucursales.Columns.Add("CveSucursalTemp", GetType(String)) TempDTSucursales.Columns.Add("CveSucursalTemp", GetType(String))
TempDTSucursalesOrigin = TempDTSucursales.Copy() TempDTSucursalesOrigin = TempDTSucursales.Copy()
GVSucursales.DataSource = TempDTSucursales GVSucursales.DataSource = TempDTSucursales
@@ -2081,7 +2081,7 @@ Partial Class Compras_Proveedores
If EsEditarSucursal = 0 Then If EsEditarSucursal = 0 Then
If ObjProveedor.AddSucursal(CveProveedor, TxtProveedorSucursal2.Text.Trim, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text.Trim, TxtContactoSucursal.Text, TxtCorreoSucursal.Text, UsuarioActual.CveUsuario, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then If ObjProveedor.AddSucursal(CveProveedor, TxtProveedorSucursal2.Text.Trim, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text.Trim, TxtContactoSucursal.Text, TxtCorreoSucursal.Text, UsuarioActual.CveUsuario, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then
'recargo el globaldt 'recargo el globaldt
If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
Alert("La nueva Sucursal del Proveedor se guardó correctamente.", TipoMensaje.MsgInformacion) Alert("La nueva Sucursal del Proveedor se guardó correctamente.", TipoMensaje.MsgInformacion)
CargaProveedorSucursales() CargaProveedorSucursales()
End If End If
@@ -2089,7 +2089,7 @@ Partial Class Compras_Proveedores
If CveProveedorSucursal > 0 And ObjProveedor.UpdateSucursal(TxtProveedorSucursal2.Text, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text, False, TxtCorreoSucursal.Text, TxtContactoSucursal.Text, CveProveedorSucursal, CveProveedor, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then If CveProveedorSucursal > 0 And ObjProveedor.UpdateSucursal(TxtProveedorSucursal2.Text, TextSucursalDireccion.Text.Trim, TextSucursalTelefono.Text.Trim, TxtSucursalSerie.Text, False, TxtCorreoSucursal.Text, TxtContactoSucursal.Text, CveProveedorSucursal, CveProveedor, TxtLimiteCreditoSuc.Text.ToDouble, TxtPlazoCobranzaSuc.Text.ToEntero) Then
'recargo el globaldt 'recargo el globaldt
If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
CargaProveedorSucursales() CargaProveedorSucursales()
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
End If End If
@@ -2149,7 +2149,7 @@ Partial Class Compras_Proveedores
If ObjProveedor.RemoveProveedorContacto(-1, CveProveedorSucursal) Then If ObjProveedor.RemoveProveedorContacto(-1, CveProveedorSucursal) Then
If ObjProveedor.RemoveSucursal(CveProveedor, CveProveedorSucursal) Then If ObjProveedor.RemoveSucursal(CveProveedor, CveProveedorSucursal) Then
'GVSucursales.EditIndex = -1 'GVSucursales.EditIndex = -1
If ObjProveedor.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedor.DtResultados GlobalDTProveedorSucursales(-1, UsuarioActual.CveEmpresa) = Nothing
CargaProveedorSucursales() CargaProveedorSucursales()
CargaContactos(ObjProveedor) CargaContactos(ObjProveedor)
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
@@ -3162,7 +3162,7 @@ Partial Class Compras_Proveedores
End Sub End Sub
Protected Sub MostrarFiltro() Protected Sub MostrarFiltro()
If GlobalDTProveedorSucursales(CveProveedor).Rows.Count > 1 Then If GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).Rows.Count > 1 Then
'tHistorial.Visible = True 'tHistorial.Visible = True
'tCxP.Visible = True 'tCxP.Visible = True
'tAnticipos.Visible = True 'tAnticipos.Visible = True
@@ -3187,7 +3187,7 @@ Partial Class Compras_Proveedores
End If End If
End Sub End Sub
Protected Sub CargaRB(R As DropDownList) Protected Sub CargaRB(R As DropDownList)
R.DataSource = GlobalDTProveedorSucursales(CveProveedor) R.DataSource = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa)
R.DataBind() R.DataBind()
R.Items.Insert(0, New ListItem("Todas", "-1")) R.Items.Insert(0, New ListItem("Todas", "-1"))
If CveProveedorSucursal > 0 Then R.SelectedValue = CveProveedorSucursal.ToString Else R.SelectedValue = "-1" If CveProveedorSucursal > 0 Then R.SelectedValue = CveProveedorSucursal.ToString Else R.SelectedValue = "-1"

View File

@@ -1679,7 +1679,7 @@ Partial Class Contratos_Default
End Sub End Sub
Private Sub ElProductoChange() Private Sub ElProductoChange()
DdlUM.Items.Clear() DdlUM.Items.Clear()
DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1) DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductows.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUM.DataBind() DdlUM.DataBind()
UpTitulos.Update() UpTitulos.Update()
End Sub End Sub
@@ -1711,7 +1711,7 @@ Partial Class Contratos_Default
End Sub End Sub
Private Sub ElProductoChangeInsumos() Private Sub ElProductoChangeInsumos()
DdlUMInsumos.Items.Clear() DdlUMInsumos.Items.Clear()
DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1) DdlUMInsumos.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductowsInsumos.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUMInsumos.DataBind() DdlUMInsumos.DataBind()
UpTitulos.Update() UpTitulos.Update()
End Sub End Sub
@@ -1913,7 +1913,7 @@ Partial Class Contratos_Default
End If End If
End If End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1) e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlUMEdit").DataBind() e.Row.FCDropDownList("DdlUMEdit").DataBind()
e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM") e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM")
End If End If
@@ -2099,7 +2099,7 @@ Partial Class Contratos_Default
End If End If
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1) e.Row.FCDropDownList("DdlUMEdit").DataSource = GlobalDTProductosServiciosEquivalencias(e.Row.DataKey("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
e.Row.FCDropDownList("DdlUMEdit").DataBind() e.Row.FCDropDownList("DdlUMEdit").DataBind()
e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM") e.Row.FCDropDownList("DdlUMEdit").SelectedValue = e.Row.DataKey("CveUM")
End If End If

View File

@@ -725,7 +725,7 @@ Partial Class General_SaldosIniciales
If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then If Not CveUnidadMedida > 0 AndAlso UnidadMedida <> "" Then
If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then If ObjUM.AddUnidadMedida(UnidadMedida, UnidadMedida, "", "", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).ToEntero > 0 Then
If ObjUM.GetUnidadesMedida() Then Application("GlobalDTUnidadesMedida") = ObjUM.DtResultados If ObjUM.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) = Nothing
CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero CveUnidadMedida = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"UnidadMedida = '{UnidadMedida}'").ToString.ToEntero
End If End If
End If End If
@@ -1179,8 +1179,9 @@ Partial Class General_SaldosIniciales
If Not ErrorClientes Then If Not ErrorClientes Then
ObjClientes.Commit() ObjClientes.Commit()
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
If Contador > 0 Then If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion) Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else Else

View File

@@ -480,8 +480,9 @@
Dim ObjAcumuladores As New ClsAcumuladores() Dim ObjAcumuladores As New ClsAcumuladores()
If ObjAcumuladores.TamañoGet(-1, -1) Then Application("GlobalDTAcumTamaños") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTamaños") = Nothing If ObjAcumuladores.TamañoGet(-1, -1) Then Application("GlobalDTAcumTamaños") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTamaños") = Nothing
If ObjAcumuladores.TiposDefectoGet(-1, -1) Then Application("GlobalDTAcumTiposDefecto") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposDefecto") = Nothing If ObjAcumuladores.TiposDefectoGet(-1, -1) Then Application("GlobalDTAcumTiposDefecto") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposDefecto") = Nothing
If ObjAcumuladores.TiposUsoGet(-1, -1) Then Application("GlobalDTAcumTiposUso") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposUso") = Nothing If ObjAcumuladores.TiposUsoGet(-1, -1) Then Application("GlobalDTAcumTiposUso") = ObjAcumuladores.DtResultados Else Application("GlobalDTAcumTiposUso") = Nothing
'If ObjAcumuladores.GarantiasMesesGet(-1, -1) Then Application("GlobalDTAcumGarantiasMesesTipoUso") = ObjAcumuladores.DtResultados.FiltraParametros("", DistinctColumns:={"CveMarca", "CveTipoUso", "TipoUso"}) Else Application("GlobalDTAcumGarantiasMesesTipoUso") = Nothing
ObjAcumuladores.Dispose() ObjAcumuladores.Dispose()
'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -1431,7 +1431,7 @@ Partial Class Inventarios_Consignaciones
HFProducto.Value = DdlProducto.SelectedValue HFProducto.Value = DdlProducto.SelectedValue
End If End If
DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1) DdlUnidad.DataSource = GlobalDTProductosServiciosEquivalencias(HFProducto.Value.ToEntero, -1, UsuarioActual.CveEmpresa)
DdlUnidad.DataBind() DdlUnidad.DataBind()
UpDatos.Update() UpDatos.Update()
End Sub End Sub

View File

@@ -193,11 +193,11 @@ Partial Class Inventarios_Equivalencias
#Region " RECARGA GLOBAL " #Region " RECARGA GLOBAL "
Private Sub RecargaGlobal() Private Sub RecargaGlobal()
Dim equivalencias As New ClsProductosServicios 'Dim equivalencias As New ClsProductosServicios
If equivalencias.GetPSEquivalencias(-1, -1) Then 'If equivalencias.GetPSEquivalencias(-1, -1) Then
GlobalDTProductosServiciosEquivalencias(-1, -1) = equivalencias.DtResultados ' GlobalDTProductosServiciosEquivalencias(-1, -1) = equivalencias.DtResultados
End If 'End If
equivalencias.Dispose() 'equivalencias.Dispose()
End Sub End Sub
#End Region #End Region

View File

@@ -128,7 +128,7 @@ Partial Class Inventarios_KardexAlmacen
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), If(ChkIncluyeTransitorios.Checked, 1, 0), DdlClasificacion_SelectedIndexChanged.selectedvalue.toentero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), If(ChkIncluyeTransitorios.Checked, 1, 0), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn) Dim ListaBorrar As New List(Of DataColumn)

View File

@@ -2137,7 +2137,7 @@ Partial Class Inventarios_RecepcionAlmacen
If EntregaDirecta Then If EntregaDirecta Then
If Not ErrorMovInv Then If Not ErrorMovInv Then
Dim CveVenta As Integer = 0 Dim CveVenta As Integer = 0
Dim Dt As DataTable Dim Dt As DataTable = Nothing
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then If ObjInventario.DtResultados.Rows.Count > 0 Then

View File

@@ -863,7 +863,7 @@ Partial Class Inventarios_TrasladoSolicitud
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProductoServicio.SelectedValue.ToEntero).FiltroPrimero("") Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProductoServicio.SelectedValue.ToEntero).FiltroPrimero("")
DdlUM.Items.Clear() DdlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then If UsuarioActual.Empresa.UsaInventarios Then
DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductoServicio.SelectedValue.ToEntero, -1) DdlUM.DataSource = GlobalDTProductosServiciosEquivalencias(DdlProductoServicio.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
Else Else
DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa) DdlUM.DataSource = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa)
End If End If

View File

@@ -803,7 +803,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() Dim CveAlmacenVirtual As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V") CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 3, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
FolioVirtualSalida = ObjInventario.Folio FolioVirtualSalida = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing Dim dtvirtual As DataTable = Nothing
@@ -1617,24 +1617,31 @@ Partial Class Inventarios_TraspasoAlmacen
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero() Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S") If CveAlmacenVirtual > 0 Then
FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 2, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S2")
dtvirtual = ObjInventario.DtResultados FolioVirtualEntrada = ObjInventario.Folio
For Each RowVirtual As DataRow In dtvirtual.Rows Dim dtvirtual As DataTable = Nothing
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Double = RowVirtual("PU").ToString().ToDouble()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
ErrorMovInv = True dtvirtual = ObjInventario.DtResultados
Exit For For Each RowVirtual As DataRow In dtvirtual.Rows
End If Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
Next Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
Dim PU As Double = RowVirtual("PU").ToString().ToDouble()
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
Exit For
End If
Next
Else
TextoError = "No se pudo registrar el movimiento virtual"
ErrorMovInv = True
End If
Else Else
TextoError = "La Sucursal no tiene creado un almacen virtual"
ErrorMovInv = True ErrorMovInv = True
End If End If
End If End If
@@ -1712,7 +1719,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida) Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()' Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()' If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/>Virtual<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)

View File

@@ -1299,7 +1299,7 @@ Partial Class OC
'CARGAMOS LA SUCURSAL SI NO EXISTE SE AGREGA MATRIZ 'CARGAMOS LA SUCURSAL SI NO EXISTE SE AGREGA MATRIZ
Dim CveProveedorSucursal As Integer = IIf(objOC.CveProveedorSucursal.ToEntero = -1, 0, objOC.CveProveedorSucursal.ToEntero).ToString.ToEntero Dim CveProveedorSucursal As Integer = IIf(objOC.CveProveedorSucursal.ToEntero = -1, 0, objOC.CveProveedorSucursal.ToEntero).ToString.ToEntero
DivProveedorSucursal.Visible = True DivProveedorSucursal.Visible = True
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor) DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind() DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.Items.Insert(0, New ListItem("Matriz", "0")) DdlProveedorSucursal.Items.Insert(0, New ListItem("Matriz", "0"))
DdlProveedorSucursal.SelectedValueExist(CveProveedorSucursal) DdlProveedorSucursal.SelectedValueExist(CveProveedorSucursal)
@@ -1334,7 +1334,7 @@ Partial Class OC
If objOC.CveProveedorSucursal.ToEntero > 0 Then If objOC.CveProveedorSucursal.ToEntero > 0 Then
DivProveedorSucursal.Visible = True DivProveedorSucursal.Visible = True
DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor) DdlProveedorSucursal.DataSource = GlobalDTProveedorSucursales(objOC.CveProveedor, UsuarioActual.CveEmpresa)
DdlProveedorSucursal.DataBind() DdlProveedorSucursal.DataBind()
DdlProveedorSucursal.SelectedValueExist(objOC.CveProveedorSucursal.ToString) DdlProveedorSucursal.SelectedValueExist(objOC.CveProveedorSucursal.ToString)
End If End If
@@ -1830,7 +1830,7 @@ Partial Class OC
If Cvepsgvd > 0 Then If Cvepsgvd > 0 Then
Dim CboUM As DropDownList = Gvr.FCDropDownList("CboUnidadMedidaEdit") Dim CboUM As DropDownList = Gvr.FCDropDownList("CboUnidadMedidaEdit")
Dim TxtPU As TextBox = Gvr.FCTextBox("TxtImporteEdit") Dim TxtPU As TextBox = Gvr.FCTextBox("TxtImporteEdit")
CboUM.DataSource = GlobalDTProductosServiciosEquivalencias(Cvepsgvd, -1) CboUM.DataSource = GlobalDTProductosServiciosEquivalencias(Cvepsgvd, -1, UsuarioActual.CveEmpresa)
CboUM.DataBind() CboUM.DataBind()
End If End If
End Sub End Sub
@@ -1879,7 +1879,7 @@ Partial Class OC
CboUnidadMedida.Items.Clear() CboUnidadMedida.Items.Clear()
CboUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(DdlP2.SelectedValue.ToEntero, -1) CboUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(DdlP2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
CboUnidadMedida.DataBind() CboUnidadMedida.DataBind()
If CveEmpresaActual = 119 Then If CveEmpresaActual = 119 Then
@@ -5131,7 +5131,7 @@ Partial Class OC
DivProveedorSucursal.Visible = False DivProveedorSucursal.Visible = False
DivProveedorContacto.Visible = False DivProveedorContacto.Visible = False
Else Else
If Objeto.GetSucursales(DdlProveedores.SelectedValue.ToEntero) Then If Objeto.GetSucursales(DdlProveedores.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
If Objeto.DtResultados.Rows.Count > 0 Then If Objeto.DtResultados.Rows.Count > 0 Then
DivProveedorSucursal.Visible = True DivProveedorSucursal.Visible = True
DdlProveedorSucursal.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlProveedorSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -5597,7 +5597,7 @@ Partial Class OC
Dim Body As String = GeneraCorreoProveedor(CveOrdenCompra, CveProveedor) 'genero los datos de la OC Dim Body As String = GeneraCorreoProveedor(CveOrdenCompra, CveProveedor) 'genero los datos de la OC
Dim Correo As String = "" Dim Correo As String = ""
'si tiene seleccionada una sucursal, obtengo su correo, sino tiene especificado tomo el correo principal del proveedor 'si tiene seleccionada una sucursal, obtengo su correo, sino tiene especificado tomo el correo principal del proveedor
If DdlProveedorSucursal.SelectedValue.ToEntero > 0 Then Correo = GlobalDTProveedorSucursales(CveProveedor).FiltroPrimeroValor("Correo", $"CveProveedorSucursal={DdlProveedorSucursal.SelectedValue}") If DdlProveedorSucursal.SelectedValue.ToEntero > 0 Then Correo = GlobalDTProveedorSucursales(CveProveedor, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Correo", $"CveProveedorSucursal={DdlProveedorSucursal.SelectedValue}")
If Correo = "" Then Correo = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {CveProveedor}")(0)("ContactoMail").ToString If Correo = "" Then Correo = GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {CveProveedor}")(0)("ContactoMail").ToString
Try Try
@@ -7315,10 +7315,10 @@ Partial Class OC
RecargaPSGlobal() RecargaPSGlobal()
End Sub End Sub
Private Sub RecargaPSGlobal() Private Sub RecargaPSGlobal()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios 'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable()
'ObjPS.Dispose() 'ObjPS.Dispose()
End Sub End Sub
@@ -7329,11 +7329,12 @@ Partial Class OC
Hilo.Start() Hilo.Start()
End Sub End Sub
Private Sub GeneraGlobalEquivalencias() Private Sub GeneraGlobalEquivalencias()
Dim ObjPS = New ClsProductosServicios 'Dim dtt As DataTable = GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa)
If ObjPS.GetPSEquivalencias(-1, -1) Then 'Dim ObjPS = New ClsProductosServicios
GlobalDTProductosServiciosEquivalencias(-1, -1) = ObjPS.DtResultados 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then
End If ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
ObjPS.Dispose() 'End If
'ObjPS.Dispose()
End Sub End Sub
#End Region #End Region

View File

@@ -326,7 +326,7 @@ Partial Class Sistemas_WizardRegistro
End If End If
CargaGVClasificacion() CargaGVClasificacion()
If objunidadesMedida.GetUnidadesMedida() Then If objunidadesMedida.GetUnidadesMedida(CveEmpresa) Then
DtUM = objunidadesMedida.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa)) DtUM = objunidadesMedida.DtResultados.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
GvUM.DataSource = DtUM GvUM.DataSource = DtUM
GvUM.DataBind() GvUM.DataBind()
@@ -1259,7 +1259,7 @@ Partial Class Sistemas_WizardRegistro
Else Else
Dim ObjFolio As New ClsGralFolios Dim ObjFolio As New ClsGralFolios
If ModalidadModal = "Insertar" Then If ModalidadModal = "Insertar" Then
If ObjFolio.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.ToEntero, TxtFolioInicial.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", 100, CveEmpresa) Then If ObjFolio.AddFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, "", TxtFolioInicial.Text.ToEntero, TxtFolioInicial.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", 100, CveEmpresa) Then
Alert("El Folio se agrego correctamente.", TipoMensaje.MsgInformacion) Alert("El Folio se agrego correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If End If
@@ -1267,7 +1267,7 @@ Partial Class Sistemas_WizardRegistro
If ModalidadModal = "Actualizar" Then If ModalidadModal = "Actualizar" Then
If CveModal > 0 Then If CveModal > 0 Then
Dim CveFolio = CveModal Dim CveFolio = CveModal
If ObjFolio.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, TxtFolioInicial.Text.ToEntero, TxtFolioActual.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", If(ChkEstatus.Checked, True, False), 100, CveFolio) Then If ObjFolio.UpdateFolios(DdlSubProyecto.SelectedValue.ToEntero, DdlTipoDocto.SelectedValue, "", TxtFolioInicial.Text.ToEntero, TxtFolioActual.Text.ToEntero, TxtFolioFinal.Text.ToEntero, "", If(ChkEstatus.Checked, True, False), 100, CveFolio) Then
Alert("El Folio se actualizo correctamente.", TipoMensaje.MsgInformacion) Alert("El Folio se actualizo correctamente.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio")) RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarFolio"))
End If End If
@@ -1781,7 +1781,7 @@ Partial Class Sistemas_WizardRegistro
Private Sub CargaDdlUM() Private Sub CargaDdlUM()
DdlUM.Items.Clear() DdlUM.Items.Clear()
Dim ObjUM As New ClsUnidadesMedida Dim ObjUM As New ClsUnidadesMedida
If ObjUM.GetUnidadesMedida() Then If ObjUM.GetUnidadesMedida(CveEmpresa) Then
DdlUM.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlUM.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlUM.DataSource = ObjUM.DtResultados.FiltraParametros("CveEmpresa = " & CveEmpresa) DdlUM.DataSource = ObjUM.DtResultados.FiltraParametros("CveEmpresa = " & CveEmpresa)
DdlUM.DataBind() DdlUM.DataBind()
@@ -1852,7 +1852,7 @@ Partial Class Sistemas_WizardRegistro
Alert(String.Format("Se agregaron: <b>{0}</b> Unidades de Medida correctamente.", NumRows), TipoMensaje.MsgInformacion) Alert(String.Format("Se agregaron: <b>{0}</b> Unidades de Medida correctamente.", NumRows), TipoMensaje.MsgInformacion)
If ObjUnidadesMedida.GetUnidadesMedida() Then If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then
GvUM.DataSource = ObjUnidadesMedida.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresa}") GvUM.DataSource = ObjUnidadesMedida.DtResultados.FiltraParametros($"CveEmpresa = {CveEmpresa}")
GvUM.DataBind() GvUM.DataBind()
End If End If
@@ -1893,7 +1893,7 @@ Partial Class Sistemas_WizardRegistro
Private Sub CargaGVUM() Private Sub CargaGVUM()
Dim ObjUM As New ClsUnidadesMedida Dim ObjUM As New ClsUnidadesMedida
If ObjUM.GetUnidadesMedida() Then If ObjUM.GetUnidadesMedida(CveEmpresa) Then
GvUM.DataSource = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa)) GvUM.DataSource = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
GvUM.DataBind() GvUM.DataBind()
End If End If
@@ -2063,7 +2063,7 @@ Partial Class Sistemas_WizardRegistro
'Obtengo Unidades de medida 'Obtengo Unidades de medida
Dim ObjUM As New ClsUnidadesMedida Dim ObjUM As New ClsUnidadesMedida
Dim DTUM As New DataTable Dim DTUM As New DataTable
If ObjUM.GetUnidadesMedida() Then If ObjUM.GetUnidadesMedida(CveEmpresa) Then
DTUM = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa)) DTUM = ObjUM.DtResultados.FiltraParametros(String.Format("CveEmpresa={0}", CveEmpresa))
End If End If
ObjUM.Dispose() ObjUM.Dispose()
@@ -2780,7 +2780,8 @@ Partial Class Sistemas_WizardRegistro
If Not ErrorClientes Then If Not ErrorClientes Then
ObjClientes.Commit() ObjClientes.Commit()
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados 'If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCliente") = ObjClientes.DtResultados
If Contador > 0 Then If Contador > 0 Then
Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion) Alert(String.Format("Se agregaron: <b>{0}</b> Clientes correctamente. <br>Se Omitieron: <b>{1}</b> Clientes ya que ya se encontraban registrados.", NumRows - Contador, Contador), TipoMensaje.MsgInformacion)
Else Else
@@ -2957,7 +2958,7 @@ Partial Class Sistemas_WizardRegistro
ObjPS.Dispose() ObjPS.Dispose()
Dim ObjUM As New ClsUnidadesMedida Dim ObjUM As New ClsUnidadesMedida
If ObjUM.GetUnidadesMedida() Then If ObjUM.GetUnidadesMedida(CveEmpresa) Then
CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
End If End If
ObjUM.Dispose() ObjUM.Dispose()
@@ -3061,7 +3062,7 @@ Partial Class Sistemas_WizardRegistro
ObjPS.Dispose() ObjPS.Dispose()
Dim ObjUM As New ClsUnidadesMedida Dim ObjUM As New ClsUnidadesMedida
If ObjUM.GetUnidadesMedida() Then If ObjUM.GetUnidadesMedida(CveEmpresa) Then
CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero CveUnidadMedida = ObjUM.DtResultados.FiltraParametros($"CveEmpresa={CveEmpresa}").FiltroPrimeroValor("CveUnidadMedida").ToString.ToEntero
End If End If
ObjUM.Dispose() ObjUM.Dispose()

View File

@@ -221,6 +221,7 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaProductosServiciosSimplificado() Private Sub CargaProductosServiciosSimplificado()
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
Dim dt As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
'Dim ObjPS As New ClsProductosServicios 'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing 'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() Else Application("GlobalDTPSSimplificado") = Nothing
'ObjPS.Dispose() 'ObjPS.Dispose()
@@ -321,12 +322,13 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaSubProyectos() Private Sub CargaSubProyectos()
'Carga SubProyectos 'Carga SubProyectos
GlobalDTSubProyectos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Dim ObjSubProyectos As New ClsSubProyectos Dim ObjSubProyectos As New ClsSubProyectos
If ObjSubProyectos.GetSubProyectos Then 'If ObjSubProyectos.GetSubProyectos Then
Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados ' Application("GlobalDTSubProyectos") = ObjSubProyectos.DtResultados
Else 'Else
Application("GlobalDTSubProyectos") = Nothing ' Application("GlobalDTSubProyectos") = Nothing
End If 'End If
If ObjSubProyectos.GetSubProyectosUsuarios Then If ObjSubProyectos.GetSubProyectosUsuarios Then
Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) Application("GlobalDTProyectosUsuarios") = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados Application("GlobalDTSubProyectosUsuarios") = ObjSubProyectos.DtResultados
@@ -447,7 +449,7 @@ Partial Class Sistemas_CatSesiones
Dim ObjProveedores As New ClsCompProveedores Dim ObjProveedores As New ClsCompProveedores
If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing If ObjProveedores.GetProveedores(ClsCompProveedores.TipoConsulta.ParaGlobalDT, -1, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, -1) Then Application("GlobalDTCompProveedores") = ObjProveedores.DtResultados Else Application("GlobalDTCompProveedores") = Nothing
If ObjProveedores.GetClasificacionProveedores Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing If ObjProveedores.GetClasificacionProveedores Then Application("GlobalDTProveedorClasificacion") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorClasificacion") = Nothing
If ObjProveedores.GetSucursales(-1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing If ObjProveedores.GetSucursales(-1, -1) Then Application("GlobalDTProveedorSucursales") = ObjProveedores.DtResultados Else Application("GlobalDTProveedorSucursales") = Nothing
ObjProveedores.Dispose() ObjProveedores.Dispose()
End Sub End Sub
@@ -461,7 +463,15 @@ Partial Class Sistemas_CatSesiones
End Sub End Sub
Protected Sub BtnRefresh_Click(sender As Object, e As EventArgs) Handles BtnRefresh.Click Protected Sub BtnRefresh_Click(sender As Object, e As EventArgs) Handles BtnRefresh.Click
Gv.DataSource = DirectCast(Application(DdlVariable.SelectedValue), DataTable) Dim dt As DataTable = Nothing
Select Case DdlVariable.SelectedValue
Case ""
dt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
Case Else
dt = DirectCast(Application(DdlVariable.SelectedValue & UsuarioActual.CveEmpresa), DataTable)
End Select
Gv.DataSource = dt
Gv.DataBind() Gv.DataBind()
End Sub End Sub

View File

@@ -30,7 +30,7 @@ Partial Class CatUnidadesMedida
Dim ObjUnidadesMedida As New ClsUnidadesMedida Dim ObjUnidadesMedida As New ClsUnidadesMedida
If ObjUnidadesMedida.GetUnidadesMedida() Then If ObjUnidadesMedida.GetUnidadesMedida(UsuarioActual.CveEmpresa) Then
GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados GlobalDTUnidadesMedida = ObjUnidadesMedida.DtResultados
ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTUnidadesMedida") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GvDatos.DataSource = ViewState("DTUnidadesMedida") GvDatos.DataSource = ViewState("DTUnidadesMedida")
@@ -81,7 +81,7 @@ Partial Class CatUnidadesMedida
Dim ObjUnidadesMedida As New ClsUnidadesMedida Dim ObjUnidadesMedida As New ClsUnidadesMedida
If ObjUnidadesMedida.GetUnidadesMedidaAlias(cve) Then If ObjUnidadesMedida.GetUnidadesMedidaAlias(UsuarioActual.CveEmpresa, cve) Then
ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTUnidadesMedidaAlias") = ObjUnidadesMedida.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
Else Else
ViewState("DTUnidadesMedidaAlias") = Nothing ViewState("DTUnidadesMedidaAlias") = Nothing

View File

@@ -2597,19 +2597,21 @@ Partial Class Clientes
#Region "G L O B L A L" #Region "G L O B L A L"
Private Sub RecargaGlobal() Private Sub RecargaGlobal()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDT()
End Sub End Sub
Private Sub GeneraGlobalDT() Private Sub GeneraGlobalDT()
Dim Objclientes As New ClsClientes GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then 'Dim Objclientes As New ClsClientes
Application("GlobalDTCliente") = Objclientes.DtResultados 'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1) Then
End If ' Application("GlobalDTCliente") = Objclientes.DtResultados
Objclientes.Dispose() 'End If
End Sub 'Objclientes.Dispose()
End Sub
#End Region #End Region
#Region "G R I D V I E W S" #Region "G R I D V I E W S"
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then

View File

@@ -2866,6 +2866,10 @@ Partial Class PV
End If End If
End If End If
If ChkAjuste.Checked Then
CalculaMesesUso()
UpAjuste.Update()
End If
End If End If
@@ -4662,9 +4666,19 @@ Partial Class PV
RFVLocalidadC.Visible = False RFVLocalidadC.Visible = False
RFVEstadoC.Visible = False RFVEstadoC.Visible = False
RFVPaisC.Visible = False RFVPaisC.Visible = False
TxtNombreCliente.Focus()
DdlMetodoCliente.SelectedValueExist(1) DdlMetodoCliente.SelectedValueExist(1)
DdlFormaCliente.SelectedValueExist(1) DdlFormaCliente.SelectedValueExist(1)
'carga datos particulares de la sucursal
Dim dr As DataRow = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero).FiltroPrimero("")
If dr IsNot Nothing Then
TxtCPCliente.Text = dr("CP").ToString
TxtEstadoCliente.Text = dr("Estado").ToString
TxtCiudadCliente.Text = dr("Municipio").ToString
TxtLocalidadCliente.Text = dr("Localidad").ToString
End If
Else Else
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
If ObjCliente.ValidaClienteRFC(TxtRFCCliente.Text, UsuarioActual.CveEmpresa) Then If ObjCliente.ValidaClienteRFC(TxtRFCCliente.Text, UsuarioActual.CveEmpresa) Then
@@ -4914,15 +4928,17 @@ Partial Class PV
End Sub End Sub
Private Sub RecargaGlobalCliente() Private Sub RecargaGlobalCliente()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDTCliente()
End Sub End Sub
Private Sub GeneraGlobalDTCliente() Private Sub GeneraGlobalDTCliente()
Dim Objclientes As New ClsClientes GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then 'Dim Objclientes As New ClsClientes
Application("GlobalDTCliente") = Objclientes.DtResultados 'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then
End If ' Application("GlobalDTCliente") = Objclientes.DtResultados
Objclientes.Dispose() 'End If
'Objclientes.Dispose()
End Sub End Sub
#End Region #End Region
@@ -5198,13 +5214,19 @@ Partial Class PV
Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero
Dim PrecioSugerido As Decimal = 0 Dim PrecioSugerido As Decimal = 0
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
Dim CveMarca As Integer
If drPS IsNot Nothing Then If drPS IsNot Nothing Then
PrecioSugerido = drPS("Precio").ToString.ToDecimal PrecioSugerido = drPS("Precio").ToString.ToDecimal
CveMarca = drPS("CveMarca").ToString.ToEntero
End If End If
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2) TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumGarantiasMesesTipoUso(UsuarioActual.CveEmpresa, CveMarca)
DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlTipoUso.DataBind()
End If End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then

View File

@@ -1326,11 +1326,12 @@ Partial Class ProductosyServicios
#Region "G L O B L A L" #Region "G L O B L A L"
Private Sub RecargaGlobal() Private Sub RecargaGlobal()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDT()
End Sub End Sub
Private Sub GeneraGlobalDT() Private Sub GeneraGlobalDT()
GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = Nothing GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = Nothing
GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = Nothing GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = Nothing
@@ -1339,23 +1340,23 @@ Partial Class ProductosyServicios
'Dim ObjPS As New ClsProductosServicios 'Dim ObjPS As New ClsProductosServicios
'If ObjPS.GetPSSimplificado(-1) Then Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable() 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable()
'If ObjPS.GetPSAlias(-1, -1) Then ''If ObjPS.GetPSAlias(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTProductosServiciosAlias(-1) = ObjPS.DtResultados ' GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If 'End If
'If ObjPS.GetPSImpuestosLocales(-1, -1) Then 'If ObjPS.GetPSImpuestosLocales(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTImpuestosLocales(-1, -1) = ObjPS.DtResultados ' GlobalDTImpuestosLocales(-1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If 'End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If 'End If
''If ObjPS.GetPSAdicionales(-1, -1) Then 'If ObjPS.GetPSAdicionales(-1, UsuarioActual.CveEmpresa) Then
'' GlobalDTPSAdicionales(-1, -1) = ObjPS.DtResultados ' GlobalDTPSAdicionales(-1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
''End If 'End If
'ObjPS.Dispose() 'ObjPS.Dispose()
End Sub End Sub
@@ -1401,8 +1402,9 @@ Partial Class ProductosyServicios
End Sub End Sub
Private Sub RecargaGlobalEquivalencias() Private Sub RecargaGlobalEquivalencias()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias)
Hilo.Start() 'Hilo.Start()
GeneraGlobalEquivalencias()
End Sub End Sub
Private Sub GeneraGlobalEquivalencias() Private Sub GeneraGlobalEquivalencias()
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing

View File

@@ -5834,18 +5834,7 @@
<asp:RangeValidator ID="RVTxtNCImporte" runat="server" Type="currency" MinimumValue="0.01" MaximumValue="100" ErrorMessage="El campo <b>''Importe''</b> debe estar entre 1 y el importe máximo de la factura(Saldo)." ControlToValidate="TxtNCImporte" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator> <asp:RangeValidator ID="RVTxtNCImporte" runat="server" Type="currency" MinimumValue="0.01" MaximumValue="100" ErrorMessage="El campo <b>''Importe''</b> debe estar entre 1 y el importe máximo de la factura(Saldo)." ControlToValidate="TxtNCImporte" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCETxtNCImporte" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtNCImporte" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCETxtNCImporte" runat="server" HighlightCssClass="vco" TargetControlID="RVTxtNCImporte" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-4">
</div>
<div class="col-md-2">
ó
</div>
<div class="col-md-4">
</div>
</div>
<div class="row form-group"> <div class="row form-group">
<div class="col-md-2"> <div class="col-md-2">
<asp:Literal ID="LtlTitleImportesRem" runat="server" Visible="false" Text="Importe Remisiones:"></asp:Literal> <asp:Literal ID="LtlTitleImportesRem" runat="server" Visible="false" Text="Importe Remisiones:"></asp:Literal>

View File

@@ -9847,7 +9847,7 @@ Partial Class Ventas
End If End If
End If End If
If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 5) Then If ObjConta.ValidacionPrePolizaCuadre(ObjFactura.CvePrePoliza, 2) Then
If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
'ErrorPrepoliza = True 'ErrorPrepoliza = True
GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Ventas/Ventas-ProcesoPrePolizas | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{ObjFactura.CvePrePoliza}", "LogPrePolizas")
@@ -15269,14 +15269,19 @@ Partial Class Ventas
DtMovimientos = ObjInventario.DtResultados.FiltraParametros("", DistinctColumns:={"CveMovimiento"}) DtMovimientos = ObjInventario.DtResultados.FiltraParametros("", DistinctColumns:={"CveMovimiento"})
'Si estamos facturando remisiones ajustamos por ventadetalle 'Si estamos facturando remisiones ajustamos por ventadetalle
If RemisionesLista.Count > 0 Then If RemisionesLista.Count > 0 AndAlso DtRemisionesTmpDT IsNot Nothing AndAlso DtRemisionesTmpDT.Rows.Count > 0 AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim resultados = From DtRemisiones In DtRemisionesTmpDT Dim resultados = From DtRemisiones In DtRemisionesTmpDT
Join DtMovDet In ObjInventario.DtResultados.FiltraParametros("CvePS > 0") On DtRemisiones("CveVentaDetalleRemision").ToString.ToEntero Equals DtMovDet("CveVentaDetalle").ToString.ToEntero Join DtMovDet In ObjInventario.DtResultados.FiltraParametros("CvePS > 0") On DtRemisiones("CveVentaDetalleRemision").ToString.ToEntero Equals DtMovDet("CveVentaDetalle").ToString.ToEntero
Select DtMovDet Select DtMovDet
Try Try
DtMovimientosDetalles = resultados.CopyToDataTable If resultados.Count > 0 Then
DtMovimientosDetalles = resultados.CopyToDataTable
Else
DtMovimientosDetalles = New DataTable
End If
Catch ex As Exception Catch ex As Exception
GuardaLog($"LOG IPP: Ventas LN: 10033. - DtRemisionesTmpDT.Rows.Count: {DtRemisionesTmpDT.Rows.Count} - ObjInventario.DtResultados.FiltraParametros('CvePS > 0').Rows.Count: {ObjInventario.DtResultados.FiltraParametros("CvePS > 0").Rows.Count}") GuardaLog($"LOG IPP: Ventas LN: 10033. - DtRemisionesTmpDT.Rows.Count: {DtRemisionesTmpDT.Rows.Count} - ObjInventario.DtResultados.FiltraParametros('CvePS > 0').Rows.Count: {ObjInventario.DtResultados.FiltraParametros("CvePS > 0").Rows.Count} Ex:{ex.Message}")
DtMovimientosDetalles = New DataTable DtMovimientosDetalles = New DataTable
End Try End Try
Else Else
@@ -17253,15 +17258,17 @@ Partial Class Ventas
End Sub End Sub
Private Sub RecargaGlobalCliente() Private Sub RecargaGlobalCliente()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDTCliente)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDTCliente()
End Sub End Sub
Private Sub GeneraGlobalDTCliente() Private Sub GeneraGlobalDTCliente()
Dim Objclientes As New ClsClientes GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing
If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=-1, TipoCliente:=-1) Then 'Dim Objclientes As New ClsClientes
Application("GlobalDTCliente") = Objclientes.DtResultados 'If Objclientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus:=-1, TipoCliente:=-1) Then
End If ' Application("GlobalDTCliente" & UsuarioActual.CveEmpresa) = Objclientes.DtResultados
Objclientes.Dispose() 'End If
'Objclientes.Dispose()
End Sub End Sub
#End Region #End Region
@@ -19164,19 +19171,19 @@ Partial Class Ventas
RecargaGlobal() RecargaGlobal()
End Sub End Sub
Private Sub RecargaGlobal() Private Sub RecargaGlobal()
Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT) 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
Hilo.Start() 'Hilo.Start()
GeneraGlobalDT()
End Sub End Sub
Private Sub GeneraGlobalDT() Private Sub GeneraGlobalDT()
'Dim dtt As DataTable
GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing
GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjPS As New ClsProductosServicios 'Dim ObjPS As New ClsProductosServicios
'If (ObjPS.GetPSSimplificado(-1)) Then 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable()
' Application("GlobalDTPSSimplificado") = ObjPS.DtResultados.AsEnumerable 'Cargamos el GlobalDTPSSimplificado
'End If
'If ObjPS.GetPSEquivalencias(-1, -1) Then 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then
' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados ' GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = ObjPS.DtResultados
'End If 'End If
@@ -20922,6 +20929,7 @@ Partial Class Ventas
DtImpuestos.Columns.Add("ImporteIEPS", GetType(Decimal)) DtImpuestos.Columns.Add("ImporteIEPS", GetType(Decimal))
DtImpuestos.Columns.Add("CveSubProyecto", GetType(Integer)) DtImpuestos.Columns.Add("CveSubProyecto", GetType(Integer))
DtImpuestos.AcceptChanges() DtImpuestos.AcceptChanges()
Dim AcumuladoNC As Decimal = 0
If AplicaNCMasiva Then If AplicaNCMasiva Then
If NCDescuento Then If NCDescuento Then
@@ -20929,10 +20937,12 @@ Partial Class Ventas
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True), True, MissingSchemaAction.Ignore) DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True), True, MissingSchemaAction.Ignore)
Next Next
Else Else
For Each Gvr As GridViewRow In GvCxC.Rows For Each Gvr As GridViewRow In GvCxC.Rows
If Gvr.FCCheckBox("ChkCxC").Checked Then If Gvr.FCCheckBox("ChkCxC").Checked Then
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal), True, MissingSchemaAction.Ignore) DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal), True, MissingSchemaAction.Ignore)
'CARGA FACTURA A LA CUAL SE APLICA LA NC 'CARGA FACTURA A LA CUAL SE APLICA LA NC
AcumuladoNC += Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal
CargaNCDT(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal) CargaNCDT(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal)
End If End If
Next Next
@@ -20949,10 +20959,10 @@ Partial Class Ventas
Into x = Group Into x = Group
Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal), Select ImportePU = x.Sum(Function(s) s("ImportePU").ToString.ToDecimal),
ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal), ImporteTotal = x.Sum(Function(s) s("ImporteTotal").ToString.ToDecimal),
ImporteIVA = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA, ImporteIVA = x.Sum(Function(s) Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)), ' Math.Round(s("ImporteIVA").ToString.ToDecimal, 2)) * (1 + PorcentajeIEPS) * PorcentajeIVA,
ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA, ImporteRetIVA = x.Sum(Function(s) Math.Round(s("ImporteRetIVA").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetIVA,
ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR, ImporteRetISR = x.Sum(Function(s) Math.Round(s("ImporteRetISR").ToString.ToDecimal, 2)),' Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeRetISR,
ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS, ImporteIEPS = x.Sum(Function(s) Math.Round(s("ImporteIEPS").ToString.ToDecimal, 2)), 'Math.Round(s("ImportePU").ToString.ToDecimal, 2)) * PorcentajeIEPS,
PorcentajeIVA = PorcentajeIVA, PorcentajeIVA = PorcentajeIVA,
PorcentajeRetIVA = PorcentajeRetIVA, PorcentajeRetIVA = PorcentajeRetIVA,
PorcentajeRetISR = PorcentajeRetISR, PorcentajeRetISR = PorcentajeRetISR,
@@ -21001,11 +21011,23 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue = "Ant" Then CveAnticipo = CveVenta If DdlTipoComprobante.SelectedValue = "Ant" Then CveAnticipo = CveVenta
DdlTipoComprobante.SelectedValueExist("Egs") DdlTipoComprobante.SelectedValueExist("Egs")
'verifica el total de multiples facturas
Dim Acumulado12 As Decimal = 0
Dim UltimoRenglon As Integer = 1
Dim Ajuste As Decimal = 0
For Each Dr As DataRow In DtImpuestos.Rows For Each Dr As DataRow In DtImpuestos.Rows
Acumulado12 += Dr("ImportePU").ToString.ToDecimal.RoundSQL + Dr("ImporteIVA").ToString.ToDecimal.RoundSQL + Dr("ImporteIEPS").ToString.ToDecimal
If UltimoRenglon = DtImpuestos.Rows.Count Then
'ajusta 5 centavos de diferencia
If Acumulado12 <> AcumuladoNC And Math.Abs(Acumulado12 - AcumuladoNC) <= 0.05 Then
Ajuste = Acumulado12 - AcumuladoNC
End If
End If
UltimoRenglon += 1
AgregaTempDT(TmpDT, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero, AgregaTempDT(TmpDT, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal, TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal + Ajuste, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1,
DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1)
Next Next
@@ -21017,6 +21039,7 @@ Partial Class Ventas
TrTipoRelacion.Visible = True TrTipoRelacion.Visible = True
DdlTiposRelacion.SelectedValueExist("1") DdlTiposRelacion.SelectedValueExist("1")
DdlSubProyectoDatos.Enabled = False
'condicióon, en la que se verifica que el importe total de aplicación de la nota de crédito sea igual al del total de la nota de crédito, ej. saldo de la factura 1000.01 y la nota de crédito se generó po 1000.00 'condicióon, en la que se verifica que el importe total de aplicación de la nota de crédito sea igual al del total de la nota de crédito, ej. saldo de la factura 1000.01 y la nota de crédito se generó po 1000.00
If Not AplicaNCMasiva Then If Not AplicaNCMasiva Then
@@ -21077,22 +21100,24 @@ Partial Class Ventas
FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto")) FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("CveSubProyecto"))
Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)), 2) Dr("ImporteTotal") = Math.Round(Porcentaje * (TmpDT.SUM("TotalImporte", FiltroStr) - TmpDT.SUM("Descuento", FiltroStr)), 2)
Dr("ImporteIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * (1 + Dr("PorcentajeIEPS").ToString().ToDecimal()) * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2) 'Dr("ImporteIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2) 'Dr("ImporteRetIVA") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetIVA").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteRetISR") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2) 'Dr("ImporteRetISR") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeRetISR").ToString().ToDecimal()).RoundSQL(2)
Dr("ImporteIEPS") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2) 'Dr("ImporteIEPS") = (Dr("ImporteTotal").ToString().ToDecimal() * Dr("PorcentajeIEPS").ToString().ToDecimal()).RoundSQL(2)
'Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2) Dr("ImporteIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIVA", FiltroStr), 2)
'Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}' "), 2) Dr("ImporteRetIVA") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetIVA", FiltroStr), 2)
'Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2) Dr("ImporteRetISR") = Math.Round(Porcentaje * TmpDT.SUM("ImporteRetISR", FiltroStr), 2)
'Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", $"ISNULL(PorcentajeIVA,0) = {Dr("PorcentajeIVA").ToString.ToDecimal} AND ISNULL(PorcentajeRetIVA,0) = '{Dr("PorcentajeRetIVA").ToString.ToDecimal}' AND ISNULL(PorcentajeRetISR,0) = '{Dr("PorcentajeRetISR").ToString.ToDecimal}' AND ISNULL(PorcentajeIEPS,0) = '{Dr("PorcentajeIEPS").ToString.ToDecimal}' AND ISNULL(CveSubProyecto,0) = '{Dr("CveSubProyecto").ToString.ToEntero}'"), 2) Dr("ImporteIEPS") = Math.Round(Porcentaje * TmpDT.SUM("ImporteIEPS", FiltroStr), 2)
Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal) Dr("ImportePU") = Dr("ImporteTotal").ToString.ToDecimal '(Dr("ImporteTotal").ToString.ToDecimal - Dr("ImporteIVA").ToString.ToDecimal - Dr("ImporteRetIVA").ToString.ToDecimal - Dr("ImporteRetISR").ToString.ToDecimal - Dr("ImporteIEPS").ToString.ToDecimal)
Next Next
'codigo para ajuste de centavo, si el importe total no cuadra con los totales 'codigo para ajuste de centavo, si el importe total no cuadra con los totales
Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR")) Dim difTmp As Decimal = Importe - (DtImpuestosLocal.SUMD("ImporteTotal") + DtImpuestosLocal.SUMD("ImporteIVA") + DtImpuestosLocal.SUMD("ImporteIEPS") - DtImpuestosLocal.SUMD("ImporteRetIVA") - DtImpuestosLocal.SUMD("ImporteRetISR"))
If Math.Abs(difTmp) >= 0.01 Then If Math.Abs(difTmp) >= 0.01 Then
'asusto la diferencia en el último concepto 'asusto la diferencia en el último concepto
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp Dim ImporteAjustado As Decimal = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = ImporteAjustado
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImportePU") = ImporteAjustado
End If End If
If Not NCDescuento Then If Not NCDescuento Then

View File

@@ -67,52 +67,52 @@ Public Class WSApp
Application("GlobalDTVtaFormaPago") = value Application("GlobalDTVtaFormaPago") = value
End Set End Set
End Property End Property
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable 'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get ' Get
If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then ' If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos ' Dim P As New ClsSubProyectos
If P.GetSubProyectos Then ' If P.GetSubProyectos Then
Application("GlobalDTSubProyectos") = P.DtResultados ' Application("GlobalDTSubProyectos") = P.DtResultados
End If ' End If
P.Dispose() ' P.Dispose()
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
'If Request IsNot Nothing Then ' 'If Request IsNot Nothing Then
' msg = msg & Request.ServerVariables("URL") ' ' msg = msg & Request.ServerVariables("URL")
'End If ' 'End If
msg.GuardaLog() ' msg.GuardaLog()
End If ' End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then ' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder ' Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) ' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) ' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) ' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable ' GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable) ' GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable)
End If ' End If
End Get ' End Get
Set(ByVal value As DataTable) ' Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then ' If value Is Nothing OrElse value.Rows.Count = 0 Then
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
'If Request IsNot Nothing Then ' 'If Request IsNot Nothing Then
' msg = msg & Request.ServerVariables("URL") ' ' msg = msg & Request.ServerVariables("URL")
'End If ' 'End If
msg.GuardaLog() ' msg.GuardaLog()
End If ' End If
Application("GlobalDTSubProyectos") = value ' Application("GlobalDTSubProyectos") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get Get
If EsPersonaFisica <> -1 Then If EsPersonaFisica <> -1 Then
@@ -151,20 +151,20 @@ Public Class WSApp
Application("GlobalDTUsuarios") = value Application("GlobalDTUsuarios") = value
End Set End Set
End Property End Property
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable ' GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable) ' GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
Application("GlobalDTUnidadesMedida") = value ' Application("GlobalDTUnidadesMedida") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
Get Get
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then

View File

@@ -67,52 +67,52 @@ Public Class WSSIGApp
Application("GlobalDTVtaFormaPago") = value Application("GlobalDTVtaFormaPago") = value
End Set End Set
End Property End Property
Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable 'Property GlobalDTSubProyectos(CveProyecto As Integer, Optional CveSubProyecto As Integer = -1, Optional CveEmpresa As Integer = -1, Optional Estatus As Integer = 1) As DataTable
Get ' Get
If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then ' If DirectCast(Application("GlobalDTSubProyectos"), DataTable) Is Nothing Or (DirectCast(Application("GlobalDTSubProyectos"), DataTable) IsNot Nothing AndAlso DirectCast(Application("GlobalDTSubProyectos"), DataTable).Rows.Count = 0) Then
Dim P As New ClsSubProyectos ' Dim P As New ClsSubProyectos
If P.GetSubProyectos Then ' If P.GetSubProyectos Then
Application("GlobalDTSubProyectos") = P.DtResultados ' Application("GlobalDTSubProyectos") = P.DtResultados
End If ' End If
P.Dispose() ' P.Dispose()
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
'If Request IsNot Nothing Then ' 'If Request IsNot Nothing Then
' msg = msg & Request.ServerVariables("URL") ' ' msg = msg & Request.ServerVariables("URL")
'End If ' 'End If
msg.GuardaLog() ' msg.GuardaLog()
End If ' End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then ' If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
Dim StrSQL As New StringBuilder ' Dim StrSQL As New StringBuilder
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) ' If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto)
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) ' If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto)
If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus) ' If Estatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", Estatus)
If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa) ' If CveEmpresa <> -1 Then StrSQL.AppendFormat(" AND CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubProyectos"), DataTable), StrSQL.ToString.Trim.TrimStart("A"c, "N"c, "D"c), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectos = Dv.ToTable ' GlobalDTSubProyectos = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable) ' GlobalDTSubProyectos = DirectCast(Application("GlobalDTSubProyectos"), DataTable)
End If ' End If
End Get ' End Get
Set(ByVal value As DataTable) ' Set(ByVal value As DataTable)
If value Is Nothing OrElse value.Rows.Count = 0 Then ' If value Is Nothing OrElse value.Rows.Count = 0 Then
Dim msg As String = "aqui no se carga subproyectos" ' Dim msg As String = "aqui no se carga subproyectos"
'If Request IsNot Nothing Then ' 'If Request IsNot Nothing Then
' msg = msg & Request.ServerVariables("URL") ' ' msg = msg & Request.ServerVariables("URL")
'End If ' 'End If
msg.GuardaLog() ' msg.GuardaLog()
End If ' End If
Application("GlobalDTSubProyectos") = value ' Application("GlobalDTSubProyectos") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
Get Get
If EsPersonaFisica <> -1 Then If EsPersonaFisica <> -1 Then
@@ -151,20 +151,20 @@ Public Class WSSIGApp
Application("GlobalDTUsuarios") = value Application("GlobalDTUsuarios") = value
End Set End Set
End Property End Property
Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable 'Property GlobalDTUnidadesMedida(Optional CveEmpresa As Integer = -1) As DataTable
Get ' Get
If CveEmpresa <> -1 Then ' If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(Application("GlobalDTUnidadesMedida"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable ' GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose() ' Dv.Dispose()
Else ' Else
GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable) ' GlobalDTUnidadesMedida = DirectCast(Application("GlobalDTUnidadesMedida"), DataTable)
End If ' End If
End Get ' End Get
Set(value As DataTable) ' Set(value As DataTable)
Application("GlobalDTUnidadesMedida") = value ' Application("GlobalDTUnidadesMedida") = value
End Set ' End Set
End Property 'End Property
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
Get Get
If CveEmpresa <> -1 Then If CveEmpresa <> -1 Then