This commit is contained in:
2023-02-18 18:09:27 -07:00
19 changed files with 168 additions and 207 deletions

View File

@@ -182,13 +182,12 @@ Public Class ClsPaginas
If ObjUsuarios.GetUsuariosEmpresas(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsuarios.DtResultados If ObjUsuarios.GetUsuariosEmpresas(-1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUsuarios.DtResultados
End Using End Using
End If End If
Dim Str As New StringBuilder Dim filtros As New List(Of String)
If CveUsuario <> -1 Then Str.AppendFormat("CveUsuario = {0}", CveUsuario) If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
'If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa) If CveCliente <> -1 Then filtros.Add($"CveCliente = {CveCliente}")
If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) If CveProveedor <> -1 Then filtros.Add($"CveProveedor = {CveProveedor}")
If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor) If filtros.Count > 0 Then
If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTUsuarios = Dv.ToTable GlobalDTUsuarios = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -220,14 +219,11 @@ Public Class ClsPaginas
Dim AppNombre As String = $"GlobalDTTiposGastos-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTTiposGastos-{CveEmpresa}"
If Application(AppNombre) Is Nothing Then If Application(AppNombre) Is Nothing Then
Dim ObjCompra As New ClsCompras() Dim ObjCompra As New ClsCompras()
If ObjCompra.GetTipoGasto(-1, -1) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing If ObjCompra.GetTipoGasto(-1, CveEmpresa) Then Application(AppNombre) = ObjCompra.DtResultados Else Application(AppNombre) = Nothing
ObjCompra.Dispose() ObjCompra.Dispose()
End If End If
If CveEmpresa <> -1 Then If Estatus <> -1 Then
Dim StrSQL As New StringBuilder Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveEstatus = {Estatus}", "", DataViewRowState.CurrentRows)
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTTiposGastos = Dv.ToTable GlobalDTTiposGastos = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -561,10 +557,9 @@ Public Class ClsPaginas
End Using End Using
End If End If
'Dim Str As New StringBuilder 'Dim Str As New StringBuilder
''If CveEmpresa <> -1 Then Str.AppendFormat(" {0} CveEmpresa = {1}", If(Str.Length > 0, "AND", ""), CveEmpresa)
'If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente) 'If CveCliente <> -1 Then Str.AppendFormat(" {0} CveCliente = {1}", If(Str.Length > 0, "AND", ""), CveCliente)
'If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor) 'If CveProveedor <> -1 Then Str.AppendFormat(" {0} CveProveedor = {1}", If(Str.Length > 0, "AND", ""), CveProveedor)
'If CveUsuario <> -1 OrElse CveEmpresa <> -1 Then 'If CveUsuario <> -1 OrElse CveCliente <> -1 OrElse CveProveedor <> -1
' Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) ' Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTUsuarios = Dv.ToTable ' GlobalDTUsuarios = Dv.ToTable
' Dv.Dispose() ' Dv.Dispose()
@@ -617,13 +612,7 @@ Public Class ClsPaginas
If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados If P.GetProveedorClasificacion(CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose() P.Dispose()
End If End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa ={0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTProveedorClasificacion = Dv.ToTable
Dv.Dispose()
Else
GlobalDTProveedorClasificacion = DirectCast(Application(AppNombre), DataTable) GlobalDTProveedorClasificacion = DirectCast(Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTProveedorClasificacion-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTProveedorClasificacion-{CveEmpresa}"
@@ -738,6 +727,7 @@ Public Class ClsPaginas
Application("GlobalDTNomSatTipoIncapacidad") = value Application("GlobalDTNomSatTipoIncapacidad") = value
End Set End Set
End Property End Property
'Este GlobalDT no estoy seguro si se deba segmentar por empresa, se usa mucho en todos lados
Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable Public Shared Property GlobalDTEmpresas(Optional CveEmpresa As Integer = -1) As DataTable
Get Get
Dim AppNombre As String = "GlobalDTEmpresas" Dim AppNombre As String = "GlobalDTEmpresas"
@@ -756,7 +746,7 @@ Public Class ClsPaginas
End Using End Using
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), "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), $"CveEmpresa = {CveEmpresa}", "", DataViewRowState.CurrentRows)
GlobalDTEmpresas = Dv.ToTable GlobalDTEmpresas = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -825,13 +815,12 @@ Public Class ClsPaginas
If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
End If End If
If CveEmpresa <> -1 Then Dim filtros As New List(Of String)
Dim Str As New StringBuilder If CveCategoria <> -1 Then filtros.Add($"CveCategoria = {CveCategoria}")
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) If UsoClasificacion <> -1 Then filtros.Add($"UsoClasificacion = {UsoClasificacion}")
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) If CveClasificacion <> -1 Then filtros.Add($"CveClasificacion = {CveClasificacion}")
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) If filtros.Count > 0 Then
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -852,16 +841,7 @@ Public Class ClsPaginas
If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados If ObjRH.GetActividades(CveEmpresa) Then Application(AppNombre) = ObjRH.DtResultados
ObjRH.Dispose() ObjRH.Dispose()
End If End If
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTRHActividades = Dv.ToTable
Dv.Dispose()
Else
GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable) GlobalDTRHActividades = DirectCast(Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTRHActividades-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTRHActividades-{CveEmpresa}"
@@ -877,11 +857,8 @@ Public Class ClsPaginas
If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados If ObjClasificaciones.GetClasificaciones(CveEmpresa, Tipo:=4) Then Application(AppNombre) = ObjClasificaciones.DtResultados
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
End If End If
If CveEmpresa <> -1 Then If CveCategoria <> -1 Then
Dim Str As New StringBuilder Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveCategoria = {CveCategoria}", "", DataViewRowState.CurrentRows)
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones2 = Dv.ToTable GlobalDTClasificaciones2 = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1120,13 +1097,7 @@ Public Class ClsPaginas
If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados If ObjUnidadesMedida.GetUnidadesMedida(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose() ObjUnidadesMedida.Dispose()
End If End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), " UnidadMedida", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedida = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable) GlobalDTUnidadesMedida = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTUnidadesMedida-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTUnidadesMedida-{CveEmpresa}"
@@ -1142,20 +1113,11 @@ Public Class ClsPaginas
If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados If ObjUnidadesMedida.GetUnidadesMedidaAlias(CveEmpresa, -1) Then Application(AppNombre) = ObjUnidadesMedida.DtResultados
ObjUnidadesMedida.Dispose() ObjUnidadesMedida.Dispose()
End If End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTUnidadesMedidaAlias = Dv.ToTable
Dv.Dispose()
Else
GlobalDTUnidadesMedidaAlias = DirectCast(Application(AppNombre), DataTable) GlobalDTUnidadesMedidaAlias = DirectCast(Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTUnidadesMedidaAlias-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTUnidadesMedidaAlias-{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
Public Shared Property GlobalDTSATMotivosCancelacion(Optional CveSATMotivoCancelacion As Integer = -1, Optional CodigoSAT As String = "-1") As DataTable Public Shared Property GlobalDTSATMotivosCancelacion(Optional CveSATMotivoCancelacion As Integer = -1, Optional CodigoSAT As String = "-1") As DataTable
@@ -1330,13 +1292,13 @@ Public Class ClsPaginas
If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados
ObjSubProyectos.Dispose() ObjSubProyectos.Dispose()
End If End If
If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEstatus <> -1 Then Dim filtros As New List(Of String)
Dim StrSQL As New StringBuilder If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) If CveSubProyecto <> -1 Then filtros.Add($"CveSubProyecto = {CveSubProyecto}")
If CveSubProyecto <> -1 Then StrSQL.AppendFormat(" AND CveSubProyecto = {0}", CveSubProyecto) If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario) If CveEstatus <> -1 Then filtros.Add($"CveEstatus = {CveEstatus}")
If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatus = {0}", CveEstatus) If filtros.Count > 0 Then
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(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTSubProyectosUsuarios = Dv.ToTable GlobalDTSubProyectosUsuarios = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1356,12 +1318,12 @@ Public Class ClsPaginas
If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"}) If ObjSubProyectos.GetSubProyectosUsuarios(CveEmpresa:=CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjSubProyectos.DtResultados.FiltraParametros("", "", {"Proyecto", "CveProyecto", "CveUsuario", "CveEmpresa", "CveEstatusProyecto"})
ObjSubProyectos.Dispose() ObjSubProyectos.Dispose()
End If End If
If CveUsuario <> -1 OrElse CveProyecto <> -1 OrElse CveEstatus <> -1 Then Dim filtros As New List(Of String)
Dim StrSQL As New StringBuilder If CveProyecto <> -1 Then filtros.Add($"CveProyecto = {CveProyecto}")
If CveProyecto <> -1 Then StrSQL.AppendFormat(" AND CveProyecto = {0}", CveProyecto) If CveUsuario <> -1 Then filtros.Add($"CveUsuario = {CveUsuario}")
If CveUsuario <> -1 Then StrSQL.AppendFormat(" AND CveUsuario = {0}", CveUsuario) If CveEstatus <> -1 Then filtros.Add($"CveEstatus = {CveEstatus}")
If CveEstatus <> -1 Then StrSQL.AppendFormat(" AND CveEstatusProyecto = {0}", CveEstatus) If filtros.Count > 0 Then
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(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
GlobalDTProyectosUsuarios = Dv.ToTable GlobalDTProyectosUsuarios = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1588,11 +1550,8 @@ Public Class ClsPaginas
ObjPS.Dispose() ObjPS.Dispose()
End If End If
If CveEmpresa <> -1 Then If Estatus >= 0 Then
Dim StrSQL As New StringBuilder Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CveEstado = {Estatus}", "", DataViewRowState.CurrentRows)
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstado = {0} ", Estatus)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTProductosServiciosAlias = Dv.ToTable GlobalDTProductosServiciosAlias = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1646,19 +1605,14 @@ Public Class ClsPaginas
Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable Property GlobalDTPSAdicionales(CvePS As Integer, CveEmpresa As Integer) As DataTable
Get Get
Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTPSAdicionales-{CveEmpresa}"
If CveEmpresa <> -1 Then
'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 If ObjPS.GetPSAdicionales(-1, CveEmpresa) Then Application(AppNombre) = ObjPS.DtResultados
ObjPS.Dispose() ObjPS.Dispose()
End If End If
End If
Dim Str As New StringBuilder
If CvePS > 0 Then Str.AppendFormat("CvePS = {0}", CvePS)
If CveEmpresa > 0 Then Str.AppendFormat("{0} CveEmpresa = {1}", If(CvePS > 0, " AND ", ""), CveEmpresa)
If CvePS > 0 Then If CvePS > 0 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), $"CvePS = {CvePS}", "", DataViewRowState.CurrentRows)
GlobalDTPSAdicionales = Dv.ToTable GlobalDTPSAdicionales = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -1926,18 +1880,19 @@ Public Class ClsPaginas
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
If HttpContext.Current.Application(AppNombre) Is Nothing Then If HttpContext.Current.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, CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy() If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa:=CveEmpresa, Estatus:=-1) Then HttpContext.Current.Application(AppNombre) = ObjClientes.DtResultados.Copy()
ObjClientes.Dispose() ObjClientes.Dispose()
End If End If
Dim filtros As New List(Of String)
Dim StrSQL As New StringBuilder If Estatus >= 0 Then filtros.Add($"EstatusBool = {Estatus}")
StrSQL.AppendFormat("1 = 1") If CveCliente >= 0 Then filtros.Add($"CveCliente = {CveCliente}")
If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) If filtros.Count > 0 Then
If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTCliente = Dv.ToTable GlobalDTCliente = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else
GlobalDTCliente = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTCliente-{CveEmpresa}"
@@ -1953,13 +1908,7 @@ Public Class ClsPaginas
If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados If ObjClientes.GetClienteClasificacion(CveEmpresa) Then Application(AppNombre) = ObjClientes.DtResultados
ObjClientes.Dispose() ObjClientes.Dispose()
End If End If
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTClienteClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClienteClasificaciones = DirectCast(Application(AppNombre), DataTable) GlobalDTClienteClasificaciones = DirectCast(Application(AppNombre), DataTable)
End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTClienteClasificaciones-{CveEmpresa}" Dim AppNombre As String = $"GlobalDTClienteClasificaciones-{CveEmpresa}"
@@ -1992,12 +1941,11 @@ Public Class ClsPaginas
If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados If ObjVendedores.GetVendedores(CveEmpresa) Then Application(AppNombre) = ObjVendedores.DtResultados
ObjVendedores.Dispose() ObjVendedores.Dispose()
End If End If
If CveEmpresa <> -1 Then Dim filtros As New List(Of String)
Dim StrSQL As New StringBuilder If VendedorTipo >= 0 Then filtros.Add($"VendedorTipo = {VendedorTipo}")
StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) If Estatus >= 0 Then filtros.Add($"CveEstatus = {Estatus}")
If VendedorTipo >= 0 Then StrSQL.AppendFormat(" AND VendedorTipo = {0} ", VendedorTipo) If filtros.Count > 0 Then
If Estatus >= 0 Then StrSQL.AppendFormat(" AND CveEstatus = {0} ", If(Estatus = 1, True, False)) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows)
GlobalDTVendedores = Dv.ToTable GlobalDTVendedores = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
@@ -3261,23 +3209,18 @@ 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 ObjOC As New ClsOC Dim ObjOC As New ClsOC
If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa) Then If ObjOC.GetEstatusUsuarios(-1, -1, -1, -1, CveEmpresa:=CveEmpresa) Then
Application(AppNombre) = ObjOC.DtResultados Application(AppNombre) = ObjOC.DtResultados
Else Else
Application(AppNombre) = Nothing Application(AppNombre) = Nothing
End If End If
ObjOC.Dispose() ObjOC.Dispose()
End If End If
If CveEmpresa <> -1 Then Dim filtros As New List(Of String)
Dim filtro As New StringBuilder If CveUsuario > 0 Then filtros.Add($"CveUsuario = {CveUsuario}")
filtro.AppendFormat("CveEmpresa = {0} ", CveEmpresa) If Tipo <> "" Then filtros.Add($"Tipo = {Tipo}")
If CveUsuario > 0 Then If filtros.Count > 0 Then
filtro.AppendFormat(" AND CveUsuario={0} ", CveUsuario) Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
End If
If Tipo <> "" Then
filtro.AppendFormat(" AND Tipo='{0}'", Tipo)
End If
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTOCEstatusUsuarios = Dv.ToTable GlobalDTOCEstatusUsuarios = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else

View File

@@ -19,7 +19,7 @@
Return -1 Return -1
End If End If
End Get End Get
Set(value As Integer) Set(value As Integer)
ViewState("CveEstatus") = value ViewState("CveEstatus") = value
End Set End Set
End Property End Property

View File

@@ -126,14 +126,12 @@
</div> </div>
</div> </div>
<div class="row "> <div class="row ">
<div class="col-md-1"> <asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<asp:Label ID="LblProyecto" runat="server">Proyecto:</asp:Label> <div runat="server" id="DivProyecto" class="col-md-2">
</div>
<div class="col-md-2">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%"> <asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1">SubProyecto:</asp:Label> <asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1 truncate">SubProyecto:</asp:Label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True"> <asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True">
</asp:DropDownList> </asp:DropDownList>

View File

@@ -85,7 +85,7 @@ Partial Class Compras_RepComprasAF
DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa) DdlActivoFijo.DataSource = GlobalDTActivoFijos(UsuarioActual.CveEmpresa)
DdlActivoFijo.DataBind() DdlActivoFijo.DataBind()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
CargaPS(-1) CargaPS(-1)

View File

@@ -168,14 +168,13 @@
<div class="row "> <div class="row ">
<div class="col-md-1"><asp:Label ID="LblProyecto" runat="server">Proyecto:</asp:Label></div> <asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
<div class="col-md-2"> <div runat="server" id="DivProyecto" class="col-md-2">
<asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%"> <asp:DropDownList ID="DdlProyecto" CssClass=" form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Proyecto" DataValueField="CveProyecto" Width="95%">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1 truncate">SubProyecto:</asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-1">SubProyecto:</asp:Label>
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlSubProyecto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True"> <asp:DropDownList ID="DdlSubProyecto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True">
</asp:DropDownList> </asp:DropDownList>

View File

@@ -160,7 +160,7 @@ Partial Class Compras_RepComprasAFDetalle
Private Sub CargaCombos() Private Sub CargaCombos()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa) DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlProveedores.DataBind() DdlProveedores.DataBind()

View File

@@ -36,7 +36,7 @@ public partial class Compras_RepPagado : ClsPaginas
private void InicializaValores() private void InicializaValores()
{ {
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, null, LblSubProyecto); CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:DivProyecto);
//Carga Moneda //Carga Moneda
DdlMoneda.DataSource = GlobalDTMonedas; DdlMoneda.DataSource = GlobalDTMonedas;

View File

@@ -41,7 +41,7 @@ public partial class Compras_RepPágadoDetalle : ClsPaginas
private void InicializaValores() private void InicializaValores()
{ {
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, null, LblSubProyecto); CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:DivProyecto);
//Carga Moneda //Carga Moneda
DdlMoneda.DataSource = GlobalDTMonedas; DdlMoneda.DataSource = GlobalDTMonedas;

View File

@@ -78,7 +78,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas
TxtFechaICompra.Text = MinFecha.ToShortDateString(); //'$"01/01/{DateTime.Now.Year}"; TxtFechaICompra.Text = MinFecha.ToShortDateString(); //'$"01/01/{DateTime.Now.Year}";
TxtFechaFCompra.Text = DateTime.Now.ToShortDateString(); TxtFechaFCompra.Text = DateTime.Now.ToShortDateString();
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, null, LblSubProyecto); CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:DivProyecto);
} }
private void CargaCuentasBancarias() private void CargaCuentasBancarias()
{ {

View File

@@ -28,7 +28,7 @@ public partial class Contabilidad_AuxiliarPrePolizas : ClsPaginas
private void InicializaValores() private void InicializaValores()
{ {
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, null, LblSubProyecto); CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:DivProyecto);
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString(); txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = DateTime.Now.ToShortDateString(); txtFechaF.Text = DateTime.Now.ToShortDateString();
DdlPlantillaPoliza.DataSource = get_GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa); DdlPlantillaPoliza.DataSource = get_GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa);

View File

@@ -87,7 +87,7 @@ Partial Class Inventarios_Remanufactura
Public Sub InicializaValores() Public Sub InicializaValores()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
TxtFecha.Text = Now.ToShortDateString TxtFecha.Text = Now.ToShortDateString

View File

@@ -20,7 +20,7 @@ Partial Class Inventarios_RepReciclaje
Public Sub InicializaValores() Public Sub InicializaValores()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
txtFechaF.Text = Now.ToShortDateString txtFechaF.Text = Now.ToShortDateString

View File

@@ -84,7 +84,7 @@
</div> </div>
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row"> <div class="row">
<label class="col-md-1">Proyecto: </label> <asp:Label ID="LblProyecto" class="col-md-1" runat="server">Proyecto: </asp:Label>
<div class="col-md-2" id="DivProyecto" runat="server"> <div class="col-md-2" id="DivProyecto" runat="server">
<asp:DropDownList ID="DdlProyecto" runat="server" DataTextField="Proyecto" DataValueField="CveProyecto" CssClass="form-control input-sm select2me" Width="250px" AutoPostBack="true"></asp:DropDownList> <asp:DropDownList ID="DdlProyecto" runat="server" DataTextField="Proyecto" DataValueField="CveProyecto" CssClass="form-control input-sm select2me" Width="250px" AutoPostBack="true"></asp:DropDownList>
</div> </div>

View File

@@ -69,7 +69,7 @@ Partial Class OC_CatEstatus
ViewState("TipoSeleccionado") = DdlTipo.SelectedValue ViewState("TipoSeleccionado") = DdlTipo.SelectedValue
CargaDatos() CargaDatos()
CargaEstatus() CargaEstatus()
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
CargaUsuarios() CargaUsuarios()
sssss() sssss()

View File

@@ -134,7 +134,7 @@
</div> </div>
<div class="titlefiltros caption"> <div class="titlefiltros caption">
<div class="row"> <div class="row">
<label class="col-md-1">Proyecto: </label> <asp:Label ID="LblProyecto" class="col-md-1" runat="server">Proyecto: </asp:Label>
<div class="col-md-2" id="DivProyecto" runat="server"> <div class="col-md-2" id="DivProyecto" runat="server">
<asp:DropDownList ID="DdlProyecto" runat="server" DataTextField="Proyecto" DataValueField="CveProyecto" CssClass="form-control input-sm select2me" Width="250px" AutoPostBack="true"></asp:DropDownList> <asp:DropDownList ID="DdlProyecto" runat="server" DataTextField="Proyecto" DataValueField="CveProyecto" CssClass="form-control input-sm select2me" Width="250px" AutoPostBack="true"></asp:DropDownList>
</div> </div>

View File

@@ -63,7 +63,7 @@ Partial Class OS_CatEstatusOrdenServicio
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
CargarTodosLosDatos() CargarTodosLosDatos()
CveEstatuOS = -1 CveEstatuOS = -1
End If End If

View File

@@ -127,7 +127,7 @@ Partial Class Ventas_RepAuxiliarFacturas
DdlEstatus.SelectedIndex = 1 DdlEstatus.SelectedIndex = 1
End If End If
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, Nothing, LblSubProyecto) CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto)
TipoCambio = 1 TipoCambio = 1
TCEspecifico = 0 TCEspecifico = 0

View File

@@ -142,7 +142,7 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
} }
DdlClienteClasificacion.DataSource = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa); DdlClienteClasificacion.DataSource = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa);
DdlClienteClasificacion.DataBind(); DdlClienteClasificacion.DataBind();
DdlClienteClasificacion.Items.Insert(0, new ListItem("Todos", "-1")); DdlClienteClasificacion.Items.Insert(0, new ListItem("Todos", "-1"));
//Carga Grupos //Carga Grupos

View File

@@ -9490,7 +9490,7 @@ Partial Class Ventas
End If End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional <= ObjFactura.Total Then If ObjFactura.TipoDocto = "Rem" AndAlso Me.SaldoLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy() TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False) CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia) Alert("El saldo de la linea adicional debe ser mayor o igual al de la remisión", TipoMensaje.MsgAdvertencia)
@@ -9504,7 +9504,7 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional <= ObjFactura.Total Then If ObjFactura.TipoDocto = "Ing" AndAlso Me.SaldoIngresosLineaAdicional < ObjFactura.Total Then
TmpDT = TmpDTError.Copy() TmpDT = TmpDTError.Copy()
CalculaTotalesVenta(RecalcularTotalOriginal:=False) CalculaTotalesVenta(RecalcularTotalOriginal:=False)
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia) Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
@@ -17727,6 +17727,7 @@ Partial Class Ventas
Private Sub CambiaTipoComprobante() Private Sub CambiaTipoComprobante()
CambiaTipoDocto() CambiaTipoDocto()
LimpiaEscondeContado() LimpiaEscondeContado()
End Sub End Sub
Private Sub CambiaTipoDocto() Private Sub CambiaTipoDocto()
CargaNC(IfNull(Request("CveDevolucion"), "-1").ToString().ToEntero()) CargaNC(IfNull(Request("CveDevolucion"), "-1").ToString().ToEntero())
@@ -17884,6 +17885,8 @@ Partial Class Ventas
TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString TxtFechaPago.Text = Now.AddDays(PlazoCobranza).ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
TabAlmacen.Enabled = DdlTipoComprobante.SelectedValue <> "Ant" TabAlmacen.Enabled = DdlTipoComprobante.SelectedValue <> "Ant"
'VALIDA ESTATUS CLIENTE - SOLO SE PUEDE USAR EL CLIENTE PARA COTIZAR EN CASO DE ESTAR INACTIVO 'VALIDA ESTATUS CLIENTE - SOLO SE PUEDE USAR EL CLIENTE PARA COTIZAR EN CASO DE ESTAR INACTIVO
@@ -18688,7 +18691,9 @@ Partial Class Ventas
'SI TIENE PRONTO PAGO CALCULA EL IMPORTE 'SI TIENE PRONTO PAGO CALCULA EL IMPORTE
If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then If DdlTipoComprobante.SelectedValue = "Ing" AndAlso RowPorcentaje("ProntoPago").ToString().ToDecimal() > 0 Then
Dim TotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento Dim SubTotalProntoPago As Decimal = (Cantidad * (PU)) - Descuento
Dim TotalProntoPago As Decimal = SubTotalProntoPago * (1 + PorcentajeIVA)
Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D Dim PorcentajeProntoPago = RowPorcentaje("ProntoPago").ToString().ToDecimal() / 100D
ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2) ObjDescuento.ImporteProntoPago = (TotalProntoPago * PorcentajeProntoPago).RoundSQL(2)
@@ -22649,6 +22654,8 @@ Partial Class Ventas
imgCalendario.Visible = False imgCalendario.Visible = False
End If End If
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
UpContado.Update() UpContado.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
@@ -32063,6 +32070,8 @@ Partial Class Ventas
TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text) TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
UpRemisionesFacturas.Update() UpRemisionesFacturas.Update()
UpFacturar.Update() UpFacturar.Update()
UpPS.Update() UpPS.Update()
@@ -32734,9 +32743,12 @@ Partial Class Ventas
ObjCliente.Dispose() ObjCliente.Dispose()
DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty)
TrVistaPrevia.Visible = True TrVistaPrevia.Visible = True
TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
'HABILITA EDITAR Y ELIMINAR DEL GV 'HABILITA EDITAR Y ELIMINAR DEL GV
GvPS.Columns(17).Visible = True GvPS.Columns(17).Visible = True
GvPS.Columns(18).Visible = True GvPS.Columns(18).Visible = True
@@ -32968,6 +32980,8 @@ Partial Class Ventas
TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString
TxtFechaEjecucion.Text = Now.ToString() TxtFechaEjecucion.Text = Now.ToString()
DdlLineaAdicional_SelectedIndexChanged(DdlLineaAdicional, EventArgs.Empty)
'VALIDAR QUE NO SE HAYA REMISIONADO 'VALIDAR QUE NO SE HAYA REMISIONADO
If TipoDoctoViejo = "PA" Then If TipoDoctoViejo = "PA" Then
Dim RowVenta As DataRow = Nothing Dim RowVenta As DataRow = Nothing
@@ -36318,6 +36332,8 @@ Partial Class Ventas
Protected Sub DdlLineaAdicional_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlLineaAdicional_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(705) = "1" Then
TxtFechaPago.Enabled = True TxtFechaPago.Enabled = True
imgCalendario.Visible = True imgCalendario.Visible = True
@@ -36336,9 +36352,12 @@ Partial Class Ventas
'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL 'AL FACTURAR CON LINEA ADICIONAL TIPO PO, SE SUMARÁN LOS DIAS DE VENCIMIENTO A LA FECHA ACTUAL
If RowLinea("TipoLinea").ToString() = "2" Then If RowLinea("TipoLinea").ToString() = "2" Then
TxtFechaPago.Text = Now.AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy") TxtFechaPago.Text = Now.AddDays(RowLinea("DiasVencimiento").ToString().ToEntero()).ToString("dd/MM/yyyy")
Else
TxtFechaPago.Text = RowLinea("FechaVencimiento").ToString().ToDateTime().ToString("dd/MM/yyyy")
End If
TxtFechaPago.Enabled = False TxtFechaPago.Enabled = False
imgCalendario.Visible = False imgCalendario.Visible = False
End If
TxtOrdenCompra.Text = RowLinea("LineaAdicionalComercializador").ToString() TxtOrdenCompra.Text = RowLinea("LineaAdicionalComercializador").ToString()
End If End If
@@ -36396,6 +36415,8 @@ Partial Class Ventas
UpParametros.Update() UpParametros.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
UPObservaciones.Update() UPObservaciones.Update()
End If
End Sub End Sub
Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs) Protected Sub LnkUpdateLineaAdicional_Click(sender As Object, e As EventArgs)
'VALIDAR LINEAS ADICIONALES 'VALIDAR LINEAS ADICIONALES
@@ -36432,7 +36453,7 @@ Partial Class Ventas
End If End If
'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE 'VERIFICA QUE EL SALDO DISPONIBLE SEA MENOR AL IMPORTE
If Me.SaldoLineaAdicional <= TxtTotal.Text.ToDecimal() Then If Me.SaldoLineaAdicional < TxtTotal.Text.ToDecimal() Then
Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia) Alert("El saldo de la linea adicional debe ser mayor o igual al de la factura", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If