-promociones

This commit is contained in:
rrene
2020-03-25 12:39:26 -07:00
32 changed files with 21524 additions and 1929 deletions

View File

@@ -354,7 +354,7 @@ Partial Class Ventas_Promociones
RegistraScript("$('#DivAgregar').modal('show')")
CveConsecutivo = e.CommandArgument.ToString.ToEntero
DdlRin.SelectedValue = Gvr.DataKey("CveRinTamaño")
DdlRin.SelectedValueExist(Gvr.DataKey("CveRinTamaño"))
DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion")
ChangeDdlProducto()
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then

View File

@@ -14307,10 +14307,15 @@ Partial Class Ventas
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))
If drC IsNot Nothing Then
Dim Cant As Integer = 1
TipoPromo = drC("TipoPromocion").ToString.ToEntero
TotalPromocion = drC("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
PromocionPorcentaje = drC("Promocion").ToString.ToDecimal
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
@@ -14793,7 +14798,7 @@ Partial Class Ventas
End If
PU = Math.Round(PU, 6)
DrPoliza("PU") = PU
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString.ToDecimal * (PU)) - Descuento
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString.ToDecimal * (PU))
If DrPSAdicional("IVA").ToString.Contiene("-1", "") Then
DrPoliza("PorcentajeIVA") = PorcentajeIVA
@@ -14809,7 +14814,7 @@ Partial Class Ventas
DrPoliza("PorcentajeIEPS") = DrPSAdicional("IEPSPorcentaje")
DrPoliza("ImporteIEPS") = Math.Round(DrPSAdicional("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
DrPoliza("IEPS") = DrPoliza("ImporteIEPS")
DrPoliza("Descuento") = 0
DrPoliza("Descuento") = Descuento
DrPoliza("TipoDescuento") = HdnTipoDescuento.Value
DrPoliza("Total") = (DrPoliza("Cantidad").ToString.ToDecimal * PU)
DrPoliza("TotalImporte") = Math.Round(DrPoliza("Cantidad").ToString.ToDecimal * PU, NumeroDecimales)
@@ -17738,20 +17743,20 @@ Partial Class Ventas
End Sub
Private Function ValidaPagosContado() As Boolean
Dim Retorno = False
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
'SI LA VENTA ES NUEVA VALIDAR TAMBIEN LOS PAGOS DE CONTADO
If UsuarioActual.CveEmpresa = 141 AndAlso CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0 Then
If Not PermiteCredito AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno
End If
If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso Total > 0 Then
If Not PermiteCredito AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0) AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then
If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno
@@ -17769,11 +17774,10 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso TxtTotal.Text.ToDecimal > 0 Then
Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
If TotalPago < Total Then
If TotalPago < TxtTotal.Text.ToDecimal Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)
Retorno = True
Return Retorno