Agregando descuentos a la recepcion usados en base al cliente y la marca

This commit is contained in:
Antonio Gonzalez
2020-01-07 18:13:13 -07:00
parent 3a5bbcb6b1
commit cc707621b0

View File

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