nuevo reporte de top clientes ventas

This commit is contained in:
Antonio Gonzalez
2020-04-13 19:20:53 -07:00
parent 7a9b42a1d9
commit 1b33048d5a
4 changed files with 60 additions and 8 deletions

View File

@@ -3975,7 +3975,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Compras/RepDocumentacionProveedor.aspx".ToUpper(), 1206)
PaginaDict.Add("/Compras/CatPaqueteriasGuiasTipo.aspx".ToUpper(), 753)
PaginaDict.Add("/Compras/RepEvaluacionesProveedores.aspx".ToUpper(), 754)
PaginaDict.Add("/Ventas/RepTopCientesVentas.aspx".ToUpper(), 755)
PaginaDict.Add("/Ventas/RepTopClientesVentas.aspx".ToUpper(), 755)
#End Region

View File

@@ -4432,6 +4432,24 @@ Public Class ClsVentas
End Try
Return retorno
End Function
Public Function GetRepTopClientesVentas(CveEmpresa As Integer, Mes As Integer, Año As Integer, Optional CveSubProyecto As Integer = -1) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Vta_Top20ClientesMasVendidos", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Mes", SqlDbType.Int).Value = Mes
.Add("@Año", SqlDbType.Int).Value = Año
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el top de clientes", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return retorno
End Function
#Region "Conciliación emitidas SAT"
Public Function ConciliacionemitidasSATGet(cveEmpresa As Int32) As Boolean

View File

@@ -47,24 +47,35 @@
<asp:ListItem Text="Diciembre" Value="12"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1">Mes: </label>
<label class="col-md-1">Año: </label>
<div class="col-md-2">
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlAño" DataValueField="IdAño" DataTextField="Año" runat="server" AutoPostBack="false">
<asp:DropDownList CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" ID="DdlAño" DataValueField="idAño" DataTextField="Año" runat="server" AutoPostBack="false">
</asp:DropDownList>
</div>
<label class="col-md-1 ">Grupo:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlGrupo" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:DropDownList ID="DdlSubProyecto" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
</asp:DropDownList>
</div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UppGrid" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvM" runat="server" GridLines="none" CssClass="table table-striped table-advance table-hover" Style="margin-top: 10px; text-align: center; width: 100%" ShowHeader="False" EmptyDataText="Aún no hay registros."
DataKeyNames="NombreComercial,ImporteAcumulado" AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True" ShowHeaderWhenEmpty="True">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Importe" DataField="ImporteAcumulado" ItemStyle-HorizontalAlign="Left" />
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
<script>

View File

@@ -11,7 +11,8 @@ Partial Class Ventas_RepTopClientesVentas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
CargarFiltros()
CargaDatos()
End If
End Sub
@@ -35,8 +36,30 @@ Partial Class Ventas_RepTopClientesVentas
For AñoIndex As Integer = añoActual To (añoActual - 10) Step -1
Dim row As DataRow = tablaAños.NewRow()
'row["idAño"] =
row("idAño") = AñoIndex
row("Año") = AñoIndex
tablaAños.Rows.Add(row)
Next
DdlAño.DataSource = tablaAños
DdlAño.DataBind()
DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
DdlSubProyecto.DataBind()
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaDatos()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetRepTopClientesVentas(UsuarioActual.CveEmpresa, DdlMes.SelectedValue.ToEntero, DdlAño.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero) Then
GvM.DataSource = ObjVentas.DtResultados
End If
ObjVentas.Dispose()
GvM.DataBind()
End Sub
Protected Sub BtnConsultar_Click() Handles BtnConsultar.Click
CargaDatos()
UppGrid.Update()
End Sub
End Class