diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb index 0abb602fd..4d76f7aa3 100644 --- a/Ventas/Promociones.aspx.vb +++ b/Ventas/Promociones.aspx.vb @@ -250,7 +250,7 @@ Partial Class Ventas_Promociones Dr("TipoPromocion") = DdlTipoPromocion.SelectedItem.Text Dr("Promocion") = TxtPromocionConcepto.Text - If DdlTipoPromocion.SelectedValue.ToEntero = 1 Then + If DdlTipoPromocion.SelectedValue.ToEntero.Contiene(1, 3) Then Dr("PUPromocion") = TxtPromocionConcepto.Text.ToDecimal Else Dr("PUPromocion") = LbPUActual.Text.ToDecimal - (LbPUActual.Text.ToDecimal * TxtPromocionConcepto.Text.ToDecimal / 100) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 415661031..b452d4b3d 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -13683,6 +13683,31 @@ Partial Class Ventas Descuento = HdnDescuento.Value.ToDecimal * TxtCantidad.Text.ToDecimal End If + + 'Agrega Promocion en el Descuento + Dim TipoPromo As Integer = 0 + Dim TotalPromocion As Decimal = 0 + Dim PromocionPorcentaje As Decimal = 0 + Dim CantMinima As Integer = 0 + + If DtPromociones.Rows.Count > 0 And DtPromociones IsNot Nothing Then + Dim dr As DataRow = DtPromociones.FiltroPrimero($"CvePS = {CvePS}") + TipoPromo = dr("TipoPromocion").ToString.ToEntero + TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal + PromocionPorcentaje = dr("Promocion").ToString.ToDecimal + CantMinima = dr("CantidadMinima").ToString.ToEntero + End If + + If TipoPromo = 1 Then 'Promocion por Importe $ + Descuento = Descuento + TotalPromocion + ElseIf TipoPromo = 2 Then 'Promocion por % + Descuento = Descuento + ((TxtPrecio.Text.Trim.ToDecimal * PromocionPorcentaje / 100) * TxtCantidad.Text.ToDecimal) + ElseIf TipoPromo = 3 Then 'Promocion por Cantidad + If TxtCantidad.Text.ToDecimal >= CantMinima Then + Descuento = Descuento + TotalPromocion + End If + End If + AgregarProductoServicio(TxtCantidad.Text.ToDecimal, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, CvePS, "", TxtObsPS.Text.Trim, If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal), Descuento, DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text,