-- activación SMS indicadores
This commit is contained in:
377
Inicio.aspx
377
Inicio.aspx
@@ -1,8 +1,12 @@
|
||||
<%@ Page Title="Sistema de Información Gerencial" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Inicio.aspx.vb" Inherits="Inicio" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="Css" runat="Server">
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
@import url("https://code.highcharts.com/css/highcharts.css");
|
||||
@import url("https://code.highcharts.com/dashboards/css/datagrid.css");
|
||||
@import url("https://code.highcharts.com/dashboards/css/dashboards.css");
|
||||
.unoaunoold {
|
||||
color: #999b9b;
|
||||
font-size: 11px;
|
||||
@@ -118,6 +122,359 @@
|
||||
.select2-container--open {
|
||||
z-index: 1000 !important;
|
||||
}
|
||||
|
||||
|
||||
//#region highcharts
|
||||
.highcharts-figure,
|
||||
.highcharts-data-table table {
|
||||
min-width: 310px;
|
||||
max-width: 800px;
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
#container {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.highcharts-data-table table {
|
||||
font-family: Verdana, sans-serif;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 10px auto;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.highcharts-data-table caption {
|
||||
padding: 1em 0;
|
||||
font-size: 1.2em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.highcharts-data-table th {
|
||||
font-weight: 600;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.highcharts-data-table td,
|
||||
.highcharts-data-table th,
|
||||
.highcharts-data-table caption {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.highcharts-data-table thead tr,
|
||||
.highcharts-data-table tr:nth-child(even) {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.highcharts-data-table tr:hover {
|
||||
background: #f1f7ff;
|
||||
}
|
||||
|
||||
.highcharts-description {
|
||||
margin: 0.3rem 10px;
|
||||
}
|
||||
h1#title {
|
||||
padding-top: 10px;
|
||||
margin: 0;
|
||||
background-color: #3d3d3d;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-title::before,
|
||||
#kpi-iron .highcharts-dashboards-component-title::before {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 28px;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
margin-right: 4px;
|
||||
background-color: var(--highcharts-color-0);
|
||||
content: " ";
|
||||
}
|
||||
|
||||
#kpi-iron .highcharts-dashboards-component-title::before {
|
||||
background-color: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-subtitle,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-subtitle {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2em;
|
||||
color: var(--highcharts-neutral-color-60);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value {
|
||||
font-size: 4em;
|
||||
line-height: 2.4rem;
|
||||
margin-top: 10px;
|
||||
color: var(--highcharts-color-0);
|
||||
}
|
||||
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value {
|
||||
color: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#dashboard-col-1 .highcharts-color-0 {
|
||||
fill: var(--highcharts-color-2);
|
||||
stroke: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value::after,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value::after {
|
||||
content: "";
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.highcharts-plot-line {
|
||||
stroke-dasharray: 2px;
|
||||
stroke: var(--highcharts-color-3);
|
||||
}
|
||||
|
||||
.highcharts-plot-line-label {
|
||||
fill: var(--highcharts-color-3);
|
||||
}
|
||||
|
||||
.highcharts-description {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 100%;
|
||||
height: 205px;
|
||||
}
|
||||
|
||||
/* LARGE */
|
||||
@media (max-width: 1200px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 35%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 30%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* MEDIUM */
|
||||
@media (max-width: 992px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* SMALL */
|
||||
@media (max-width: 576px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
}
|
||||
.highcharts-figure,
|
||||
.highcharts-data-table table {
|
||||
min-width: 310px;
|
||||
max-width: 800px;
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
#container {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.highcharts-data-table table {
|
||||
font-family: Verdana, sans-serif;
|
||||
border-collapse: collapse;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 10px auto;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.highcharts-data-table caption {
|
||||
padding: 1em 0;
|
||||
font-size: 1.2em;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.highcharts-data-table th {
|
||||
font-weight: 600;
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.highcharts-data-table td,
|
||||
.highcharts-data-table th,
|
||||
.highcharts-data-table caption {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.highcharts-data-table thead tr,
|
||||
.highcharts-data-table tr:nth-child(even) {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.highcharts-data-table tr:hover {
|
||||
background: #f1f7ff;
|
||||
}
|
||||
|
||||
.highcharts-description {
|
||||
margin: 0.3rem 10px;
|
||||
}
|
||||
h1#title {
|
||||
padding-top: 10px;
|
||||
margin: 0;
|
||||
background-color: #3d3d3d;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-title::before,
|
||||
#kpi-iron .highcharts-dashboards-component-title::before {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 28px;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
margin-right: 4px;
|
||||
background-color: var(--highcharts-color-0);
|
||||
content: " ";
|
||||
}
|
||||
|
||||
#kpi-iron .highcharts-dashboards-component-title::before {
|
||||
background-color: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-subtitle,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-subtitle {
|
||||
margin-top: 10px;
|
||||
font-size: 1.2em;
|
||||
color: var(--highcharts-neutral-color-60);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value {
|
||||
font-size: 4em;
|
||||
line-height: 2.4rem;
|
||||
margin-top: 10px;
|
||||
color: var(--highcharts-color-0);
|
||||
}
|
||||
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value {
|
||||
color: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#dashboard-col-1 .highcharts-color-0 {
|
||||
fill: var(--highcharts-color-2);
|
||||
stroke: var(--highcharts-color-2);
|
||||
}
|
||||
|
||||
#kpi-vitamin-a .highcharts-dashboards-component-kpi-value::after,
|
||||
#kpi-iron .highcharts-dashboards-component-kpi-value::after {
|
||||
content: "";
|
||||
display: block;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.highcharts-plot-line {
|
||||
stroke-dasharray: 2px;
|
||||
stroke: var(--highcharts-color-3);
|
||||
}
|
||||
|
||||
.highcharts-plot-line-label {
|
||||
fill: var(--highcharts-color-3);
|
||||
}
|
||||
|
||||
.highcharts-description {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 100%;
|
||||
height: 205px;
|
||||
}
|
||||
|
||||
/* LARGE */
|
||||
@media (max-width: 1200px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 35%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 30%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* MEDIUM */
|
||||
@media (max-width: 992px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* SMALL */
|
||||
@media (max-width: 576px) {
|
||||
#dashboard-col-0,
|
||||
#dashboard-col-1 {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-wrapper {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
#kpi-vitamin-a,
|
||||
#kpi-iron {
|
||||
flex: 1 1 50%;
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -140,13 +497,7 @@
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="UPPIndicador" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<div style="background-color: #F9F9F9;">
|
||||
@@ -175,6 +526,11 @@
|
||||
<div class="row " id="DivIndicadores" runat="server" visible="False">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row" runat="server" id="divsms1">
|
||||
<div class="row" >
|
||||
<div id="divsmsdash" />
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<asp:UpdatePanel ID="UPComunicado" UpdateMode="Conditional" runat="server">
|
||||
@@ -1617,7 +1973,12 @@
|
||||
|
||||
<%--<script src="/Metronic/assets/admin/pages/scripts/index.js" type="text/javascript"></script>--%>
|
||||
<script src="/Metronic/assets/global/plugins/jquery.pulsate.min.js"></script>
|
||||
|
||||
|
||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="https://code.highcharts.com/dashboards/datagrid.js"></script>
|
||||
<script src="https://code.highcharts.com/dashboards/dashboards.js"></script>
|
||||
<script src="https://code.highcharts.com/dashboards/modules/layout.js"></script>
|
||||
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function pageLoad() {
|
||||
|
||||
555
Inicio.aspx.vb
555
Inicio.aspx.vb
@@ -191,6 +191,9 @@ Partial Class Inicio
|
||||
If UsuarioActual.TienePermisoProceso(343) Then MuestraPsProximosAVencer()
|
||||
If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
CargaKPICirugias()
|
||||
End If
|
||||
|
||||
If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then
|
||||
CargaGraficas()
|
||||
@@ -544,6 +547,7 @@ Partial Class Inicio
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CargaTareas()
|
||||
Dim ObjProspectos As New ClsOIEventos
|
||||
|
||||
@@ -1606,4 +1610,555 @@ Partial Class Inicio
|
||||
|
||||
UpOpcionesAgenda.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "S M S - I N D I C A D O R E S"
|
||||
Private Sub CargaKPICirugias()
|
||||
|
||||
DivIndicadores.InnerHtml = ""
|
||||
Dim Opcion As Integer = 1
|
||||
Dim dtIndicadores As DataTable = Nothing
|
||||
Dim dtRH As DataTable = Nothing
|
||||
|
||||
Dim Gral As New ClsVentas
|
||||
Dim ds As DataSet = Nothing
|
||||
|
||||
If UsuarioActual.CveRol = 1577 Then
|
||||
Opcion = 1 'vendedor
|
||||
ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573
|
||||
Opcion = 2 'gerente ventas
|
||||
End If
|
||||
|
||||
If Gral.GetSMSIndicadores(Opcion, "2025/03/01".ToDate, "2025/03/31".ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ds = Gral.DataSetResultados
|
||||
End If
|
||||
'0-ventas totales, 1-comisiones totales, 2-medicos sin consumo, 3-top10medicos, 4-top5marcas, 5-num pacientes
|
||||
|
||||
Dim StrTexto As New StringBuilder
|
||||
Dim StrSource As New StringBuilder
|
||||
Dim ComisionVendedor, ComisionTecnico, VentasTotales As Decimal
|
||||
Dim TextoKPIVendedores As String
|
||||
Dim dtt As DataTable
|
||||
|
||||
If Opcion = 1 Then
|
||||
|
||||
#Region "VENDEDORES"
|
||||
|
||||
dtt = ds.Tables(0)
|
||||
If dtt IsNot Nothing Then
|
||||
VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal
|
||||
End If
|
||||
dtt = ds.Tables(1)
|
||||
If dtt IsNot Nothing Then
|
||||
ComisionVendedor = dtt.FiltroPrimeroValor("ComisionVendedor").ToDecimal
|
||||
ComisionTecnico = dtt.FiltroPrimeroValor("ComisionTecnico").ToDecimal
|
||||
End If
|
||||
|
||||
dtt = ds.Tables(2)
|
||||
'médicos sin consumo
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dtt.Rows
|
||||
StrTexto.AppendFormat("['{0}'],", dr("NombreMedico"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append("{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
|
||||
End If
|
||||
'top 10 medicos
|
||||
dtt = ds.Tables(3)
|
||||
StrTexto.Clear()
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
'top 5 marcas
|
||||
dtt = ds.Tables(4)
|
||||
StrTexto.Clear()
|
||||
'top 5 marcas
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}],", dr("Marca"), dr("Importe"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true);
|
||||
|
||||
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
|
||||
enabled: false,
|
||||
contextMenu: { enabled: true }
|
||||
},
|
||||
gui: {
|
||||
layouts: [{
|
||||
rows: [{
|
||||
cells: [{
|
||||
id: 'kpi-wrapper',
|
||||
layout: {
|
||||
rows: [{
|
||||
cells: [{
|
||||
id: 'kpi-vitamin-a'
|
||||
}, {
|
||||
id: 'kpi-iron'
|
||||
}, {
|
||||
id: 'kpi-iron2'
|
||||
}, {
|
||||
id: 'kpi-iron3'
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
id: 'dashboard-col-0'
|
||||
}, {
|
||||
id: 'dashboard-col-1'
|
||||
}]
|
||||
}, {
|
||||
cells: [{
|
||||
id: 'dashboard-col-2'
|
||||
}, {
|
||||
id: 'dashboard-col-3'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
},
|
||||
components: [{
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-vitamin-a',
|
||||
value: " & VentasTotales & ",
|
||||
valueFormat: '{value:,.2f}',
|
||||
title: 'Ventas Totales',
|
||||
subtitle: '-'
|
||||
}, {
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-iron',
|
||||
value: " & ComisionVendedor & ",
|
||||
title: 'Comisión',
|
||||
valueFormat: '{value:,.2f}',
|
||||
subtitle: '-'
|
||||
}, {
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-iron2',
|
||||
value: " & ComisionTecnico & ",
|
||||
title: '$ Técnico',
|
||||
valueFormat: '{value:,.2f}',
|
||||
subtitle: '-'
|
||||
},{
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-iron3',
|
||||
value: 18,
|
||||
title: 'Personas',
|
||||
valueFormat: '{value}',
|
||||
subtitle: '-'
|
||||
},{
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dtmedtop10',
|
||||
columnAssignment: [{
|
||||
seriesId: 'Top 10 Médicos',
|
||||
data: ['Medico', 'Importe']
|
||||
}]
|
||||
},
|
||||
renderTo: 'dashboard-col-0',
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: '-' }
|
||||
},
|
||||
yAxis: {
|
||||
title: { text: ' ' }
|
||||
},
|
||||
credits: { enabled: false },
|
||||
plotOptions: {
|
||||
series: { marker: { radius: 6 } }
|
||||
},
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false,
|
||||
type: 'bar',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
title: { text: '' },
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: { chartContainerLabel: '' } }
|
||||
}
|
||||
}, {
|
||||
renderTo: 'dashboard-col-1',
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dttop5marcas',
|
||||
columnAssignment: [{
|
||||
seriesId: 'Top 5 Marcas',
|
||||
data: ['Marca', 'Importe']
|
||||
}]
|
||||
},
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: 'Groceries' }
|
||||
},
|
||||
yAxis: { title: { text: '' } },
|
||||
credits: { enabled: false },
|
||||
title: { text: '' },
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false, type: 'bar',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: {
|
||||
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
renderTo: 'dashboard-col-2',
|
||||
connector: {
|
||||
id: 'dtmedsinconsumo'
|
||||
},
|
||||
type: 'DataGrid',
|
||||
sync: {
|
||||
highlight: true,
|
||||
visibility: true
|
||||
},
|
||||
dataGridOptions: {
|
||||
caption: {
|
||||
text: 'Médicos sin consumo en +30d',
|
||||
style: {
|
||||
fontSize: '14px',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},style: {
|
||||
maxHeight: '250px',
|
||||
overflowY: 'auto'
|
||||
},
|
||||
credits: { enabled: false }
|
||||
}
|
||||
}]
|
||||
}, true); "
|
||||
#End Region
|
||||
|
||||
Else
|
||||
#Region "GERENTE"
|
||||
|
||||
dtt = ds.Tables(0)
|
||||
If dtt IsNot Nothing Then
|
||||
VentasTotales = dtt.FiltroPrimeroValor("Importe").ToDecimal
|
||||
End If
|
||||
dtt = ds.Tables(1)
|
||||
StrTexto.Clear()
|
||||
'ventas por mes
|
||||
If dtt IsNot Nothing Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("AnioAnterior > 0 or AnioActual > 0", "MesNum").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}, {2}],", dr("Mes"), dr("AnioAnterior"), dr("AnioActual"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append("{id:'dtmesxmes',type:'JSON',options:{firstRowAsNames:false,columnNames:['Mes','Anterior','Actual'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
|
||||
dtt = ds.Tables(2)
|
||||
StrTexto.Clear()
|
||||
'médicos sin consumo
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In dtt.Rows
|
||||
StrTexto.AppendFormat("['{0}','{1}'],", dr("NombreMedico"), dr("Vendedor"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dtmedsinconsumo',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Vendedor'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
'vendedores
|
||||
dtt = ds.Tables(3)
|
||||
StrTexto.Clear()
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}],", dr("Vendedor"), dr("Importe"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dtvendedores',type:'JSON',options:{firstRowAsNames:false,columnNames:['Vendedor','Importe'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
'top 10 medicos
|
||||
dtt = ds.Tables(4)
|
||||
StrTexto.Clear()
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}],", dr("Medico"), dr("Importe"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dtmedtop10',type:'JSON',options:{firstRowAsNames:false,columnNames:['Medico','Importe'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
End If
|
||||
'top 5 marcas
|
||||
dtt = ds.Tables(5)
|
||||
StrTexto.Clear()
|
||||
'top 5 marcas
|
||||
If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
|
||||
For Each dr As DataRow In dtt.FiltraParametros("Importe > 0").Rows
|
||||
StrTexto.AppendFormat("['{0}',{1}],", dr("Marca"), dr("Importe"))
|
||||
Next
|
||||
StrTexto.Length -= 1
|
||||
StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe'],data:[")
|
||||
StrSource.Append(StrTexto.ToString)
|
||||
StrSource.Append("]}}")
|
||||
|
||||
End If
|
||||
'Dim TextoKPIVendedores As String = "Highcharts.setOptions({chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[{id:'micro-element',type:'JSON',options:{firstRowAsNames:false,columnNames:['Food','Vitamin A','Iron'],data:[['Beef Liver',6421,6.5],['Lamb Liver',2122,6.5],['Cod Liver Oil',1350,0.9],['Mackerel',388,1],['Tuna',214,0.6]]}}]},editMode:{enabled:true,contextMenu:{enabled:true}},components:[{type:'KPI',renderTo:'kpi-vitamin-a',value:900,valueFormat:'{value}',title:'Vitamin A',subtitle:'daily recommended dose'},{type:'KPI',renderTo:'kpi-iron',value:8,title:'Iron',valueFormat:'{value}',subtitle:'daily recommended dose'},{sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Vitamin A',data:['Food','Vitamin A']}]},renderTo:'dashboard-col-0',type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},plotLines:[{value:900,zIndex:7,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},title:{text:''},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Vitamin A in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Vitamin A amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 900 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-1',sync:{visibility:true,highlight:true,extremes:true},connector:{id:'micro-element',columnAssignment:[{seriesId:'Iron',data:['Food','Iron']}]},type:'Highcharts',chartOptions:{xAxis:{type:'category',accessibility:{description:'Groceries'}},yAxis:{title:{text:'mcg'},max:8,plotLines:[{value:8,dashStyle:'shortDash',label:{text:'RDA',align:'right',style:{color:'#B73C28'}}}]},credits:{enabled:false},plotOptions:{series:{marker:{radius:6}}},title:{text:''},legend:{enabled:true,verticalAlign:'top'},chart:{animation:false,type:'column',spacing:[30,30,30,20]},tooltip:{valueSuffix:' mcg',stickOnContact:true},lang:{accessibility:{chartContainerLabel:'Iron in food. Highcharts Interactive Chart.'}},accessibility:{description:'The chart is displaying the Iron amount in micrograms for some groceries. There is a plotLine demonstrating the daily Recommended Dietary Allowance (RDA) of 8 micrograms.',point:{valueSuffix:' mcg'}}}},{renderTo:'dashboard-col-2',connector:{id:'micro-element'},type:'DataGrid',sync:{highlight:true,visibility:true},dataGridOptions:{credits:{enabled:false}}}]},true);
|
||||
|
||||
TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: {
|
||||
enabled: false,
|
||||
contextMenu: { enabled: true }
|
||||
},
|
||||
gui: {
|
||||
layouts: [{
|
||||
rows: [{
|
||||
cells: [{
|
||||
id: 'kpi-wrapper',
|
||||
layout: {
|
||||
rows: [{
|
||||
cells: [{
|
||||
id: 'kpi-vitamin-a'
|
||||
},{
|
||||
id: 'kpi-iron3'
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
id: 'dashboard-col-0'
|
||||
}, {
|
||||
id: 'dashboard-col-1'
|
||||
}]
|
||||
}, {
|
||||
cells: [{
|
||||
id: 'dashboard-col-3'
|
||||
},
|
||||
{
|
||||
id: 'dashboard-col-4'
|
||||
},
|
||||
{
|
||||
id: 'dashboard-col-2'
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
},
|
||||
components: [{
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-vitamin-a',
|
||||
value: " & VentasTotales & ",
|
||||
valueFormat: '{value:,.2f}',
|
||||
title: 'Ventas Totales',
|
||||
subtitle: '-'
|
||||
},{
|
||||
type: 'KPI',
|
||||
renderTo: 'kpi-iron3',
|
||||
value: 18,
|
||||
title: 'Personas',
|
||||
valueFormat: '{value}',
|
||||
subtitle: '-'
|
||||
},{
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dtmedtop10',
|
||||
columnAssignment: [{
|
||||
seriesId: 'Top 10 Médicos',
|
||||
data: ['Medico', 'Importe']
|
||||
}]
|
||||
},
|
||||
renderTo: 'dashboard-col-0',
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: '-' }
|
||||
},
|
||||
yAxis: {
|
||||
title: { text: ' ' }
|
||||
},
|
||||
credits: { enabled: false },
|
||||
plotOptions: {
|
||||
series: { marker: { radius: 6 } }
|
||||
},
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false,
|
||||
type: 'bar',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
title: { text: '' },
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: { chartContainerLabel: '' } }
|
||||
}
|
||||
}, {
|
||||
renderTo: 'dashboard-col-1',
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dttop5marcas',
|
||||
columnAssignment: [{
|
||||
seriesId: 'Top 5 Marcas',
|
||||
data: ['Marca', 'Importe']
|
||||
}]
|
||||
},
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: 'Groceries' }
|
||||
},
|
||||
yAxis: { title: { text: '' } },
|
||||
credits: { enabled: false },
|
||||
title: { text: '' },
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false, type: 'bar',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: {
|
||||
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
renderTo: 'dashboard-col-3',
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dtvendedores',
|
||||
columnAssignment: [{
|
||||
seriesId: 'Vendedores',
|
||||
data: ['Vendedor', 'Importe']
|
||||
}]
|
||||
},
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: 'Groceries' }
|
||||
},
|
||||
yAxis: { title: { text: '' } },
|
||||
credits: { enabled: false },
|
||||
title: { text: '' },
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false, type: 'bar',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: {
|
||||
chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.'
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
renderTo: 'dashboard-col-4',
|
||||
sync: {
|
||||
visibility: true,
|
||||
highlight: true,
|
||||
extremes: true
|
||||
},
|
||||
connector: {
|
||||
id: 'dtmesxmes',
|
||||
columnAssignment: [{
|
||||
seriesId: '2025',
|
||||
data: ['Mes', 'Actual']
|
||||
},
|
||||
{
|
||||
seriesId: '2024',
|
||||
data: ['Mes', 'Anterior']
|
||||
}]
|
||||
},
|
||||
type: 'Highcharts',
|
||||
chartOptions: {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
accessibility: { description: 'Meses del año' }
|
||||
},
|
||||
yAxis: { title: { text: '' } },
|
||||
credits: { enabled: false },
|
||||
title: { text: '' },
|
||||
legend: { enabled: true, verticalAlign: 'top' },
|
||||
chart: {
|
||||
animation: false, type: 'line',
|
||||
spacing: [30, 30, 30, 20]
|
||||
},
|
||||
title: {
|
||||
text: 'Ventas por Mes'
|
||||
},
|
||||
tooltip: { valueSuffix: ' ', stickOnContact: true },
|
||||
lang: { accessibility: {
|
||||
chartContainerLabel: 'Ventas por mes.'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
renderTo: 'dashboard-col-2',
|
||||
connector: {
|
||||
id: 'dtmedsinconsumo'
|
||||
},
|
||||
type: 'DataGrid',
|
||||
sync: {
|
||||
highlight: true,
|
||||
visibility: true
|
||||
},
|
||||
dataGridOptions: {
|
||||
caption: {
|
||||
text: 'Médicos sin consumo en +30d',
|
||||
style: {
|
||||
fontSize: '14px',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},style: {
|
||||
maxHeight: '150px',
|
||||
overflowY: 'auto'
|
||||
},
|
||||
credits: { enabled: false }
|
||||
}
|
||||
}]
|
||||
}, true); "
|
||||
#End Region
|
||||
End If
|
||||
RegistraScript(TextoKPIVendedores, "top10")
|
||||
|
||||
dtIndicadores = Nothing
|
||||
dtRH = Nothing
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user