- timbrado, liga alterno

- compras. ajuste de centavo en registro almacen
- ventas, promociones
This commit is contained in:
rrene
2020-04-02 16:33:30 -07:00
parent ebe0d84a6c
commit 75eb486127
3 changed files with 30 additions and 34 deletions

View File

@@ -14315,11 +14315,13 @@ Partial Class Ventas
Dim TipoPromo As Integer = 0
Dim TotalPromocion As Decimal = 0
Dim PromocionPorcentaje As Decimal = 0
Dim PUPromocion As Decimal = 0
Dim CantMinima As Integer = 0
Dim CveMarcaPS As Integer = 0
Dim CveClasifPS As Integer = 0
Dim CveRinTamañoPS As Integer = 0
Dim CvePromocionDetalle As Integer = 0
Dim IncluyeImpuestos As Boolean = False
Dim ObjDescuento As New Descuentos
Dim DrPS As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
@@ -14335,33 +14337,34 @@ Partial Class Ventas
End If
Dim dr As DataRow = Nothing
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
Dim dr As DataRow = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL)", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS))
If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString.ToEntero
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
CantMinima = dr("CantidadMinima").ToString.ToEntero
CvePromocionDetalle = dr("CvePromocionDetalle").ToString.ToEntero
Else
dr = DtPromociones.FiltroPrimero(String.Format("CvePS = {0} AND (CveSubProyecto = {1} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL)", CvePS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS))
If dr Is Nothing Then
'verifica marca, si tiene asignada la promocion
Dim drC As DataRow = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL)", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS))
dr = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL) AND (CveSubProyecto = {2} OR CveSubProyecto IS NULL) AND (CveRinTamaño = {2} OR CveRinTamaño IS NULL)", CveClasifPS, CveMarcaPS, DdlSubProyectoDatos.SelectedValue, CveRinTamañoPS))
If drC IsNot Nothing Then
Dim Cant As Integer = 1
TipoPromo = drC("TipoPromocion").ToString.ToEntero
CantMinima = drC("CantidadMinima").ToString.ToEntero
If CantMinima > 0 Then
Cant = Math.Floor(TxtCantidad.Text.ToDecimal / CantMinima).ToEntero
End If
TotalPromocion = Math.Round(drC("PUPromocion").ToString.ToDecimal * Cant / (1 + PorcentajeIVA), 6)
PromocionPorcentaje = drC("Promocion").ToString.ToDecimal
CvePromocionDetalle = drC("CvePromocionDetalle").ToString.ToEntero
End If
End If
End If
Dim Cant As Integer = 1
If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString.ToEntero
CantMinima = dr("CantidadMinima").ToString.ToEntero
IncluyeImpuestos = dr("IncluyeImpuestos").ToString = "True"
PromocionPorcentaje = dr("Promocion").ToString.ToDecimal
PUPromocion = dr("PUPromocion").ToString.ToDecimal
CvePromocionDetalle = dr("CvePromocionDetalle").ToString.ToEntero
If CantMinima > 0 Then
Cant = Math.Floor(TxtCantidad.Text.ToDecimal / CantMinima).ToEntero
End If
End If
TotalPromocion = Math.Round(PUPromocion * Cant / (1 + If(IncluyeImpuestos, PorcentajeIVA, 1)), 6)
If TipoPromo = 1 Then 'Promocion por Importe $
Descuento = Descuento + TotalPromocion