From 4b14559871d5e2077da19cd2de10cfe2fe4cd342 Mon Sep 17 00:00:00 2001 From: rrene Date: Sat, 19 Apr 2025 07:31:57 -0700 Subject: [PATCH] -- Mejoras SMS KPI --- App_Code/ClsVentas.vb | 4 +- Inicio.aspx | 206 +++++++----- Inicio.aspx.vb | 760 +++++++++++++++++++++++++++++++----------- 3 files changed, 700 insertions(+), 270 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 6d7ecde0c..3a08f1200 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -7697,7 +7697,7 @@ Public Class ClsVentas End Function - Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function GetSMSIndicadores(Opcion As Integer, FechaInicio As Date, FechaFin As Date, CveUsuario As Integer, CveVendedor As Integer, CveUsuarioTecnico As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_SMS_IndicadoresGet") With SqlAdapter.SelectCommand.Parameters @@ -7705,6 +7705,8 @@ Public Class ClsVentas .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio .Add("@FechaFin", SqlDbType.Date).Value = FechaFin .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor + .Add("@CveUsuarioTecnico", SqlDbType.Int).Value = CveUsuarioTecnico .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try diff --git a/Inicio.aspx b/Inicio.aspx index 346464f56..06230281a 100644 --- a/Inicio.aspx +++ b/Inicio.aspx @@ -66,10 +66,9 @@ margin-left: 28%; } - .calendariobody label { - font-size: 12px; - } - + .calendariobody label { + font-size: 12px; + } .tareasinicio tr td:nth-child(1) { } @@ -107,11 +106,11 @@ display: block; } - #moopio a:hover { - background-color: rgba(0,0,0,0.5); - transform: scale(1.2); - cursor: default; - } + #moopio a:hover { + background-color: rgba(0,0,0,0.5); + transform: scale(1.2); + cursor: default; + } .MultiLineTextBox { @@ -124,7 +123,29 @@ } - //#region highcharts + + + #divsmsdash { + /* Estilo general compacto */ + --hcg-font-size: 8px !important; + --hcg-padding: 4px; + --hcg-border-radius: 6px; + } + .dashboard-container { + font-size: 16px; /* Tamaño base */ + } + .highcharts-data-table table { + /* Estilo general compacto */ + --hcg-font-size: 8px !important; + --hcg-padding: 4px; + --hcg-border-radius: 6px; + } + + #divsmsdash .hcg-theme-default, .highcharts-datagrid-theme-default { + --hcg-font-size: 10px; + --hcg-padding: 5px; + } + .highcharts-figure, .highcharts-data-table table { min-width: 310px; @@ -176,78 +197,78 @@ margin: 0.3rem 10px; } h1#title { - padding-top: 10px; - margin: 0; - background-color: #3d3d3d; - text-align: center; - color: #fff; -} + 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-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-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-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-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); -} + #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); -} + #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; -} + #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 { + stroke-dasharray: 2px; + stroke: var(--highcharts-color-3); + } -.highcharts-plot-line-label { - fill: var(--highcharts-color-3); -} + .highcharts-plot-line-label { + fill: var(--highcharts-color-3); + } -.highcharts-description { - padding: 0 20px; -} + .highcharts-description { + padding: 0 20px; + } -#kpi-vitamin-a, -#kpi-iron { - flex: 1 1 100%; - height: 205px; -} + #kpi-vitamin-a, + #kpi-iron { + flex: 1 1 100%; + height: 205px; + } /* LARGE */ @media (max-width: 1200px) { @@ -473,7 +494,7 @@ flex: 1 1 50%; } } -//#endregion + @@ -498,7 +519,7 @@ - +

@@ -506,10 +527,10 @@
Indicador - - - - + + + +
@@ -527,10 +548,33 @@

-
-
-
-
+
+ + +
+
Opción:
+
+ + + + + + + +
+
+ + + + +
+
+
+
+
+ + +

diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index ee937827d..91feb562f 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -4,7 +4,6 @@ Imports System.Web.Services Imports Newtonsoft.Json Imports ADSNetLibrary.SIGAPI.Models.CRM.Request Imports ADSNetLibrary.SIGAPI.Services.CRM -Imports ADSNetLibrary.SIGAPI.Models.CRM.Response Partial Class Inicio Inherits ClsPaginas @@ -192,7 +191,16 @@ Partial Class Inicio If UsuarioActual.TienePermisoProceso(344) Then MuestraRSCOProximosAVencer() If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso UsuarioActual.CveRol.Contiene(1577, 1639, 1573) Then - CargaKPICirugias() + Dim Opcion As Integer = 1 + Dim CveVendedor As Integer = -1 + Dim CveUsuarioTecnico As Integer = -1 + If UsuarioActual.CveRol = 1577 Then + Opcion = 1 'vendedor + CveVendedor = UsuarioActual.CveVendedor + ElseIf UsuarioActual.CveRol.Contiene(1639, 1573) Then ' rol admin. 1573 + Opcion = 2 'gerente ventas + End If + CargaKPICirugias(Opcion, CveVendedor, CveUsuarioTecnico) End If If (UsuarioActual.CveRol = 1062) Or (UsuarioActual.CveUsuario = 100) Then @@ -1613,26 +1621,18 @@ Partial Class Inicio #Region "S M S - I N D I C A D O R E S" - Private Sub CargaKPICirugias() + Private Sub CargaKPICirugias(Opcion As Integer, Optional CveVendedor As Integer = -1, Optional CveUsuarioTecnico As Integer = -1) 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 - Dim FechaI As Date = Now.FirstDayOfMonth Dim FechaF As Date = Now.LastDayOfMonth - If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + If Gral.GetSMSIndicadores(Opcion, FechaI, FechaF, UsuarioActual.CveUsuario, CveVendedor, CveUsuarioTecnico, 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 @@ -1640,64 +1640,70 @@ Partial Class Inicio Dim StrTexto As New StringBuilder Dim StrSource As New StringBuilder Dim ComisionVendedor, ComisionTecnico, VentasTotales As Decimal - Dim TextoKPIVendedores As String + Dim NumPacientes As Integer = 0 + Dim TextoKPIVendedores As String = "" Dim dtt As DataTable - If Opcion = 1 Then + If ds IsNot Nothing AndAlso ds.Tables.Count > 0 Then + 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(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 + 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("]}}") + 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: { + 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); + dtt = ds.Tables(5) + StrTexto.Clear() + If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then + NumPacientes = dtt.FiltroPrimeroValor("NumeroPacientes").ToEntero + End If + TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: { enabled: false, contextMenu: { enabled: true } }, @@ -1757,8 +1763,8 @@ Partial Class Inicio },{ type: 'KPI', renderTo: 'kpi-iron3', - value: 18, - title: 'Personas', + value: " & NumPacientes & ", + title: 'Pacientes', valueFormat: '{value}', subtitle: '-' },{ @@ -1844,96 +1850,100 @@ Partial Class Inicio }, dataGridOptions: { caption: { - text: 'Médicos sin consumo en +30d', - rowHeight: 20, // ⬅️ Altura de cada fila en píxeles - style: { - fontSize: '8px', - fontWeight: 'bold' - } + text: 'Médicos sin consumo en +30d' },style: { maxHeight: '350px', - overflowY: 'auto' + overflowY: 'auto', + fontSize: '7pt', + fontWeight: 'normal' }, credits: { enabled: false } + , cellStyle: { + fontWeight: 'normal', + fontSize: '8px' + } } }] }, true); " #End Region - - Else + ElseIf Opcion = 2 Then #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(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 + 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("]}}") + 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},'/a/a.aspx?CveI=1'],", If(dr("Vendedor").ToString.Length > 10, dr("Vendedor").ToString.Substring(0, 10), dr("Vendedor")), dr("Importe")) + Next + StrTexto.Length -= 1 + StrSource.Append(",{id:'dtvendedores',type:'JSON',options:{firstRowAsNames:false,columnNames:['Vendedor','Importe','Url'],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() + 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},'https://www.google.com'],", dr("Marca"), dr("Importe")) + Next + StrTexto.Length -= 1 + StrSource.Append(",{id:'dttop5marcas',type:'JSON',options:{firstRowAsNames:false,columnNames:['Marca','Importe','Url'],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); + End If + dtt = ds.Tables(6) + StrTexto.Clear() + If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then + NumPacientes = dtt.FiltroPrimeroValor("NumeroPacientes").ToEntero + 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: { + TextoKPIVendedores = "Highcharts.setOptions({lang: { decimalPoint: '.', thousandsSep: ','},chart:{styledMode:true}});Dashboards.board('divsmsdash',{dataPool:{connectors:[" & StrSource.ToString & "]},editMode: { enabled: false, contextMenu: { enabled: true } }, @@ -1979,8 +1989,8 @@ Partial Class Inicio },{ type: 'KPI', renderTo: 'kpi-iron3', - value: 18, - title: 'Personas', + value: " & NumPacientes & ", + title: 'Pacientes', valueFormat: '{value}', subtitle: '-' },{ @@ -2021,40 +2031,54 @@ Partial Class Inicio 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' } + renderTo: 'dashboard-col-1', + connector: { + id: 'dttop5marcas', + columnAssignment: [{ + seriesId: 'Top 5 Marcas', + data: ['Marca', 'Importe','Url'] + }] }, - 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.' + type: 'Highcharts', + chartOptions: { + chart: { + type: 'bar', + animation: false, + spacing: [30, 30, 30, 20] + }, + title: { text: '' }, + credits: { enabled: false }, + legend: { enabled: true, verticalAlign: 'top' }, + xAxis: { + type: 'category', + accessibility: { description: 'Groceries' } + }, + yAxis: { title: { text: '' } }, + tooltip: { + valueSuffix: ' ', + stickOnContact: true + }, + plotOptions: { + series: { + cursor: 'pointer', + point: { + events: { + click: function () { + const url = this.options?.Url; + + console.log('URL del punto:', url); + if (url) { + window.open(url, '_blank'); + } else { + alert('No se encontró la URL del punto.'); + } + } + } + } + } } } - } - }, { + }, { renderTo: 'dashboard-col-3', sync: { visibility: true, @@ -2065,24 +2089,67 @@ Partial Class Inicio id: 'dtvendedores', columnAssignment: [{ seriesId: 'Vendedores', - data: ['Vendedor', 'Importe'] + data: ['Vendedor', 'Importe','Url'] }] }, type: 'Highcharts', chartOptions: { xAxis: { type: 'category', - accessibility: { description: 'Groceries' } + accessibility: { description: '' } }, yAxis: { title: { text: '' } }, credits: { enabled: false }, - title: { text: '' }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: [{ + enabled: true, + distance: 20 + }, { + enabled: true, + distance: -40, + format: '{point.percentage:.1f}%', + style: { + fontSize: '1.2em', + textOutline: 'none', + opacity: 0.7 + }, + filter: { + operator: '>', + property: 'percentage', + value: 10 + } + }] + } + }, + title: { text: 'Vendedores' }, legend: { enabled: true, verticalAlign: 'top' }, chart: { - animation: false, type: 'bar', - spacing: [30, 30, 30, 20] + animation: false, type: 'pie' }, - tooltip: { valueSuffix: ' ', stickOnContact: true }, + tooltip: { + pointFormat: '{series.name}: {point.percentage:.1f}%
Valor: {point.y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '{point.name}: {point.percentage:.1f} %' + }, + point: { + events: { + click: function () { + const url = this.options?.Url; + if (url) window.open(url, '_blank'); + } + } + } + } + }, lang: { accessibility: { chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.' } @@ -2140,25 +2207,311 @@ Partial Class Inicio highlight: true, visibility: true }, - dataGridOptions: { + dataGridOptions: { caption: { - text: 'Médicos sin consumo en +30d', - rowHeight: 20, // Altura de cada fila en píxeles - style: { - fontSize: '8pt', - fontWeight: 'bold' - } + text: 'Médicos sin consumo en +30d' },style: { maxHeight: '350px', - overflowY: 'auto' + overflowY: 'auto', + fontSize: '7pt', + fontWeight: 'normal' }, credits: { enabled: false } + , cellStyle: { + fontWeight: 'normal', + fontSize: '8px' + } } }] }, true); " #End Region + + ElseIf Opcion = 3 Then +#Region "ALMACEN" + Dim TotalEntregas, TotalRecoleciones, ProductosConExistencia, Ingresadas, NoUsadas As Integer + Dim EntregasDiarias As Decimal = 0 + dtt = ds.Tables(0) + If dtt IsNot Nothing Then + TotalEntregas = dtt.FiltroPrimeroValor("TotalEntregas").ToEntero + TotalRecoleciones = dtt.FiltroPrimeroValor("TotalRecoleccion").ToEntero + ProductosConExistencia = dtt.FiltroPrimeroValor("ProductosExistencias").ToEntero + Ingresadas = dtt.FiltroPrimeroValor("Ingresadas").ToEntero + NoUsadas = dtt.FiltroPrimeroValor("NoUsadas").ToEntero + EntregasDiarias = dtt.FiltroPrimeroValor("EntregasDiarias").ToDecimal + End If + + 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-iron0' + }, { + id: 'kpi-iron1' + }, { + id: 'kpi-iron2' + }] + },{ + cells: [{ + id: 'kpi-iron3' + }, { + id: 'kpi-iron4' + }, { + id: 'kpi-iron5' + }] + }] + } + }] + }] + }] + }, + components: [{ + type: 'KPI', + renderTo: 'kpi-iron0', + value: " & TotalEntregas & ", + valueFormat: '{value}', + title: 'Total Entrega', + subtitle: '-' + }, { + type: 'KPI', + renderTo: 'kpi-iron1', + value: " & TotalRecoleciones & ", + title: 'Total Recolecciones', + valueFormat: '{value}', + valueStyle: { color: '#198754'}, + subtitle: '' + }, { + type: 'KPI', + renderTo: 'kpi-iron2', + value: " & ProductosConExistencia & ", + title: 'Productos con Existencia', + valueFormat: '{value}', + subtitle: '-' + },{ + type: 'KPI', + renderTo: 'kpi-iron3', + value: " & Ingresadas & ", + title: 'Ingresadas', + valueFormat: '{value}', + subtitle: '-' + },{ + type: 'KPI', + renderTo: 'kpi-iron4', + value: " & NoUsadas & ", + title: 'No usadas', + valueFormat: '{value}', + subtitle: '-' + },{ + type: 'KPI', + renderTo: 'kpi-iron5', + value: " & EntregasDiarias & ", + title: 'Prom Entrega diaria', + valueFormat: '{value:,.2f}', + subtitle: '-' + } ] + }, true); " +#End Region + ElseIf Opcion = 4 Then +#Region "TECNICO" + Dim CirugiasDiaSiguiente, Comision, NumCirugias As Integer + Dim MontoCirugias As Decimal = 0 + dtt = ds.Tables(0) + If dtt IsNot Nothing Then + CirugiasDiaSiguiente = dtt.FiltroPrimeroValor("CirugiasDiaSiguiente").ToEntero + Comision = dtt.FiltroPrimeroValor("Comision").ToEntero + NumCirugias = dtt.FiltroPrimeroValor("NumCirugias").ToEntero + MontoCirugias = dtt.FiltroPrimeroValor("MontoCirugias").ToDecimal + End If + + 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-iron0' + }, { + id: 'kpi-iron1' + }] + },{ + cells: [{ + id: 'kpi-iron2' + },{ + id: 'kpi-iron3' + } ] + }] + } + }] + }] + }] + }, + components: [{ + type: 'KPI', + renderTo: 'kpi-iron0', + value: " & CirugiasDiaSiguiente & ", + valueFormat: '{value}', + title: 'Cirugías Dia Sig', + subtitle: '-' + }, { + type: 'KPI', + renderTo: 'kpi-iron1', + value: " & Comision & ", + title: '$ Comisión', + valueFormat: '{value:,.2f}', + valueStyle: { color: '#198754'}, + subtitle: '' + }, { + type: 'KPI', + renderTo: 'kpi-iron2', + value: " & NumCirugias & ", + title: '# Cirugías', + valueFormat: '{value}', + subtitle: '-' + },{ + type: 'KPI', + renderTo: 'kpi-iron3', + value: " & MontoCirugias & ", + title: '$ Cirugías', + valueFormat: '{value:,.2f}', + subtitle: '-' + } ] + }, true); " +#End Region + ElseIf Opcion = 5 Then +#Region "GERENTE TECNICO" + Dim CirugiasAsistidas As Integer + Dim MontoCirugias, TicketPromedio As Decimal + dtt = ds.Tables(0) + If dtt IsNot Nothing Then + CirugiasAsistidas = dtt.FiltroPrimeroValor("CirugiasAsistidas").ToEntero + TicketPromedio = dtt.FiltroPrimeroValor("TicketPromedio").ToDecimal + End If + 'top cirugias técnicos + dtt = ds.Tables(1) + StrTexto.Clear() + If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then + For Each dr As DataRow In dtt.FiltraParametros("Cantidad > 0").Rows + StrTexto.AppendFormat("['{0}',{1}],", dr("NombreTecnico"), dr("Cantidad")) + Next + StrTexto.Length -= 1 + StrSource.Append("{id:'dttecnicos',type:'JSON',options:{firstRowAsNames:false,columnNames:['NombreTecnico','Cantidad'],data:[") + StrSource.Append(StrTexto.ToString) + StrSource.Append("]}}") + End If + + 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' + }] + }] + } + }] + }, { + cells: [{ + id: 'dashboard-col-3' + }] + }] + }] + }, + components: [{ + type: 'KPI', + renderTo: 'kpi-vitamin-a', + value: " & CirugiasAsistidas & ", + valueFormat: '{value}', + title: 'Cirugías Asistidas', + subtitle: '-' + },{ + type: 'KPI', + renderTo: 'kpi-iron', + value: " & TicketPromedio & ", + title: 'Ticket Promedio', + valueFormat: '{value}', + subtitle: '-' + }, { + renderTo: 'dashboard-col-3', + sync: { + visibility: true, + highlight: true, + extremes: true + }, + connector: { + id: 'dttecnicos', + columnAssignment: [{ + seriesId: 'Técnicos', + data: ['NombreTecnico', 'Cantidad'] + }] + }, + type: 'Highcharts', + chartOptions: { + xAxis: { + type: 'category', + accessibility: { description: '' } + }, + yAxis: { title: { text: '' } }, + credits: { enabled: false }, + + title: { text: 'Técnicos' }, + legend: { enabled: true, verticalAlign: 'top' }, + chart: { + animation: false, type: 'pie' + }, + tooltip: { + pointFormat: '{series.name}: {point.percentage:.1f}%
Valor: {point.y}' + }, + plotOptions: { + pie: { + allowPointSelect: true, + cursor: 'pointer', + dataLabels: { + enabled: true, + format: '{point.name}: {point.percentage:.1f} %' + }, + point: { + events: { + click: function () { + const url = this.options?.Url; + if (url) window.open(url, '_blank'); + } + } + } + } + }, + lang: { accessibility: { + chartContainerLabel: 'Iron in food. Highcharts ' + 'Interactive Chart.' + } + } + } + }] + }, true); " +#End Region + End If + RegistraScript(TextoKPIVendedores, "top10") End If - RegistraScript(TextoKPIVendedores, "top10") dtIndicadores = Nothing dtRH = Nothing @@ -2166,4 +2519,35 @@ Partial Class Inicio End Sub #End Region + + Protected Sub DdlSMSOpciones_SelectedIndexChanged(sender As Object, e As EventArgs) + If DdlSMSOpciones.SelectedValue = "1" Then + DdlSMSVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa).FiltraParametros("CveEstatus=1") + DdlSMSVendedores.DataBind() + DdlSMSVendedores.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSMSVendedores.Visible = True + DdlSMSTecnico.Visible = False + CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero) + ElseIf DdlSMSOpciones.SelectedValue = "4" Then + DdlSMSTecnico.DataSource = GlobalDTUsuarios(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros("CveRol = 1582") + DdlSMSTecnico.DataBind() + DdlSMSTecnico.Items.Insert(0, New ListItem("Todos", "-1")) + DdlSMSTecnico.Visible = True + DdlSMSVendedores.Visible = False + CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero) + Else + DdlSMSVendedores.Visible = False + DdlSMSTecnico.Visible = False + CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero) + End If + + End Sub + + Protected Sub DdlSMSVendedores_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, DdlSMSVendedores.SelectedValue.ToEntero) + End Sub + + Protected Sub DdlSMSTecnico_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaKPICirugias(DdlSMSOpciones.SelectedValue.ToEntero, -1, DdlSMSTecnico.SelectedValue.ToEntero) + End Sub End Class