-- cambio en el globalDT

This commit is contained in:
2023-02-21 19:21:26 -07:00
parent a2e500d29c
commit 2ebd5185b5
2 changed files with 34 additions and 14 deletions

View File

@@ -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

View File

@@ -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