From 8e525c514fa00ef408da45c5c8c83ccb190b14aa Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Wed, 30 Jun 2021 18:54:20 -0700 Subject: [PATCH] Cantidad minima en cada tipo de promocion --- Ventas/Promociones.aspx | 8 ++++---- Ventas/Promociones.aspx.vb | 31 ++++++++++++++++--------------- Ventas/Ventas.aspx.vb | 4 ++-- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx index b0f322748..581e8f021 100644 --- a/Ventas/Promociones.aspx +++ b/Ventas/Promociones.aspx @@ -254,7 +254,7 @@
- + @@ -272,7 +272,7 @@
-
+
@@ -287,9 +287,9 @@
- + - +
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index c3a6844b2..5b7812691 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -104,7 +104,7 @@ Partial Class Ventas_Promociones DdlMarca.Items.Insert(0, New ListItem("Todos", "-1")) If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then - GvDatos.Columns(7).Visible = True + GvDatos.Columns(8).Visible = True DivRin.Visible = True Dim ObjGral As New ClsGenerales If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then @@ -235,7 +235,7 @@ Partial Class Ventas_Promociones LbPUActual.Text = "" DdlTipoPromocion.SelectedValue = "-1" TxtPromocionConcepto.Text = "" - TxtCantMinima.Text = "" + TxtCantMinima.Text = "1" ChkRestricciones.Checked = False 'DivRestricciones.Visible = False @@ -259,6 +259,11 @@ Partial Class Ventas_Promociones Exit Sub End If + If TxtCantMinima.Text.ToEntero <= 0 Then + Alert("La cantidad minima debe ser de 1", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + Dim Dr As DataRow = Nothing If CveConsecutivo >= 0 Then @@ -291,11 +296,7 @@ Partial Class Ventas_Promociones Dr("PUPromocion") = LbPUActual.Text.ToDecimal - (LbPUActual.Text.ToDecimal * TxtPromocionConcepto.Text.ToDecimal / 100) End If - If DdlTipoPromocion.SelectedValue.ToEntero = 3 Then - Dr("CantidadMinima") = TxtCantMinima.Text.ToEntero - Else - Dr("CantidadMinima") = 1 - End If + Dr("CantidadMinima") = TxtCantMinima.Text.ToEntero If ChkRestricciones.Checked Then Dr("AplicaRestriccionTexto") = "Si" @@ -369,7 +370,7 @@ Partial Class Ventas_Promociones LbPUActual.Text = Gvr.DataKey("PUAnterior").FormatoNumero DdlTipoPromocion.SelectedValue = Gvr.DataKey("CveTipoPromocion") - DdlTipoPromocion_SelectedIndexChanged(sender, Nothing) + 'DdlTipoPromocion_SelectedIndexChanged(sender, Nothing) TxtPromocionConcepto.Text = Gvr.DataKey("Promocion").FormatoNumero(4) TxtCantMinima.Text = Gvr.DataKey("CantidadMinima") @@ -533,11 +534,11 @@ Partial Class Ventas_Promociones End Sub #End Region - Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) - If DdlTipoPromocion.SelectedValue = "3" Then - DivCantMinima.Visible = True - Else - DivCantMinima.Visible = False - End If - End Sub + 'Protected Sub DdlTipoPromocion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPromocion.SelectedIndexChanged + ' If DdlTipoPromocion.SelectedValue = "3" Then + ' DivCantMinima.Visible = True + ' Else + ' DivCantMinima.Visible = False + ' End If + 'End Sub End Class \ No newline at end of file diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 084f5c6ab..aef867548 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -16743,11 +16743,11 @@ Partial Class Ventas Dim dr As DataRow = Nothing If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then - dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {3} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {3} ))", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc ") If dr Is Nothing Then 'verifica marca, si tiene asignada la promocion - dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND (TipoPromocion <> 3 OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") + dr = DtPromociones.FiltroPrimero(String.Format("CvePS IS NULL AND CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {3} OR CveRinTamaño IS NULL) AND ((TipoPromocion <> 3 AND (CantidadMinima <= {4} OR CantidadMinima IS NULL)) OR (TipoPromocion = 3 AND CantidadMinima <= {4} )) ", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS, TxtCantidad.Text), Orderby:="CantidadMinima desc") End If End If