From 2ebd5185b5b47f187b714926fff2303832bbba79 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 21 Feb 2023 19:21:26 -0700 Subject: [PATCH] -- cambio en el globalDT --- App_Code/ClsPaginas.vb | 42 ++++++++++++++++++++++++++++++++---------- Bancos/IE.aspx.vb | 6 ++---- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 3360ec10d..709357029 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -597,26 +597,48 @@ Public Class ClsPaginas Application(AppNombre) = value End Set End Property - Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional Estatus As Boolean = True) As DataTable + Property GlobalDTCuentasDepositosClientes(CveEmpresa As Integer, Optional CveCliente As Integer = -1, Optional CveCuentaDeposito As Integer = -1) As DataTable Get Dim AppNombre As String = $"GlobalDTCuentasDepositosClientes-{CveEmpresa}" - If Application(AppNombre) Is Nothing Then + If HttpContext.Current.Application(AppNombre) Is Nothing Then Dim P As New ClsGenerales - If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then Application(AppNombre) = P.DtResultados + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CveCliente:=-2) Then HttpContext.Current.Application(AppNombre) = P.DtResultados P.Dispose() End If - Dim Str As New StringBuilder - Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) - If CveCliente <> -1 Then Str.AppendFormat(" AND CveCliente = {0}", CveCliente) - If Estatus = True Then Str.AppendFormat(" AND Estatus = 1 ") - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + Dim filtros As New List(Of String) + If CveCliente <> -1 Then filtros.Add($"CveCliente = {CveCliente}") + If CveCuentaDeposito <> -1 Then filtros.Add($"CveCuentaDeposito = {CveCuentaDeposito}") + + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) GlobalDTCuentasDepositosClientes = Dv.ToTable Dv.Dispose() End Get Set(value As DataTable) Dim AppNombre As String = $"GlobalDTCuentasDepositosClientes-{CveEmpresa}" - Application(AppNombre) = value + HttpContext.Current.Application(AppNombre) = value + End Set + End Property + + Property GlobalDTCuentasDepositosPersonales(CveEmpresa As Integer, Optional CvePersonal As Integer = -1, Optional CveCuentaDeposito As Integer = -1) As DataTable + Get + Dim AppNombre As String = $"GlobalDTCuentasDepositosPersonales-{CveEmpresa}" + If HttpContext.Current.Application(AppNombre) Is Nothing Then + Dim P As New ClsGenerales + If P.GetCuentasDepositos(CveEmpresa:=CveEmpresa, CvePersonal:=-2) Then HttpContext.Current.Application(AppNombre) = P.DtResultados + P.Dispose() + End If + Dim filtros As New List(Of String) + If CvePersonal <> -1 Then filtros.Add($"CvePersonal = {CvePersonal}") + If CveCuentaDeposito <> -1 Then filtros.Add($"CveCuentaDeposito = {CveCuentaDeposito}") + Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows) + GlobalDTCuentasDepositosPersonales = Dv.ToTable + Dv.Dispose() + + End Get + Set(value As DataTable) + Dim AppNombre As String = $"GlobalDTCuentasDepositosPersonales-{CveEmpresa}" + HttpContext.Current.Application(AppNombre) = value End Set End Property Property GlobalDTProveedorClasificacion(CveEmpresa As Integer) As DataTable @@ -7571,7 +7593,7 @@ Public Class ClsPaginas ImporteMN = (ImporteMovimiento * CompraActual.TC).RoundSQL If CompraActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento Dim ContabilizableISR As Boolean = False - If UsuarioActual.CveEmpresa.Contiene(140, 7, 11, 12, 122, 145, 172, 173) Then + If UsuarioActual.CveEmpresa.Contiene(140, 7, 11, 12, 122, 145, 172, 173, 174) Then ContabilizableISR = True End If Dim Ret As ConceptosRetenciones = CompraActual.ConceptoPrePolizaRetISR diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb index 7b28e1a9d..ea0fb4252 100644 --- a/Bancos/IE.aspx.vb +++ b/Bancos/IE.aspx.vb @@ -5201,6 +5201,8 @@ Partial Class Bancos_IE dtc = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) ElseIf CveCliente > 0 Then dtc = GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, CveCliente:=CveCliente) + ElseIf cvepersonal > 0 Then + dtc = GlobalDTCuentasDepositosPersonales(UsuarioActual.CveEmpresa, CvePersonal:=CvePersonal) End If @@ -5221,20 +5223,16 @@ Partial Class Bancos_IE ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE <= -1 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus = 'True' ") trCuentaDeposito.Visible = True BtnGuardar.ToolTip = "" - Else - BtnGuardar.Enabled = False Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" End If DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - UpGuardar.Update() Else