Se aplicaron Promociones en Ventas

This commit is contained in:
janeth arvizu
2019-11-15 14:02:50 -07:00
parent fb33df90cb
commit dd6e0aaf99
2 changed files with 26 additions and 1 deletions

View File

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

View File

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