diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 5c98d9754..ce6cb92d0 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1899,7 +1899,8 @@ Public Class ClsVentas End Function #Region " PROMOCIONES " - Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, CveSubProyecto As Integer) As Boolean + Public Function GetPromociones(CvePromocion As Integer, Fecha As String, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer, + CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesGet") @@ -1911,6 +1912,7 @@ Public Class ClsVentas .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With Try @@ -1922,7 +1924,9 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String) As Integer + Public Function AddPromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, + CveMoneda As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, TipoAplicacion As String, + Optional CveMarca As Integer = -1) As Integer Dim Retorno = -1 DataAdapter("PA_Vta_PromocionesAdd") @@ -1939,6 +1943,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@TipoAplicacion", SqlDbType.VarChar).Value = TipoAplicacion + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca .Add("@CvePromocion", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -1951,7 +1956,8 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdatePromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, CveMoneda As Integer, CveUsuario As Integer, CvePromocion As Integer, CveSubProyecto As Integer) As Boolean + Public Function UpdatePromociones(Promocion As String, FechaInicio As Date, FechaFin As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Boolean, + CveMoneda As Integer, CveUsuario As Integer, CvePromocion As Integer, CveSubProyecto As Integer, Optional CveMarca As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesUpdate") @@ -1967,6 +1973,7 @@ Public Class ClsVentas .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto + .Add("@CveMarca", SqlDbType.Int).Value = CveMarca End With Try @@ -2043,7 +2050,7 @@ Public Class ClsVentas Public Function AddPromocionesDetalle(CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, Optional CantidadMinima As Integer = 1, - Optional CveClasificacion As Integer = -1) As Boolean + Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleAdd") @@ -2067,6 +2074,7 @@ Public Class ClsVentas .Add("@HoraFin", SqlDbType.DateTime).Value = HoraFin .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño End With Try @@ -2081,7 +2089,7 @@ Public Class ClsVentas Public Function UpdatePromocionesDetalle(CvePromocionDetalle As Integer, CvePromocion As Integer, CvePS As Integer, TipoPromocion As Integer, Promocion As Double, PUAnterior As Double, PUPromocion As Double, AplicaRestriccion As Boolean, AplicaLunes As Boolean, AplicaMartes As Boolean, AplicaMiercoles As Boolean, AplicaJueves As Boolean, AplicaViernes As Boolean, AplicaSabado As Boolean, AplicaDomingo As Boolean, HoraInicio As DateTime, HoraFin As DateTime, - Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1) As Boolean + Optional CantidadMinima As Integer = 1, Optional CveClasificacion As Integer = -1, Optional CveRinTamaño As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesDetalleUpdate") @@ -2106,6 +2114,7 @@ Public Class ClsVentas .Add("@CvePromocionDetalle", SqlDbType.Int).Value = CvePromocionDetalle .Add("@CantidadMinima", SqlDbType.Int).Value = CantidadMinima .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveRinTamaño", SqlDbType.Int).Value = CveRinTamaño End With Try @@ -4290,7 +4299,7 @@ Public Class ClsVentas End Try Return retorno End Function - Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, CveClasificacion As Integer) As Boolean + Public Function AddMetasVendedores(CveVendedor As Integer, MesAño As Date, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, CveClasificacion As Integer, CveClasificacionSup As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Vta_MetasVendedoresAdd", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -4300,6 +4309,7 @@ Public Class ClsVentas .Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad .Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveClasificacionSup", SqlDbType.Int).Value = CveClasificacionSup End With Try SqlAdapter.Fill(Data) @@ -4338,7 +4348,7 @@ Public Class ClsVentas Return retorno End Function Public Function UpdateMetasVendedores(CveMeta As Integer, CveVendedor As Integer, MesAño As String, CveMarca As Integer, MetaCantidad As Integer, MetaImporte As Decimal, - CveClasificacion As Integer) As Boolean + CveClasificacion As Integer, CveClasificacionSup As Integer) As Boolean Dim retorno As Boolean = False DataAdapter("PA_Vta_MetasVendedoresUpdate", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -4349,6 +4359,7 @@ Public Class ClsVentas .Add("@MetaCantidad", SqlDbType.Int).Value = MetaCantidad .Add("@MetaImporte", SqlDbType.Decimal).Value = MetaImporte .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion + .Add("@CveClasificacionSup", SqlDbType.Int).Value = CveClasificacionSup End With Try SqlAdapter.Fill(Data) diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx index cdc2accf6..366e385c0 100644 --- a/Ventas/CatMetasVendedores.aspx +++ b/Ventas/CatMetasVendedores.aspx @@ -22,7 +22,7 @@ - + @@ -34,14 +34,14 @@ - + - + - - - + + + @@ -54,6 +54,16 @@ + + + + + + + + + + @@ -120,6 +130,11 @@ +
+ + + +
diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index dcc77690f..0f1e9f8f5 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -45,6 +45,10 @@ Partial Class CatMetasVendedores DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) DdlClasificacion.DataBind() DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) + + DdlClasificacionSup.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa) + DdlClasificacionSup.DataBind() + DdlClasificacionSup.Items.Insert(0, New ListItem("Todos", "-1")) End Sub Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click @@ -53,24 +57,26 @@ Partial Class CatMetasVendedores Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click - If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 Then + If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0 Then + Dim ObjVentas As New ClsVentas If BtnAgregarMetaVendedor.Text = "Agregar" Then If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, - TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero) Then + TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero) Then Alert("Se agregó la meta al vendedor") Else Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError) End If ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero, - TxtMetaCantidad.TextMode.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero) Then + TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, + DdlClasificacionSup.SelectedValue.ToEntero) Then Alert("Se actualizó la información de la meta del vendedor") Else Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError) End If End If - Else + Else Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) End If RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")) @@ -94,6 +100,7 @@ Partial Class CatMetasVendedores CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") TxtFechaI.Text = GvRow.DataKey("MesAño") + DdlClasificacionSup.SelectedValue = GvRow.DataKey("CveClasificacionSup") DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion") DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca") TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad") diff --git a/Ventas/MetasVendedores.aspx b/Ventas/MetasVendedores.aspx index b8b459039..efb1b7674 100644 --- a/Ventas/MetasVendedores.aspx +++ b/Ventas/MetasVendedores.aspx @@ -37,14 +37,16 @@ padding-right: 4px !important; padding-left: 4px !important; } - .GrupoSuperior{ - background-color:#000077; - color:white; - font-weight:bold; - } - .GrupoSuperior:hover{ - background-color:#000077; + + .GrupoSuperior { + background-color: #000077; + color: white; + font-weight: bold; } + + .GrupoSuperior:hover { + background-color: #000077; + } @@ -63,16 +65,15 @@ -
-
+
+
- "> + ">
-
Fecha del mes:
@@ -83,44 +84,12 @@
-
Sucursal:
- -
- -
-
-
- - -
- -
- - -
- -
- -
- -
-
-
- - -
- -
- -
- -
@@ -130,13 +99,37 @@
-
>
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
@@ -148,7 +141,7 @@ diff --git a/Ventas/MetasVendedores.aspx.vb b/Ventas/MetasVendedores.aspx.vb index a00223aec..41c71e9c0 100644 --- a/Ventas/MetasVendedores.aspx.vb +++ b/Ventas/MetasVendedores.aspx.vb @@ -80,16 +80,16 @@ Partial Class MetasVendedores Select Case e.Row.DataKey("Etiqueta") Case "GrupoSuperior" e.Row.CssClass = "GrupoSuperior" - e.Row.FCLabel("lblRealMes").Text = "" - e.Row.FCLabel("lblVtaMesAA").Text = "" - e.Row.FCLabel("lblObjMes").Text = "" - e.Row.FCLabel("lblRealAcumulado").Text = "" - e.Row.FCLabel("lblRealMesPorcentaje").Text = "" - e.Row.FCLabel("lblAAntAcumulado").Text = "" - e.Row.FCLabel("lblObjAcumulado").Text = "" - e.Row.FCLabel("lblVarVSAAPerc").Text = "" - e.Row.FCLabel("lblVarVSAA").Text = "" - e.Row.FCLabel("lblVarVSObjAcum").Text = "" + ' e.Row.FCLabel("lblRealMes").Text = "" + ' e.Row.FCLabel("lblVtaMesAA").Text = "" + ' e.Row.FCLabel("lblObjMes").Text = "" + ' e.Row.FCLabel("lblRealAcumulado").Text = "" + ' e.Row.FCLabel("lblRealMesPorcentaje").Text = "" + ' e.Row.FCLabel("lblAAntAcumulado").Text = "" + ' e.Row.FCLabel("lblObjAcumulado").Text = "" + ' e.Row.FCLabel("lblVarVSAAPerc").Text = "" + ' e.Row.FCLabel("lblVarVSAA").Text = "" + ' e.Row.FCLabel("lblVarVSObjAcum").Text = "" Case "Categoria" e.Row.CssClass = "Totales" Case "Clasificacion" diff --git a/Ventas/RepIngresos.aspx.vb b/Ventas/RepIngresos.aspx.vb index 467609afe..e82b64b60 100644 --- a/Ventas/RepIngresos.aspx.vb +++ b/Ventas/RepIngresos.aspx.vb @@ -144,10 +144,10 @@ Partial Class Ventas_RepIngresos Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta)) Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) - Dim FI As String = If(TxtFechaInicio.Text = "", "", $" Fecha Inicio: {TxtFechaInicio.Text}") - Dim FF As String = If(TxtFechaFin.Text = "", "", $" Fecha Fin: {TxtFechaFin.Text}") - Dim Tipo As String = If(DdlTipoDocto.SelectedValue = "-1", "", $" Tipo Docto.: {DdlTipoDocto.SelectedItem.Text}") - Dim subProy As String = If(DdlSubProyecto.SelectedValue = "-1", "", $" SubProyecto: {DdlSubProyecto.SelectedItem.Text}") + Dim FI As String = If(TxtFechaInicio.Text = "", "", $"Fecha Inicio: {TxtFechaInicio.Text} ") + Dim FF As String = If(TxtFechaFin.Text = "", "", $"Fecha Fin: {TxtFechaFin.Text} ") + Dim Tipo As String = If(DdlTipoDocto.SelectedValue = "", "", $"Tipo Docto: {DdlTipoDocto.GetSelectedText} ") + Dim subProy As String = If(DdlSubProyecto.SelectedValue = "", "", $"SubProyecto: {DdlSubProyecto.GetSelectedText} ") If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then @@ -156,7 +156,7 @@ Partial Class Ventas_RepIngresos params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("AgrupadoPor", $"{FI}{FF}{Tipo}{subProy}")) - + params.Add(New ReportParameter("FechaImpresion", DateAndTime.Now)) If Imagen.Exists Then params.Add(New ReportParameter("LogoPath", logouri)) Else