Dashboard ventas
This commit is contained in:
@@ -10917,6 +10917,7 @@ Public Class ClsPaginas
|
||||
PaginaDict.Add("/Ventas/CatPSSubProyectosVendedores.aspx".ToUpper(), 787)
|
||||
PaginaDict.Add("/Ventas/CatMotivosCancelacion.aspx".ToUpper(), 788)
|
||||
PaginaDict.Add("/Ventas/CatSelectivas.aspx".ToUpper(), 897)
|
||||
PaginaDict.Add("/Ventas/DashboardVentas.aspx".ToUpper(), 789)
|
||||
|
||||
#End Region
|
||||
#Region "VIA"
|
||||
|
||||
@@ -7464,6 +7464,26 @@ Public Class ClsVentas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetDashboardVentasGet(CveEmpresa As Integer, CveSubProyecto As Integer, Agrupador As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_DashboardVentasGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@Agrupador", SqlDbType.Int).Value = Agrupador
|
||||
End With
|
||||
Try
|
||||
Dataset = New DataSet()
|
||||
SqlAdapter.Fill(Dataset)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el dashboard de ventas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
#Region "PRODUCTOS/SERVICIOS, SUBPROYECTOS Y VENDEDORES"
|
||||
|
||||
Public Function GetPSSubProyectosVendedores(CveEmpresa As Integer) As Boolean
|
||||
|
||||
352
Ventas/DashboardVentas.aspx
Normal file
352
Ventas/DashboardVentas.aspx
Normal file
@@ -0,0 +1,352 @@
|
||||
<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DashboardVentas.aspx.vb" Inherits="Ventas_DashboardVentas" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<style>
|
||||
.dataTables_scrollHead {
|
||||
background-color: #95A5A6;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#chartdiv {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Dashboard Ventas
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UpFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<asp:Label ID="LblProyecto" runat="server" class="col-md-1 truncate">Proyecto:</asp:Label>
|
||||
<div runat="server" id="DivProyecto" class="col-md-2">
|
||||
<asp:DropDownList ID="DdlProyecto" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Proyecto" DataValueField="CveProyecto" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label ID="LblSubProyecto" runat="server" class="col-md-1 truncate">SubProyecto:</asp:Label>
|
||||
<div runat="server" id="DivSubProyecto" class="col-md-2">
|
||||
<asp:DropDownList ID="DdlSubProyecto" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 ">Agrupador:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAgrupador" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-sm select2me" Width="100%">
|
||||
<asp:ListItem Text="Linea" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Cliente" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Marca" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none">
|
||||
<div class="row">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvVentas" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun dato"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Mes" HeaderText="Mes" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TotalAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAno3" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAno3Presupuesto" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="CumplimientaRealVSPPTO" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="PorcentajeUtilidad" HeaderText="% DE UTILIDAD" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="PorcentajeContado" HeaderText="% CONTADO" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="PorcentajeCredito" HeaderText="% CRÉDITO" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvVentasAcumulado" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun dato"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Mes" HeaderText="Mes" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Ano3xAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Ano3xAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Ano3xPPTO" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="DvGraficas" visible="true" runat="server">
|
||||
<div id="DvGraVentas" runat="server" class="col-md-6 col-sm-6" style="width: 100%">
|
||||
<!-- BEGIN REGIONAL STATS PORTLET-->
|
||||
<div class="portlet light ">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="icon-graph font-red-sunglo"></i>
|
||||
<span class="caption-subject font-red-sunglo bold uppercase">Grafica</span>
|
||||
</div>
|
||||
<div class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="reload" data-original-title="" title=""></a>
|
||||
<a href="javascript:;" class="remove" data-original-title="" title=""></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div id="div_ventas" runat="server" style="text-align: center;">
|
||||
<img src="/Metronic/assets/admin/layout/img/loading.gif" alt="loading" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END REGIONAL STATS PORTLET-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvVentasClasificacion" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun dato"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Agrupador" HeaderText="Linea" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TotalAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="PorcentajeVenta" HeaderText="% / T. VENTA" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAno2Presupuesto" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Ano2xAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Ano2xPPTO" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="container">
|
||||
<%--<table class="table Widthall">
|
||||
<tr>
|
||||
<td style="width: 200px;"></td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Enero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Febrero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Marzo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Abril</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Mayo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Junio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Julio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Agosto</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Septiembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Octubre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Noviembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 160px; border-right: 3px solid white;">Diciembre</td>
|
||||
</tr>
|
||||
</table>--%>
|
||||
<asp:GridView ID="GvVentasClasificacionxMes" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun dato"
|
||||
CssClass="table table-striped table-advance table-hover Widthall"
|
||||
data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Agrupador" HeaderText="Linea" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="TotalEneAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalEneAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalFebAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalFebAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalMarAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalMarAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAbrAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAbrAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalMayAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalMayAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalJunAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalJunAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalJulAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalJulAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAgoAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalAgoAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalSepAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalSepAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalOctAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalOctAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalNovAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalNovAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalDicAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="TotalDicAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container">
|
||||
<table class="table Widthall">
|
||||
<tr>
|
||||
<td style="width: 360px;"></td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Enero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Febrero</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Marzo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Abril</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Mayo</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Junio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Julio</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Agosto</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Septiembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Octubre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Noviembre</td>
|
||||
<td class="dataTables_scrollHead text-center bold" style="font-size: 14px; width: 300px; border-right: 3px solid white;">Diciembre</td>
|
||||
</tr>
|
||||
</table>
|
||||
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró ningun dato"
|
||||
CssClass="table table-striped table-advance table-hover Widthall"
|
||||
data-sort="true" Width="100%" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="Clasificacion" HeaderText="Linea" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="360px" />
|
||||
<asp:BoundField DataField="TotalEneAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="360px" />
|
||||
<asp:BoundField DataField="TotalEneAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalFebAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalFebAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalMarAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalMarAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalAbrAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalAbrAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalMayAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalMayAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalJunAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalJunAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalJulAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalJulAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalAgoAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalAgoAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalSepAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px"/>
|
||||
<asp:BoundField DataField="TotalSepAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalOctAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalOctAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalNovAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalNovAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalDicAno2" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
<asp:BoundField DataField="TotalDicAno1" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="150px" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>--%>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/pie.js"></script>
|
||||
<script src="https://www.amcharts.com/lib/3/plugins/export/export.min.js"></script>
|
||||
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
|
||||
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
function CargaGrafica(data) {
|
||||
|
||||
var chart = AmCharts.makeChart("chartdiv", {
|
||||
"type": "serial",
|
||||
"theme": "light",
|
||||
"dataLoader": {
|
||||
"url": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/t-160/SO-58530378.json",
|
||||
"format": "json",
|
||||
"complete": function (chart) {
|
||||
//get potential valueFields after filtering out the categoryField
|
||||
var valueFields = Object.keys(chart.dataProvider[0]).filter(function (value) {
|
||||
return value !== chart.categoryField;
|
||||
})
|
||||
//create the graphs
|
||||
valueFields.forEach(function (valueField) {
|
||||
chart.graphs.push({
|
||||
"valueField": valueField,
|
||||
"title": valueField,
|
||||
"type": "line",
|
||||
"balloonText": "[[category]]: <b>[[value]]</b>",
|
||||
"lineAlphas": 0.2
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
"valueAxes": [{
|
||||
"gridColor": "#FFFFFF",
|
||||
"gridAlpha": 0.2,
|
||||
"dashLength": 0
|
||||
}],
|
||||
"gridAboveGraphs": true,
|
||||
"startDuration": 1,
|
||||
"graphs": [],
|
||||
"chartCursor": {
|
||||
"categoryBalloonEnabled": false,
|
||||
"cursorAlpha": 0,
|
||||
"zoomable": false
|
||||
},
|
||||
"categoryField": "Mes",
|
||||
"categoryAxis": {
|
||||
"gridPosition": "start",
|
||||
"gridAlpha": 0
|
||||
},
|
||||
"legend": {},
|
||||
"export": {
|
||||
"enabled": true
|
||||
},
|
||||
"menu": [{
|
||||
"class": "export-main",
|
||||
"menu": ["PNG", "JPG", "CSV"]
|
||||
}]
|
||||
});
|
||||
|
||||
//var chart = AmCharts.makeChart("chartdiv", {
|
||||
// "type": "serial",
|
||||
// "theme": "light",
|
||||
// "dataProvider": data,
|
||||
// "startDuration": 2,
|
||||
// "valueAxes": [{
|
||||
// "position": "left",
|
||||
// "title": "Ventas"
|
||||
// }],
|
||||
// "graphs": [{
|
||||
// "balloonText": "[[category]]: <b>[[value]]</b>",
|
||||
// "colorField": "Color",
|
||||
// "fillAlphas": 1,
|
||||
// "lineAlpha": 0.1,
|
||||
// "type": "line",
|
||||
// "valueField": "Valor"
|
||||
// }],
|
||||
// "depth3D": 20,
|
||||
// "angle": 30,
|
||||
// "chartCursor": {
|
||||
// "categoryBalloonEnabled": false,
|
||||
// "cursorAlpha": 0,
|
||||
// "zoomable": false
|
||||
// },
|
||||
// "categoryField": "Texto",
|
||||
// "categoryAxis": {
|
||||
// "gridPosition": "start",
|
||||
// "labelRotation": 90
|
||||
// },
|
||||
// "export": {
|
||||
// "enabled": true
|
||||
// }
|
||||
//});
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
253
Ventas/DashboardVentas.aspx.vb
Normal file
253
Ventas/DashboardVentas.aspx.vb
Normal file
@@ -0,0 +1,253 @@
|
||||
|
||||
Imports System.Activities.Statements
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Ventas_DashboardVentas
|
||||
Inherits ClsPaginas
|
||||
|
||||
Private Property DtVentasClasificacion As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtVentasClasificacion"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentasClasificacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtVentas As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtVentas"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentas") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtVentasClasificacionxMes As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtVentasClasificacionxMes"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentasClasificacionxMes") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtVentasGrafica As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtVentasGrafica"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtVentasGrafica") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
CargaCombos()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
CargarCentrosDeCosto(DdlProyecto, DdlSubProyecto, LblProyecto, LblSubProyecto, divProyecto:=DivProyecto, AplicaTodos:="Seleccione")
|
||||
DdlSubProyecto.Items(0).Text = "Seleccione"
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
UpDatos.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaDatos()
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetDashboardVentasGet(UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, DdlAgrupador.SelectedValue.ToEntero) Then
|
||||
Dim DsDatos = ObjVentas.DataSetResultados.Copy()
|
||||
If DsDatos IsNot Nothing Then
|
||||
'DESGLOSE
|
||||
DtVentasClasificacion = DsDatos.Tables(0)
|
||||
DtVentas = DsDatos.Tables(1)
|
||||
DtVentasClasificacionxMes = DsDatos.Tables(2)
|
||||
DtVentasGrafica = DsDatos.Tables(3)
|
||||
|
||||
DtVentasClasificacion.Columns.Add("PorcentajeVenta", GetType(Decimal))
|
||||
DtVentasClasificacion.Columns.Add("Ano2xAno1", GetType(Decimal))
|
||||
DtVentasClasificacion.Columns.Add("Ano2xPPTO", GetType(Decimal))
|
||||
|
||||
DtVentas.Columns.Add("Ano3xAno1", GetType(Decimal))
|
||||
DtVentas.Columns.Add("Ano3xAno2", GetType(Decimal))
|
||||
DtVentas.Columns.Add("CumplimientaRealVSPPTO", GetType(Decimal))
|
||||
DtVentas.Columns.Add("Ano3xPPTO", GetType(Decimal))
|
||||
|
||||
Dim AcumuladoAno1 As Decimal = 0
|
||||
Dim AcumuladoAno2 As Decimal = 0
|
||||
Dim AcumuladoAno3 As Decimal = 0
|
||||
Dim AcumuladoPPTO As Decimal = 0
|
||||
For Each Row As DataRow In DtVentas.Rows
|
||||
AcumuladoAno1 += Row("TotalAno1").ToString().ToDecimal()
|
||||
AcumuladoAno2 += Row("TotalAno2").ToString().ToDecimal()
|
||||
AcumuladoAno3 += Row("TotalAno3").ToString().ToDecimal()
|
||||
AcumuladoPPTO += Row("TotalAno3Presupuesto").ToString().ToDecimal()
|
||||
|
||||
Row("Ano3xAno1") = (AcumuladoAno3 / AcumuladoAno1) - 1
|
||||
Row("Ano3xAno2") = (AcumuladoAno3 / AcumuladoAno2) - 1
|
||||
|
||||
Row("CumplimientaRealVSPPTO") = (Row("TotalAno3").ToString().ToDecimal() * 100) / Row("TotalAno3Presupuesto").ToString().ToDecimal() / 100
|
||||
|
||||
Row("Ano3xPPTO") = (AcumuladoAno3 / AcumuladoPPTO) - 1
|
||||
Next
|
||||
|
||||
For Each Row As DataRow In DtVentasClasificacion.Rows
|
||||
Row("Ano2xAno1") = If(Row("TotalAno1").ToString().ToDecimal() = 0, 0, (Row("TotalAno2").ToString().ToDecimal() - Row("TotalAno1").ToString().ToDecimal()) / Row("TotalAno1").ToString().ToDecimal())
|
||||
|
||||
Row("Ano2xPPTO") = (Row("TotalAno2").ToString().ToDecimal() - Row("TotalAno2Presupuesto").ToString().ToDecimal()) / Row("TotalAno2Presupuesto").ToString().ToDecimal()
|
||||
|
||||
Row("PorcentajeVenta") = If(DtVentasClasificacion.SUMD("TotalAno2") = 0, 0, Row("TotalAno2").ToString().ToDecimal() / DtVentasClasificacion.SUMD("TotalAno2"))
|
||||
Next
|
||||
|
||||
GvVentasClasificacion.DataSource = DtVentasClasificacion
|
||||
GvVentas.DataSource = DtVentas
|
||||
GvVentasClasificacionxMes.DataSource = DtVentasClasificacionxMes
|
||||
GvVentasAcumulado.DataSource = DtVentas
|
||||
End If
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
GvVentasClasificacion.Columns(1).HeaderText = Now.Year.ToString()
|
||||
GvVentasClasificacion.Columns(2).HeaderText = (Now.Year - 1).ToString()
|
||||
GvVentasClasificacion.Columns(4).HeaderText = $"PRESUPUESTO {Now.Year}"
|
||||
GvVentasClasificacion.Columns(5).HeaderText = $"{Now.Year} VS {Now.Year - 1}"
|
||||
GvVentasClasificacion.Columns(6).HeaderText = $"{Now.Year} VS PPTO"
|
||||
|
||||
GvVentasClasificacionxMes.Columns(1).HeaderText = $"{Now.Year}-Enero"
|
||||
GvVentasClasificacionxMes.Columns(2).HeaderText = $"{(Now.Year - 1)}-Enero"
|
||||
GvVentasClasificacionxMes.Columns(3).HeaderText = $"{Now.Year}-Febrero"
|
||||
GvVentasClasificacionxMes.Columns(4).HeaderText = $"{(Now.Year - 1)}-Febrero"
|
||||
GvVentasClasificacionxMes.Columns(5).HeaderText = $"{Now.Year}-Marzo"
|
||||
GvVentasClasificacionxMes.Columns(6).HeaderText = $"{(Now.Year - 1)}-Marzo"
|
||||
GvVentasClasificacionxMes.Columns(7).HeaderText = $"{Now.Year}-Abril"
|
||||
GvVentasClasificacionxMes.Columns(8).HeaderText = $"{(Now.Year - 1)}-Abril"
|
||||
GvVentasClasificacionxMes.Columns(9).HeaderText = $"{Now.Year}-Mayo"
|
||||
GvVentasClasificacionxMes.Columns(10).HeaderText = $"{(Now.Year - 1)}-Mayo"
|
||||
GvVentasClasificacionxMes.Columns(11).HeaderText = $"{Now.Year}-Junio"
|
||||
GvVentasClasificacionxMes.Columns(12).HeaderText = $"{(Now.Year - 1)}-Junio"
|
||||
GvVentasClasificacionxMes.Columns(13).HeaderText = $"{Now.Year}-Julio"
|
||||
GvVentasClasificacionxMes.Columns(14).HeaderText = $"{(Now.Year - 1)}-Julio"
|
||||
GvVentasClasificacionxMes.Columns(15).HeaderText = $"{Now.Year}-Agosto"
|
||||
GvVentasClasificacionxMes.Columns(16).HeaderText = $"{(Now.Year - 1)}-Agosto"
|
||||
GvVentasClasificacionxMes.Columns(17).HeaderText = $"{Now.Year}-Septiembre"
|
||||
GvVentasClasificacionxMes.Columns(18).HeaderText = $"{(Now.Year - 1)}-Septiembre"
|
||||
GvVentasClasificacionxMes.Columns(19).HeaderText = $"{Now.Year}-Octubre"
|
||||
GvVentasClasificacionxMes.Columns(20).HeaderText = $"{(Now.Year - 1)}-Octubre"
|
||||
GvVentasClasificacionxMes.Columns(21).HeaderText = $"{Now.Year}-Noviembre"
|
||||
GvVentasClasificacionxMes.Columns(22).HeaderText = $"{(Now.Year - 1)}-Noviembre"
|
||||
GvVentasClasificacionxMes.Columns(23).HeaderText = $"{Now.Year}-Diciembre"
|
||||
GvVentasClasificacionxMes.Columns(24).HeaderText = $"{(Now.Year - 1)}-Diciembre"
|
||||
|
||||
'GvVentasClasificacionxMes.Columns(1).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(2).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(3).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(4).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(5).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(6).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(7).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(8).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(9).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(10).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(11).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(12).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(13).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(14).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(15).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(16).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(17).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(18).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(19).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(20).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(21).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(22).HeaderText = $"{(Now.Year - 1)}"
|
||||
'GvVentasClasificacionxMes.Columns(23).HeaderText = $"{Now.Year}"
|
||||
'GvVentasClasificacionxMes.Columns(24).HeaderText = $"{(Now.Year - 1)}"
|
||||
|
||||
GvVentas.Columns(1).HeaderText = (Now.Year - 2).ToString()
|
||||
GvVentas.Columns(2).HeaderText = (Now.Year - 1).ToString()
|
||||
GvVentas.Columns(3).HeaderText = Now.Year.ToString()
|
||||
GvVentas.Columns(4).HeaderText = $"PRESUPUESTO {Now.Year}"
|
||||
GvVentas.Columns(5).HeaderText = $"CUMPLIMIENTO REAL VS PPTO {Now.Year}"
|
||||
|
||||
GvVentasAcumulado.Columns(1).HeaderText = $"{Now.Year} VS {Now.Year - 2}"
|
||||
GvVentasAcumulado.Columns(2).HeaderText = $"{Now.Year} VS {Now.Year - 1}"
|
||||
GvVentasAcumulado.Columns(3).HeaderText = $"{Now.Year} VS PPTO"
|
||||
|
||||
GvVentasClasificacion.DataBind()
|
||||
GvVentas.DataBind()
|
||||
GvVentasClasificacionxMes.DataBind()
|
||||
GvVentasAcumulado.DataBind()
|
||||
|
||||
CargaGraficas(DtVentasGrafica)
|
||||
|
||||
'Dim Ano3 = DateTime.Now.Year.ToString()
|
||||
'Dim Ano2 = (DateTime.Now.Year - 1).ToString()
|
||||
'Dim Ano1 = (DateTime.Now.Year - 2).ToString()
|
||||
|
||||
'Dim Dt As New DataTable()
|
||||
'Dt.Columns.Add("Mes")
|
||||
'Dt.Columns.Add(DateTime.Now.Year.ToString())
|
||||
'Dt.Columns.Add((DateTime.Now.Year - 1).ToString())
|
||||
'Dt.Columns.Add((DateTime.Now.Year - 2).ToString())
|
||||
'Dt.Columns.Add("Presupuesto")
|
||||
|
||||
'For Each Dr As DataRow In DtVentas.Rows
|
||||
' Dim Row As DataRow = Dt.NewRow()
|
||||
' Row("Mes") = Dr("Mes").ToString()
|
||||
' Row(DateTime.Now.Year.ToString()) = Dr("TotalAno3").ToString().FormatoNumero
|
||||
' Row((DateTime.Now.Year - 1).ToString()) = Dr("TotalAno2").ToString().FormatoNumero
|
||||
' Row((DateTime.Now.Year - 2).ToString()) = Dr("TotalAno1").ToString().FormatoNumero
|
||||
' Row("Presupuesto") = Dr("TotalAno3Presupuesto").ToString().FormatoNumero
|
||||
' Dt.Rows.Add(Row)
|
||||
'Next
|
||||
|
||||
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(Dt)
|
||||
|
||||
'RegistraScript($"CargaGrafica({json});console.log({json})", "22")
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaGraficas(ByVal DtVentas As DataTable)
|
||||
MuestraGrafica(div_ventas, DtVentas, "Ano", "Total", "", "", "gh2", "")
|
||||
End Sub
|
||||
|
||||
Private Sub MuestraGrafica(ByVal divcontainer As HtmlGenericControl, ByVal DTDatos As DataTable, ByVal ColTitle As String, ByVal ColValue As String, ByVal Titulo As String, ByVal SubTitulo As String, ByVal Optional Indicador As String = "gh", ByVal Optional XReferencia As String = "", ByVal Optional YReferencia As String = "")
|
||||
Dim Info As String = ""
|
||||
Dim SBJSScript As StringBuilder = New StringBuilder()
|
||||
|
||||
If DTDatos.Rows.Count > 0 Then
|
||||
|
||||
'For Each DbRow As DataRow In DTDatos.Rows
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno1"), DbRow(ColTitle), Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno2"), DbRow(ColTitle), Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno3"), DbRow(ColTitle), Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno3Presupuesto"), DbRow(ColTitle), Info)
|
||||
'Next
|
||||
|
||||
'For Each DbRow As DataRow In DTDatos.Rows
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno1"), DateTime.Now.Year - 2, Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno2"), DateTime.Now.Year - 1, Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno3"), DateTime.Now.Year, Info)
|
||||
' Info = String.Format("{2}['{1}',{0}],", DbRow("TotalAno3Presupuesto"), $"PRESUPUESTO {Now.Year}", Info)
|
||||
'Next
|
||||
|
||||
For Each DbRow As DataRow In DTDatos.Rows
|
||||
Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info)
|
||||
Next
|
||||
|
||||
If Info.Length > 0 Then
|
||||
'Info = Info.Remove(Info.Length - 1, 1)
|
||||
SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia)
|
||||
End If
|
||||
Else
|
||||
SBJSScript.AppendFormat("graficahighcharts('{0}','{1}','{2}','{3}',[{4}],1,'{5}');", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, " ", XReferencia)
|
||||
End If
|
||||
|
||||
RegistraScript(SBJSScript.ToString(), Indicador)
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user