Cantidad minima en cada tipo de promocion
This commit is contained in:
@@ -254,7 +254,7 @@
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Tipo Promoción:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlTipoPromocion" DataTextField="TipoPromocion" DataValueField="CveTipoPromocion" Width="100%" CssClass="select2me" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPromocion_SelectedIndexChanged">
|
||||
<asp:DropDownList ID="DdlTipoPromocion" DataTextField="TipoPromocion" DataValueField="CveTipoPromocion" Width="100%" CssClass="select2me" runat="server" AutoPostBack="true" >
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Importe $" Value="1" />
|
||||
<asp:ListItem Text="Descuento %" Value="2" />
|
||||
@@ -272,7 +272,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="DivCantMinima" visible="false" runat="server">
|
||||
<div class="row" id="DivCantMinima" runat="server">
|
||||
<label class="col-md-3 truncate">Cantidad Mínima:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:TextBox ID="TxtCantMinima" Text="" runat="server" />
|
||||
@@ -287,9 +287,9 @@
|
||||
<div class="row" runat="server" id="DivRin" visible="false">
|
||||
<label class="col-md-3 truncate">Rin:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlRin" DataTextField="RinTamaño" DataValueField="CveRinTamaño" Width="100%" CssClass="select2me" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DdlTipoPromocion_SelectedIndexChanged">
|
||||
<asp:DropDownList ID="DdlRin" DataTextField="RinTamaño" DataValueField="CveRinTamaño" Width="100%" CssClass="select2me" runat="server" >
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" InitialValue="-1" ControlToValidate="DdlTipoPromocion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo Promoción''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" InitialValue="-1" ControlToValidate="DdlRin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Rin''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpAgregar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipoPromocion" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user