Descuento de precios por Marca

This commit is contained in:
janeth arvizu
2019-08-29 08:45:27 -07:00
parent f1f3a17b00
commit dd24119b96
2 changed files with 83 additions and 84 deletions

View File

@@ -266,7 +266,7 @@
<asp:UpdatePanel runat="server" ID="UpReporteGpsButton" RenderMode="Inline" UpdateMode="Conditional">
<ContentTemplate>
<li>
<asp:LinkButton ID="ReporteDispositivos" Visible="False" OnClick="GenerarReporte" data-toggle="tooltip" data-placement="left" runat="server" Text="<i class='fa fa-file-pdf-o'></i> Dispositivos GPS"></asp:LinkButton>
<asp:LinkButton ID="ReporteDispositivos" Visible="False" OnClick="GenerarReporte" data-toggle="tooltip" data-placement="left" runat="server" Text="<i class='fa fa-file-pdf-o'></i> Dispositivos GPS"></asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
@@ -1129,9 +1129,9 @@
<asp:GridView ID="GVHistorial" runat="server" DataKeyNames="CveVenta, Folio, TipoDocto" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas en el Cliente" ToolTip="Listado de Historial de Ventas" CssClass="table table-striped table-advance table-hover" Style="text-align: center; min-width: 783px; width: 100%;" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField >
<asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate >
<ItemTemplate>
<asp:Literal ID="LtlFactura" runat="server"></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
@@ -5483,13 +5483,12 @@
<tbody>
<tr class="Titulos">
<th style="width: 28px">#</th>
<th style="width: 200px">Clasificación<br />
Producto </th>
<th width="73px">Precio<br />
General </th>
<th style="width: 200px">Marca</th>
<%-- <th width="73px">Precio<br />
General </th>--%>
<th width="73px">%</th>
<th width="73px">Precio<br />
Aplicado </th>
<%-- <th width="73px">Precio<br />
Aplicado </th>--%>
<th style="width: 73px;"></th>
</tr>
<tr align="center">
@@ -5497,35 +5496,36 @@
<td style="text-align: center;">
<div class="psagregar">
<div class="comboxes">
<asp:DropDownList ID="DdlClasificacion2" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" Height="22px"/>
<%-- <asp:DropDownList ID="DdlClasificacion2" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" Class="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
<br />
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" />--%>
<%-- <asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlProducto2" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto''</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</td>
<td>
<%-- <td>
<asp:Label ID="LbPrecioG" DataFormatString="{0:N2}" Width="55px" MaxLength="15" runat="server"></asp:Label>
</td>
</td>--%>
<td>
<asp:TextBox ID="txtPorcentaje" CssClass="form-control input-sm" Width="55px" MaxLength="15" runat="server" ValidationGroup="GprAgregaPS" Style="text-align: right"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="ftbe" runat="server" TargetControlID="txtPorcentaje" FilterType="Custom, Numbers" ValidChars=".," />
<asp:RequiredFieldValidator ID="RFVPorcentaje" runat="server" ControlToValidate="txtPorcentaje" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''%'' Porcentaje</b> es necesario, por favor ingréselo." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
</td>
<td>
<%-- <td>
<asp:Label ID="LbPrecioA" Width="55px" MaxLength="15" runat="server" ClientIDMode="Static"></asp:Label>
</td>
</td>--%>
<td align="center">
<asp:LinkButton ID="LbAgregar" runat="server" CssClass="btn btn-default" ValidationGroup="GprAgregaPS" Text="Agregar" />
</td>
</tr>
</tbody>
</table>
<asp:Button ID="BtnCambiaPorcentaje" Text="" OnClick="BtnCambiaPorcentaje_Click" ClientIDMode="Static" Style="display: none;" runat="server" />
<%--<asp:Button ID="BtnCambiaPorcentaje" Text="" OnClick="BtnCambiaPorcentaje_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
</div>
<br />
@@ -5546,7 +5546,7 @@
<ItemStyle Width="28px"></ItemStyle>
</asp:TemplateField>
<asp:BoundField HeaderText="" ReadOnly="true" DataField="Producto" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioG" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioG" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
<asp:TemplateField HeaderText="">
@@ -5562,7 +5562,7 @@
</asp:TemplateField>
<asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioA" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />
<%-- <asp:BoundField HeaderText="" ReadOnly="true" DataField="PrecioA" ItemStyle-Width="73px" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" />--%>
<asp:TemplateField>
<EditItemTemplate>

View File

@@ -8138,8 +8138,9 @@ Partial Class Clientes
CreaDT()
txtPorcentaje.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5"))
CargaPorcentajesProductos()
'txtPorcentaje.Attributes.Add("onchange", String.Format("FnCambiaPorcentaje({0});", "5"))
'CargaPorcentajesProductos()
CargaMarcas()
LimpiaModalPorcentaje()
End Sub
Private Sub CreaDT()
@@ -8154,61 +8155,69 @@ Partial Class Clientes
End With
DTPorcentajeTemp.Columns.Add(column)
DTPorcentajeTemp.Columns.Add("CvePS", GetType(Integer))
DTPorcentajeTemp.Columns.Add("Producto", GetType(String))
DTPorcentajeTemp.Columns.Add("PrecioG", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("CveMarca", GetType(Integer))
DTPorcentajeTemp.Columns.Add("PorcentajeProducto", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("PrecioA", GetType(Decimal))
DTPorcentajeTemp.Columns.Add("Estatus", GetType(String))
DTPorcentajePrecios = DTPorcentajeTemp.Clone
End Sub
Private Sub CargaPorcentajesProductos()
'Llenar el dropdownlist de Secciones
If UsuarioActual.CveEmpresa = 66 Then
DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
Else
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados
End If
ObjClasificaciones.Dispose()
End If
DdlClasificacion2.DataBind()
Private Sub CargaMarcas()
Dim ObjMarcas As New ClsProductosServicios
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
ObjMarcas.Dispose()
DdlMarcaPS.DataBind()
DdlMarcaPS.Items.Insert(0, New ListItem("Seleccione", "-1"))
CargaPS()
CargaGridPorcentajes()
UpPorcentaje.Update()
End Sub
Private Sub CargaPS()
DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
'Private Sub CargaPorcentajesProductos()
' 'Llenar el dropdownlist de Secciones
' If UsuarioActual.CveEmpresa = 66 Then
' DdlClasificacion2.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
' Else
' Dim ObjClasificaciones As New ClsClasificaciones
' If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
' DdlClasificacion2.DataSource = ObjClasificaciones.DtResultados
' End If
' ObjClasificaciones.Dispose()
' End If
' DdlClasificacion2.DataBind()
If UsuarioActual.CveEmpresa = 66 Then
DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
End If
' CargaPS()
' CargaGridPorcentajes()
If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
' UpPorcentaje.Update()
'End Sub
'Private Sub CargaPS()
' DdlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
DdlProducto2.DataBind()
' If UsuarioActual.CveEmpresa = 66 Then
' DdlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
' End If
DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
' If Not DdlProducto2.UsaWebService AndAlso CType(DdlProducto2.DataSource, DataTable) Is Nothing Then
' DdlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoPS = 2")
End Sub
' DdlProducto2.DataBind()
Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
End Sub
Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
' DdlProducto2.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
' End If
If drPS IsNot Nothing Then
Dim Precio = drPS("Precio").ToString.ToDouble
LbPrecioG.Text = Precio.FormatoNumero()
LbPrecioA.Text = ((Precio * txtPorcentaje.Text.ToDecimal) / 100).FormatoNumero
End If
End Sub
'End Sub
'Protected Sub DdlProducto2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlProducto2.selectedindexchange
' DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
'End Sub
'Private Sub DdlProducto2IndexChange(CvePSParametro As Integer, Ddl As ADServerControl.Dropdownlost)
' Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
' If drPS IsNot Nothing Then
' Dim Precio = drPS("Precio").ToString.ToDouble
' LbPrecioG.Text = Precio.FormatoNumero()
' LbPrecioA.Text = ((Precio * txtPorcentaje.Text.ToDecimal) / 100).FormatoNumero
' End If
'End Sub
Private Sub CargaGridPorcentajes()
Dim ObjPS As New ClsProductosServicios
@@ -8232,31 +8241,22 @@ Partial Class Clientes
Private Sub LimpiaModalPorcentaje()
txtPorcentaje.Text = ""
DdlClasificacion2.SelectedValue = "-1"
DdlProducto2.SelectedText = ""
DdlMarcaPS.SelectedValue = "-1"
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then
If DdlProducto2.SelectedText <> "" Then
If txtPorcentaje.Text.ToDecimal >= 0 And txtPorcentaje.Text.ToDecimal <= 100 Then
Dim registro As DataRow = DTPorcentajePrecios.NewRow
Dim registro As DataRow = DTPorcentajePrecios.NewRow
registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1
registro.Item("CvePS") = DdlProducto2.SelectedValue.ToEntero
registro.Item("Producto") = DdlProducto2.SelectedText
registro.Item("PrecioG") = 0
registro.Item("PrecioA") = 0 * txtPorcentaje.Text.ToDecimal / 100
registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal
registro.Item("Estatus") = "I"
DTPorcentajePrecios.Rows.Add(registro)
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
Else
Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia)
End If
registro.Item("No") = DTPorcentajePrecios.Rows.Count + 1
registro.Item("CveMarca") = DdlMarcaPS.SelectedValue.ToEntero
registro.Item("PorcentajeProducto") = txtPorcentaje.Text.ToDecimal
registro.Item("Estatus") = "I"
DTPorcentajePrecios.Rows.Add(registro)
CargaDTPorcentajePrecios(DTPorcentajePrecios.FiltraParametros("Estatus <> 'D' "))
Else
Alert("El campo <b>''Producto''</b> es necesario, por favor ingréselo.", TipoMensaje.MsgAdvertencia)
Alert("El Porcentaje debe estar en un rango entre 0 y 100", TipoMensaje.MsgAdvertencia)
End If
LimpiaModalPorcentaje()
@@ -8272,7 +8272,7 @@ Partial Class Clientes
i = lnkRemove.CommandArgument.ToString.ToEntero
Dim Drs As DataRow() = DTPorcentajePrecios.Select(String.Format("No = {0}", i))
If Drs.Count > 0 Then
If CveCliente > 0 AndAlso Drs(0)("CvePS").ToString.ToEntero > 0 Then
If CveCliente > 0 AndAlso Drs(0)("CveMarca").ToString.ToEntero > 0 Then
Drs(0)("Estatus") = "D"
Else
Drs(0).Delete()
@@ -8309,7 +8309,6 @@ Partial Class Clientes
If Drs.Count > 0 Then
Drs(0)("PorcentajeProducto") = PorcentajeProducto
Drs(0)("PrecioA") = Drs(0)("PrecioG").ToString.ToDouble * PorcentajeProducto / 100
Drs(0)("Estatus") = "U"
End If
@@ -8363,9 +8362,9 @@ Partial Class Clientes
End Sub
Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
End Sub
'Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
' DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero, DdlProducto2)
'End Sub
#End Region
#Region " A C U M U L A D O R E S"