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

@@ -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"