This commit is contained in:
Antonio Gonzalez
2020-03-25 14:48:32 -07:00
2 changed files with 17 additions and 9 deletions

View File

@@ -82,6 +82,7 @@ Partial Class Ventas_Promociones
'CARGA SUBPROYECTOS 'CARGA SUBPROYECTOS
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind() DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind() DdlVendedor.DataBind()
@@ -353,7 +354,7 @@ Partial Class Ventas_Promociones
RegistraScript("$('#DivAgregar').modal('show')") RegistraScript("$('#DivAgregar').modal('show')")
CveConsecutivo = e.CommandArgument.ToString.ToEntero CveConsecutivo = e.CommandArgument.ToString.ToEntero
DdlRin.SelectedValue = Gvr.DataKey("CveRinTamaño") DdlRin.SelectedValueExist(Gvr.DataKey("CveRinTamaño"))
DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion") DdlClasificacion.SelectedValue = Gvr.DataKey("CveClasificacion")
ChangeDdlProducto() ChangeDdlProducto()
If UsuarioActual.Empresa.Funcionalidad(105) = "" Then If UsuarioActual.Empresa.Funcionalidad(105) = "" Then

View File

@@ -6724,7 +6724,7 @@ Partial Class Ventas
End If End If
End If End If
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then If DivAlmacen.Visible AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Dev") AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 AndAlso ddlAlmacen.SelectedValue.ToEntero() <= 0 Then
Alert("Tiene que seleccionar un almacén para la salida de almacén", TipoMensaje.MsgAdvertencia) Alert("Tiene que seleccionar un almacén para la salida de almacén", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -11010,7 +11010,7 @@ Partial Class Ventas
Next Next
End If End If
If GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then If DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim Filtro As String = "" Dim Filtro As String = ""
Select Case factura.TipoDocto Select Case factura.TipoDocto
@@ -14276,6 +14276,7 @@ Partial Class Ventas
Dim CantMinima As Integer = 0 Dim CantMinima As Integer = 0
Dim CveMarcaPS As Integer = 0 Dim CveMarcaPS As Integer = 0
Dim CveClasifPS As Integer = 0 Dim CveClasifPS As Integer = 0
Dim CveRinTamañoPS As Integer = 0
Dim CvePromocionDetalle As Integer = 0 Dim CvePromocionDetalle As Integer = 0
Dim ObjDescuento As New Descuentos Dim ObjDescuento As New Descuentos
@@ -14284,6 +14285,7 @@ Partial Class Ventas
CveMarcaPS = DrPS("CveMarca").ToString.ToEntero CveMarcaPS = DrPS("CveMarca").ToString.ToEntero
CveClasifPS = DrPS("CveClasificacion").ToString.ToEntero CveClasifPS = DrPS("CveClasificacion").ToString.ToEntero
CveRinTamañoPS = DrPS("CveRinTamaño").ToString.ToEntero
If CveClasifPS = 20636 Then If CveClasifPS = 20636 Then
ValidaCondicionesComerciales = False ValidaCondicionesComerciales = False
@@ -14293,7 +14295,7 @@ Partial Class Ventas
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then 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)", CvePS, DdlSubProyectoDatos.SelectedValue)) 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 If dr IsNot Nothing Then
TipoPromo = dr("TipoPromocion").ToString.ToEntero TipoPromo = dr("TipoPromocion").ToString.ToEntero
TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal TotalPromocion = dr("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
@@ -14302,13 +14304,18 @@ Partial Class Ventas
CvePromocionDetalle = dr("CvePromocionDetalle").ToString.ToEntero CvePromocionDetalle = dr("CvePromocionDetalle").ToString.ToEntero
Else Else
'verifica marca, si tiene asignada la promocion 'verifica marca, si tiene asignada la promocion
Dim drC As DataRow = DtPromociones.FiltroPrimero(String.Format("CveClasificacion = {0} AND (CveMarca = {1} OR CveMarca IS NULL)", CveClasifPS, CveMarcaPS)) 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 If drC IsNot Nothing Then
Dim Cant As Integer = 1
TipoPromo = drC("TipoPromocion").ToString.ToEntero TipoPromo = drC("TipoPromocion").ToString.ToEntero
TotalPromocion = drC("PUPromocion").ToString.ToDecimal * TxtCantidad.Text.ToDecimal
PromocionPorcentaje = drC("Promocion").ToString.ToDecimal
CantMinima = drC("CantidadMinima").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 CvePromocionDetalle = drC("CvePromocionDetalle").ToString.ToEntero
End If End If
End If End If
@@ -14791,7 +14798,7 @@ Partial Class Ventas
End If End If
PU = Math.Round(PU, 6) PU = Math.Round(PU, 6)
DrPoliza("PU") = PU DrPoliza("PU") = PU
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString.ToDecimal * (PU)) - Descuento TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString.ToDecimal * (PU))
If DrPSAdicional("IVA").ToString.Contiene("-1", "") Then If DrPSAdicional("IVA").ToString.Contiene("-1", "") Then
DrPoliza("PorcentajeIVA") = PorcentajeIVA DrPoliza("PorcentajeIVA") = PorcentajeIVA
@@ -14807,7 +14814,7 @@ Partial Class Ventas
DrPoliza("PorcentajeIEPS") = DrPSAdicional("IEPSPorcentaje") DrPoliza("PorcentajeIEPS") = DrPSAdicional("IEPSPorcentaje")
DrPoliza("ImporteIEPS") = Math.Round(DrPSAdicional("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales) DrPoliza("ImporteIEPS") = Math.Round(DrPSAdicional("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
DrPoliza("IEPS") = DrPoliza("ImporteIEPS") DrPoliza("IEPS") = DrPoliza("ImporteIEPS")
DrPoliza("Descuento") = Math.Round(Descuento, NumeroDecimales) DrPoliza("Descuento") = Descuento
DrPoliza("TipoDescuento") = HdnTipoDescuento.Value DrPoliza("TipoDescuento") = HdnTipoDescuento.Value
DrPoliza("Total") = (DrPoliza("Cantidad").ToString.ToDecimal * PU) DrPoliza("Total") = (DrPoliza("Cantidad").ToString.ToDecimal * PU)
DrPoliza("TotalImporte") = Math.Round(DrPoliza("Cantidad").ToString.ToDecimal * PU, NumeroDecimales) DrPoliza("TotalImporte") = Math.Round(DrPoliza("Cantidad").ToString.ToDecimal * PU, NumeroDecimales)