From 964358dd2698a1d1649b9d6598d50a9561c13c65 Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 26 Nov 2024 19:58:43 -0700 Subject: [PATCH] -- mejoras en actualizar precios, listas de precio --- App_Code/ClsProductosServicios.vb | 14 +++-- Ventas/ActualizarPrecios.aspx | 89 ++++++++++++++++++------------- Ventas/ActualizarPrecios.aspx.vb | 39 ++++++++------ 3 files changed, 87 insertions(+), 55 deletions(-) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 96195d57a..946a3f82d 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -1980,7 +1980,8 @@ Public Class ClsProductosServicios #Region "Precios Lista" Public Function GetPSPreciosLista(CveEmpresa As Integer, CvePrecioLista As Integer, Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1, - Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean + Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1, + Optional CodigoInicial As String = "-1", Optional CodigoFinal As String = "-1", Optional Opcion As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PSPrecioListaGet") With SqlAdapter.SelectCommand.Parameters @@ -1992,6 +1993,9 @@ Public Class ClsProductosServicios .Add("@Estado", SqlDbType.Int).Value = Estado .Add("@Marcas", SqlDbType.VarChar).Value = Marcas .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@CodigoInicial", SqlDbType.VarChar).Value = CodigoInicial + .Add("@CodigoFinal", SqlDbType.VarChar).Value = CodigoFinal + .Add("@Opcion", SqlDbType.Int).Value = Opcion End With Try SqlAdapter.Fill(Data) @@ -2004,9 +2008,10 @@ Public Class ClsProductosServicios End Function Public Function GetPSMultiplesPreciosLista(CveEmpresa As Integer, Optional ListasPrecios As String = "-1", Optional CveClasificacion As Integer = -1, Optional CvePS As Integer = -1, - Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1) As Boolean + Optional CveProveedor As Integer = -1, Optional Estado As Integer = -1, Optional Marcas As String = "-1", Optional CveModelo As Integer = -1, + Optional CodigoInicial As String = "-1", Optional CodigoFinal As String = "-1") As Boolean Dim Retorno As Boolean = False - DataAdapter("PA_Vta_PSPrecioListaMultipleGet") + DataAdapter("PA_Vta_PSPrecioListaMultipleGetRM") With SqlAdapter.SelectCommand.Parameters .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@ListasPrecios", SqlDbType.VarChar).Value = ListasPrecios @@ -2016,6 +2021,9 @@ Public Class ClsProductosServicios .Add("@Estado", SqlDbType.Int).Value = Estado .Add("@Marcas", SqlDbType.VarChar).Value = Marcas .Add("@CveModelo", SqlDbType.Int).Value = CveModelo + .Add("@CodigoInicial", SqlDbType.VarChar).Value = CodigoInicial + .Add("@CodigoFinal", SqlDbType.VarChar).Value = CodigoFinal + End With Try SqlAdapter.Fill(Data) diff --git a/Ventas/ActualizarPrecios.aspx b/Ventas/ActualizarPrecios.aspx index dd6743fa4..c7b3491d3 100644 --- a/Ventas/ActualizarPrecios.aspx +++ b/Ventas/ActualizarPrecios.aspx @@ -90,7 +90,7 @@ - +
@@ -106,7 +106,7 @@
-
+
@@ -129,6 +129,20 @@
+
+
+
+
+
+ +
+ +
+
Código Fin:
+
+ +
+
@@ -151,7 +165,7 @@ -
+
@@ -186,16 +200,19 @@ Aplicar Precio Min.
- - -
- - - -
-
- -
+
+
+
+ + + + +
+
+
+ +
+
@@ -213,7 +230,7 @@ CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" OnRowDataBound="GVPrecios_RowDataBound" > - + @@ -229,42 +246,38 @@ - - + - - <%-- - - --%> + +
+
-
- - - - - - + + +
+ <%-- --%>
- - - + + + + - + - - + + - - - - + + + +
@@ -616,6 +629,8 @@ + + diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 187ef77b2..5b5649406 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -114,6 +114,11 @@ Partial Class Ventas_ActualizarPrecios PermisoEdicionLista = False DivActualizarPrecio.Visible = False HlAgregarExcel.Visible = False + End If + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(109) = "1" Then 'Empresa gdiaz + GVPrecios.Columns(2).Visible = True + DVFiltroCodigo.Visible = True End If CargaCombos() @@ -202,12 +207,9 @@ Partial Class Ventas_ActualizarPrecios End If End Sub Protected Sub CargarMarcas() - If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then - Dim ObjMarcas As New ClsProductosServicios - If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then - DdlMarca.DataSource = ObjMarcas.DtResultados.Copy - End If - ObjMarcas.Dispose() + If UsuarioActual.Empresa.Funcionalidad(130) = "1" Then + + DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa) DdlMarca.DataBind() LblMarca.Visible = True @@ -248,16 +250,25 @@ Partial Class Ventas_ActualizarPrecios If DdlModalidad.SelectedValue = "1" Then Dim objPS As New ClsProductosServicios If objPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, DdlPrecioLista.SelectedValue.ToEntero, DDlClasificacion.SelectedValue.ToEntero, CvePS, - CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then + CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero, + CodigoInicial:=TxtCodigoInicio.Text.Trim, CodigoFinal:=TxtCodigoFinal.Text.Trim) Then DtDatosPrecios = objPS.DtResultados GVPrecios.DataSource = DtDatosPrecios End If objPS.Dispose() - If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Or UsuarioActual.Empresa.Funcionalidad(382) = "1" Then 'Empresa Acumuladores GVPrecios.Columns(2).Visible = True End If + If UsuarioActual.CveEmpresa = 119 Then 'JAM + GVPrecios.Columns(5).Visible = True + GVPrecios.Columns(10).Visible = True + GVPrecios.Columns(12).Visible = True + GVPrecios.Columns(13).Visible = True + GVPrecios.Columns(14).Visible = True + End If + If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec GVPrecios.Columns(11).Visible = True End If @@ -281,7 +292,8 @@ Partial Class Ventas_ActualizarPrecios Dim objPS As New ClsProductosServicios If objPS.GetPSMultiplesPreciosLista(UsuarioActual.CveEmpresa, ListasPrecios:=ListasPrecios, CveClasificacion:=DDlClasificacion.SelectedValue.ToEntero, CvePS:=CvePS, - CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero) Then + CveProveedor:=CveProveedor, Estado:=DdlEstado.SelectedValue.ToEntero, Marcas:=Marcas, CveModelo:=DdlModelo.SelectedValue.ToEntero, + CodigoInicial:=TxtCodigoInicio.Text.Trim, CodigoFinal:=TxtCodigoFinal.Text.Trim) Then DtPreciosMultiple = objPS.DtResultados.Copy() GvMultiple.DataSource = DtPreciosMultiple End If @@ -291,17 +303,15 @@ Partial Class Ventas_ActualizarPrecios dvMultiple.Visible = True DivActualizarPrecio.Visible = False - For colIndex As Integer = 2 To GvMultiple.Columns.Count - 1 - If colIndex <= DtPreciosMultiple.Columns.Count - 1 Then + For colIndex As Integer = 2 To GvMultiple.Columns.Count - 3 + If colIndex <= DtPreciosMultiple.Columns.Count - 3 Then GvMultiple.Columns(colIndex).Visible = True Else GvMultiple.Columns(colIndex).Visible = False End If Next - GvMultiple.DataBind() - End If - + End If UpDescargar.Update() UpDatos.Update() @@ -341,7 +351,6 @@ Partial Class Ventas_ActualizarPrecios sbProductos.AppendFormat("{0},", row.DataKey("CvePS").ToEntero) End If - If Not TieneError Then TieneError = ActualizarPreciosFranquicia(ObjPS, row.DataKey("Codigo"), row.FCTextBox("TxtPrecio").Text.ToDecimal, row.FCTextBox("TxtPrecioMinimo").Text.ToDecimal, DdlPrecioLista.SelectedItem.Text) Else