From da35b7b21d7887a4a4429c12d929bf8358b1f8f5 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 24 Jan 2025 00:50:58 -0700 Subject: [PATCH] =?UTF-8?q?5=20Buscador=20en=20promociones,=20por=20articu?= =?UTF-8?q?lo,=20por=20fecha,=20por=20cliente=20por=20sucursal,=20vendedor?= =?UTF-8?q?,=20usuario=20ingres=C3=B3,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsVentas.vb | 4 +- Compras/RepProductosServiciosDetalle.aspx.vb | 3 +- Ventas/CatPromociones.aspx | 62 ++++++++++++++++---- Ventas/CatPromociones.aspx.vb | 52 +++++++++++++--- 4 files changed, 100 insertions(+), 21 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 484068c11..966cac521 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2482,7 +2482,8 @@ Public Class ClsVentas #Region " PROMOCIONES " Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, - CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean + CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean + Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesGet") @@ -2496,6 +2497,7 @@ Public Class ClsVentas .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario + .Add("@CvePS", SqlDbType.Int).Value = CvePS End With Try diff --git a/Compras/RepProductosServiciosDetalle.aspx.vb b/Compras/RepProductosServiciosDetalle.aspx.vb index dc15ec06c..19ca0a061 100644 --- a/Compras/RepProductosServiciosDetalle.aspx.vb +++ b/Compras/RepProductosServiciosDetalle.aspx.vb @@ -115,9 +115,10 @@ Partial Class Compras_RepProductosServiciosDetalle txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text) txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text) - If CveCultivo.ToEntero() > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then + If CveCultivo.Length > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then txtFechaI.Text = "01/01/1900" End If + If Fecha <> "-1" Then txtFechaI.Text = Fecha txtFechaF.Text = Fecha diff --git a/Ventas/CatPromociones.aspx b/Ventas/CatPromociones.aspx index 998968349..e19fcc227 100644 --- a/Ventas/CatPromociones.aspx +++ b/Ventas/CatPromociones.aspx @@ -28,25 +28,61 @@
-
+ +
+
- -
- <%-- --%> + +
+ : +
+
- -
- - - - - + + Cliente: +
+ +
+ + Vendedor: +
+ +
+
+
+ +
@@ -69,6 +105,10 @@ + + + + diff --git a/Ventas/CatPromociones.aspx.vb b/Ventas/CatPromociones.aspx.vb index e5a6f525f..a18864c75 100644 --- a/Ventas/CatPromociones.aspx.vb +++ b/Ventas/CatPromociones.aspx.vb @@ -22,21 +22,57 @@ Partial Class Ventas_CatPromociones Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then - - 'ImgAddPromocion.Attributes.Add("OnClick", "window.location = '/Ventas/Promociones.aspx'") - 'CARGA SUCURSALES - DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() - DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) - + InicializaControles() CargaDatos() End If End Sub + Private Sub InicializaControles() + + + + CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto) + + GvDatos.Columns(6).HeaderText = LblSubProyecto.Text + + DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) + DdlSubProyecto.DataBind() + DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) + DdlVendedor.DataBind() + DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) + + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarca.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClientes.setEsWebService(True) + + 'CARGA PS + DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1") + DdlPS.IncluyeTodos = True + If Not DdlPS.UsaWebService AndAlso CType(DdlPS.DataSource, DataTable) Is Nothing Then + DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + DdlPS.DataBind() + End If + + End Sub + Private Sub CargaDatos() + Dim ObjVentas As New ClsVentas - If ObjVentas.GetPromociones(-1, MinFecha, -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario) Then + Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1) + Dim CvePS As Integer = If(DdlPS.SelectedValue.ToEntero > 0, DdlPS.SelectedValue.ToEntero, -1) + + + If ObjVentas.GetPromociones(-1, MinFecha, DdlVendedor.SelectedValue.ToEntero, CveCliente, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario, + CveMarca:=DdlMarca.SelectedValue.ToEntero, CvePS:=CvePS) Then DtDatos = ObjVentas.DtResultados Else DtDatos = Nothing