From b9651e8ba69ad059fabfdf7129637c37aba4e995 Mon Sep 17 00:00:00 2001 From: MLopez Date: Mon, 23 Jan 2023 23:07:15 -0700 Subject: [PATCH] E13 Buscar Cuentas de banco de proveedores en Popup --- App_Code/ClsPaginas.vb | 2 + Bancos/PopUpBuscarCuentasProveedor.aspx | 164 +++++++++++++++++++++ Bancos/PopUpBuscarCuentasProveedor.aspx.vb | 124 ++++++++++++++++ Site.master | 6 + Site.master.vb | 5 +- 5 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 Bancos/PopUpBuscarCuentasProveedor.aspx create mode 100644 Bancos/PopUpBuscarCuentasProveedor.aspx.vb diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ecbcd2ecf..ae6a62790 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4555,6 +4555,7 @@ Public Class ClsPaginas PaginaDict.Add("/Sistemas/CatContrasenia.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/PopUpBuscarClientes.aspx".ToUpper(), -1) PaginaDict.Add("/Compras/PopUpBuscarProveedor.aspx".ToUpper(), -1) + PaginaDict.Add("/Compras/PopUpBuscarCuentasProveedor.aspx".ToUpper(), -1) PaginaDict.Add("/Ventas/PopUpImprimir.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/PopUpAuxiliar.aspx".ToUpper(), -1) PaginaDict.Add("/Fiscal/PopUpConfiguracion.aspx".ToUpper(), -1) @@ -4797,6 +4798,7 @@ Public Class ClsPaginas PaginaDict.Add("/Bancos/PopUpBuscaPersonal.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarColectiva.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarProveedor.aspx".ToUpper(), 281) + PaginaDict.Add("/Bancos/PopUpBuscarCuentasProveedor.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarFolioC.aspx".ToUpper(), 281) PaginaDict.Add("/Bancos/PopUpBuscarClientes.aspx".ToUpper(), 281) 'PaginaDict.Add("/Bancos/CatTiposCuenta.aspx".ToUpper(), -1) diff --git a/Bancos/PopUpBuscarCuentasProveedor.aspx b/Bancos/PopUpBuscarCuentasProveedor.aspx new file mode 100644 index 000000000..61cf9512b --- /dev/null +++ b/Bancos/PopUpBuscarCuentasProveedor.aspx @@ -0,0 +1,164 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpBuscarCuentasProveedor.aspx.vb" Inherits="Bancos_PopUpBuscarCuentasProveedor" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + + + + + + + + +<%----%> + + + + + + + + + + + + + + + + + + +
Filtros para búsqueda
Proveedor: + + + + + +
+ +
+
+
+ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+<%-- --%> +
+ + + + + diff --git a/Bancos/PopUpBuscarCuentasProveedor.aspx.vb b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb new file mode 100644 index 000000000..48c16f351 --- /dev/null +++ b/Bancos/PopUpBuscarCuentasProveedor.aspx.vb @@ -0,0 +1,124 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports Extensiones +Partial Class Bancos_PopUpBuscarCuentasProveedor + Inherits ClsPaginas + +#Region "Propiedades" + Private ReadOnly Property CveProveedor As Integer + Get + Return ViewState("CveProveedor").ToString.ToEntero + End Get + End Property + Private Property DTCuentasBancos As DataTable + Get + Return CType(ViewState("DTCuentasBancos"), DataTable) + End Get + Set(value As DataTable) + ViewState("DTCuentasBancos") = value + End Set + End Property + + +#End Region + + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + CType(Me.Master, BaseMasterPage).EsPopup = True + CType(Me.Master, BaseMasterPage).PopupWidth = 780 + RegistraScript("if($get('tdContenido')){$get('tdContenido').style.height='465px'}") + + If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then + ViewState("CveProveedor") = Request("CveProveedor") + CargaDatos(CveProveedor) + DdlProveedores.SelectedValue = CveProveedor.ToString + Else + ViewState("CveProveedor") = -1 + End If + + InicializaValores() + + Me.Form.DefaultButton = BtnBuscar.UniqueID + End If + End Sub + Private Sub InicializaValores() + Dim Txt As String = IfNull(Request("Txt"), "").ToString + If Txt <> "" Then LblTitulo.Text = String.Format("Búsqueda de {0}", Txt) + + DdlProveedores.setEsWebService(True) + DdlProveedores.Attributes.Add("data-metodo", "getproveedores") + DdlProveedores.SelectedText = "Seleccione" + DdlProveedores.SelectedValue = "-1" + DdlProveedores.DataBind() + End Sub + Private Sub CargaDatos(CveProveedor As Integer) + + If ValidarFiltrosSeleccionados() OrElse CveProveedor > 0 Then + CargaCuentasBancarias() + UPDatos.Update() + Else + Alert("Seleccione un proveedor", TipoMensaje.MsgAdvertencia) + End If + End Sub + + Private Sub CargaCuentasBancarias() + 'If CveProveedor <= 0 Then Exit Sub + Dim ObjCuentasBancos As New ClsGenerales + DTCuentasBancos = New DataTable + + If ObjCuentasBancos.GetCuentasDepositos(CveProveedor) Then + DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados) + Else + Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia) + ObjCuentasBancos.Dispose() + Exit Sub + End If + + If CveProveedor < 0 Then + 'Alert("No hay proveedor", TipoMensaje.MsgInformacion) + 'TempDTCuentasBancos = DTCuentasBancos + End If + + ObjCuentasBancos.Dispose() + CargaPSGridCuentasBancos() + RecargaGlobalCuentasBancarias() + End Sub + + Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1) + If CveProveedor > 0 Then + Dim ObjCuentasBancos As New ClsGenerales + + If ObjCuentasBancos.GetCuentasDepositos() Then + GlobalDTProveedoresCuentas(-1, True) = ObjCuentasBancos.DtResultados + End If + ObjCuentasBancos.Dispose() + End If + End Sub + + Private Sub CargaPSGridCuentasBancos() + GvBancosCuentas.DataSource = DTCuentasBancos.FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue}") + GvBancosCuentas.DataBind() + TblBusqueda.Visible = True + UPDatos.Update() + End Sub + + Protected Sub BtnBuscar_Click(sender As Object, e As System.EventArgs) Handles BtnBuscar.Click + CargaDatos(DdlProveedores.SelectedValue.ToEntero) + End Sub + + Private Sub GV_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound + 'If e.Row.RowType = DataControlRowType.DataRow Then + ' If e.Row.DBCampo("CveAlmacen") = "" Then + ' e.Row.CssClass = "Totales" + ' End If + 'End If + End Sub + + Private Function ValidarFiltrosSeleccionados() As Boolean + If DdlProveedores.SelectedValue.ToEntero > 0 Then Return True + Return False + End Function + +End Class diff --git a/Site.master b/Site.master index 0a9eac6db..e21684d8e 100644 --- a/Site.master +++ b/Site.master @@ -194,6 +194,12 @@ Buscar Proveedor +
  • + + + Buscar Cuentas Proveedor + +
  • diff --git a/Site.master.vb b/Site.master.vb index 88c437c73..4db71a563 100644 --- a/Site.master.vb +++ b/Site.master.vb @@ -215,7 +215,10 @@ Partial Class Site 'End Sub Private Sub CargaBuscadores() 'Proveedores - If UsuarioActual.TienePermisoPagina(37) Then tdProv.Visible = True + If UsuarioActual.TienePermisoPagina(37) Then + tdProv.Visible = True + tdProvBancos.Visible = True + End If 'Clientes If UsuarioActual.TienePermisoPagina(26) Then tdCliente.Visible = True