From 196297f4fd1f1ea551441c4555c9acadd09d98ba Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Sat, 21 Mar 2020 13:43:06 -0700 Subject: [PATCH] se termino de agregar la marca y el rin en las promociones --- Ventas/Promociones.aspx | 20 +++++++++++++++++++- Ventas/Promociones.aspx.vb | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index fac769ab1..42b937317 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -139,6 +139,13 @@ + +
+ +
+ +
+
@@ -171,7 +178,7 @@
- + <%----%> @@ -181,6 +188,7 @@ + @@ -276,6 +284,16 @@
+
+ +
+ + + + +
+
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index fdf49d14f..9f54c1ea2 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -66,7 +66,7 @@ Partial Class Ventas_Promociones #Region " VALORES INICIALES " Private Sub CargaValoresIniciales() - + Dim ObjPS As New ClsProductosServicios 'CLASIFICACIONES DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion") DdlClasificacion.DataBind() @@ -93,6 +93,26 @@ Partial Class Ventas_Promociones TxtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString TxtFechaF.Text = Now.LastDayOfMonth.ToShortDateString + + If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then + DdlMarca.DataSource = ObjPS.DtResultados + End If + ObjPS.Dispose() + DdlMarca.DataBind() + DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) + + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + GvDatos.Columns(7).Visible = True + DivRin.Visible = True + Dim ObjGral As New ClsGenerales + If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then + DdlRin.DataSource = ObjGral.DtResultados + End If + ObjGral.Dispose() + DdlRin.DataBind() + DdlRin.Items.Insert(0, New ListItem("Todos", "-1")) + End If + End Sub Private Sub CreaDT() @@ -107,6 +127,7 @@ Partial Class Ventas_Promociones TempDT.Columns.Add("PUAnterior", GetType(Decimal)) TempDT.Columns.Add("PUPromocion", GetType(Decimal)) TempDT.Columns.Add("CveTipoPromocion", GetType(Integer)) + TempDT.Columns.Add("CveRinTamaño", GetType(Integer)) TempDT.Columns.Add("TipoPromocion", GetType(String)) TempDT.Columns.Add("Promocion", GetType(String)) TempDT.Columns.Add("CantidadMinima", GetType(Integer)) @@ -162,6 +183,7 @@ Partial Class Ventas_Promociones TxtFechaI.Text = Dr("FechaInicio").ToString.ToDate.ToShortDateString TxtFechaF.Text = Dr("FechaFin").ToString.ToDate.ToShortDateString DdlSubProyecto.SelectedValue = Dr("CveSubProyecto").ToString + DdlMarca.SelectedValue = Dr("CveMarca").ToString If Dr("CveVendedor").ToString.ToEntero > 0 Then DdlVendedor.SelectedValue = Dr("CveVendedor").ToString If Dr("CveCliente").ToString.ToEntero > 0 Then DdlCliente.SelectedValue = Dr("CveCliente").ToString ChkEstatus.Checked = If(Dr("Estatus").ToString = "True", True, False) @@ -294,6 +316,12 @@ Partial Class Ventas_Promociones Dr("AplicaDomingo") = False End If + If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then + Dr("CveRinTamaño") = DdlRin.SelectedValue.ToEntero + Else + Dr("CveRinTamaño") = -1 + End If + If CveConsecutivo >= 0 Then Dr.AcceptChanges() Else @@ -322,7 +350,7 @@ Partial Class Ventas_Promociones RegistraScript("$('#DivAgregar').modal('show')") CveConsecutivo = e.CommandArgument.ToString.ToEntero - + DdlRin.SelectedValue = Gvr.DataKey("CveRinTamaño") DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion") ChangeDdlProducto() If UsuarioActual.Empresa.Funcionalidad(105) = "" Then @@ -388,14 +416,14 @@ Partial Class Ventas_Promociones ObjVentas.IniciaTransacSQL() CvePromocion = ObjVentas.AddPromociones(TxtPromocion.Text.Trim, If(IsDate(TxtFechaI.Text), TxtFechaI.Text.ToDate, MinFecha), If(IsDate(TxtFechaF.Text), TxtFechaF.Text.ToDate, MaxFecha), DdlVendedor.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero, ChkEstatus.Checked, DdlMoneda.SelectedValue.ToEntero, UsuarioActual.CveUsuario, - UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString) + UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlTipoAplicacion.SelectedValue.ToString, DdlMarca.SelectedValue.ToEntero) If CvePromocion > 0 Then For Each Dr As DataRow In TempDT.Rows If Not ObjVentas.AddPromocionesDetalle(CvePromocion, Dr("CvePS").ToString.ToEntero, Dr("CveTipoPromocion").ToString.ToEntero, Dr("Promocion").ToString.ToDouble, Dr("PUAnterior").ToString.ToDouble, Dr("PUPromocion").ToString.ToDouble, CBool(Dr("AplicaRestriccion")), CBool(Dr("AplicaLunes")), CBool(Dr("AplicaMartes")), CBool(Dr("AplicaMiercoles")), CBool(Dr("AplicaJueves")), CBool(Dr("AplicaViernes")), CBool(Dr("AplicaSabado")), CBool(Dr("AplicaDomingo")), Dr("HoraInicio").ToString.ToDateTime, Dr("HoraFin").ToString.ToDateTime, Dr("CantidadMinima").ToString.ToEntero, - CveClasificacion:=If(Dr("CvePS").ToString = "", 20, Dr("CveClasificacion").ToString.ToEntero)) Then + CveClasificacion:=If(Dr("CvePS").ToString = "", 20, Dr("CveClasificacion").ToString.ToEntero), CveRinTamaño:=Dr("CveRinTamaño").ToString.ToEntero) Then TieneError = True Exit For End If