From cc707621b02b7cade75e63b9c80e6a318d0b8a2f Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Tue, 7 Jan 2020 18:13:13 -0700 Subject: [PATCH] Agregando descuentos a la recepcion usados en base al cliente y la marca --- Inventarios/RecepcionUsados.aspx.vb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 5f8a4181e..b8cd2b673 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -309,6 +309,14 @@ Partial Class Inventarios_RecepcionUsados ViewState("TmpDTAjustes") = value End Set End Property + Private Property DtPorcentajeMarcas As DataTable + Get + Return If(IsNothing(ViewState("DtPorcentajeMarcas")), Nothing, CType(ViewState("DtPorcentajeMarcas"), DataTable)) + End Get + Set(value As DataTable) + ViewState("DtPorcentajeMarcas") = value + End Set + End Property #End Region @@ -2447,6 +2455,7 @@ Partial Class Inventarios_RecepcionUsados DivAjuste.Visible = True 'Llenar el dropdownlist de almacén DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6) + CargarDescuento() LnkAgregarUsado.Visible = False UppAcciones.Update() Else @@ -2549,6 +2558,13 @@ Partial Class Inventarios_RecepcionUsados End If End If + Dim MarcaPorcentaje As DataRow = DtPorcentajeMarcas.FiltroPrimero(String.Format("CveMarca = {0}", drPS("CveMarca").ToString)) + If MarcaPorcentaje IsNot Nothing Then + Dim Descuento As Decimal = MarcaPorcentaje("PorcentajeProducto").ToString.ToDecimal / 100 + Dim MontoDescuento As Decimal = PrecioSugerido * Descuento + PrecioSugerido -= MontoDescuento + End If + txtPrecio.Text = PrecioSugerido.FormatoNumero(2) TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2) End If @@ -2717,6 +2733,14 @@ Partial Class Inventarios_RecepcionUsados End If ObjPS.Dispose() End Sub + + Protected Sub CargarDescuento() + Dim ObjPS As New ClsProductosServicios + If ObjPS.GetPorcentajeMarcas(DdlClientes.SelectedValue.ToEntero) Then + DtPorcentajeMarcas = ObjPS.DtResultados.Copy() + End If + ObjPS.Dispose() + End Sub #End Region End Class