From 98a4d8928599aaf9a14f99dd1254634a0bfb531a Mon Sep 17 00:00:00 2001 From: Luis Carlos Quijada Date: Thu, 12 Jun 2025 17:00:49 -0600 Subject: [PATCH] Cambios Graficas Dashboard --- General/Dashboard.aspx | 746 +++++++++++++++++++++++++++++++++++--- General/Dashboard.aspx.vb | 372 +++++++++++++++++++ 2 files changed, 1068 insertions(+), 50 deletions(-) diff --git a/General/Dashboard.aspx b/General/Dashboard.aspx index 69dfc4781..925336a3a 100644 --- a/General/Dashboard.aspx +++ b/General/Dashboard.aspx @@ -1550,11 +1550,59 @@ + Width="100%" + OnRowCreated="gvRecuperacionPorSucursal_RowCreated"> - - - + + +
+ Sucursal + + + +
+
+ + + +
+ + + + +
+ Recuperado +
+ + +
+
+
+ + + +
+ + + + +
+ Avg. Días Recuperación +
+ + +
+
+
+ + + +
@@ -1572,11 +1620,59 @@ + Width="100%" + OnRowCreated="gvRecuperacionPorCliente_RowCreated"> - - - + + +
+ Cliente + + + +
+
+ + + +
+ + + + +
+ Recuperado +
+ + +
+
+
+ + + +
+ + + + +
+ Avg. Días Recuperación +
+ + +
+
+
+ + + +
@@ -1601,13 +1697,95 @@ + Width="100%" + OnRowCreated="gvComprasPorClasificacion_RowCreated"> - - - - - + + +
+ Clasificación + + + +
+
+ + + +
+ + + + +
+ Año +
+ + +
+
+
+ + + +
+ + + + +
+ Mes +
+ + +
+
+
+ + + +
+ + + + +
+ Semana +
+ + +
+
+
+ + + +
+ + + + +
+ Día +
+ + +
+
+
+ + + +
@@ -1625,13 +1803,95 @@ + Width="100%" + OnRowCreated="gvComprasPorMarca_RowCreated"> - - - - - + + +
+ Marca + + + +
+
+ + + +
+ + + + +
+ Año +
+ + +
+
+
+ + + +
+ + + + +
+ Mes +
+ + +
+
+
+ + + +
+ + + + +
+ Semana +
+ + +
+
+
+ + + +
+ + + + +
+ Día +
+ + +
+
+
+ + + +
@@ -1652,13 +1912,95 @@ + Width="100%" + OnRowCreated="gvComprasPorPS_RowCreated"> - - - - - + + +
+ PS + + + +
+
+ + + +
+ + + + +
+ Año +
+ + +
+
+
+ + + +
+ + + + +
+ Mes +
+ + +
+
+
+ + + +
+ + + + +
+ Semana +
+ + +
+
+
+ + + +
+ + + + +
+ Día +
+ + +
+
+
+ + + +
@@ -1676,13 +2018,95 @@ + Width="100%" + OnRowCreated="gvComprasPorProveedor_RowCreated"> - - - - - + + +
+ Proveedor + + + +
+
+ + + +
+ + + + +
+ Año +
+ + +
+
+
+ + + +
+ + + + +
+ Mes +
+ + +
+
+
+ + + +
+ + + + +
+ Semana +
+ + +
+
+
+ + + +
+ + + + +
+ Día +
+ + +
+
+
+ + + +
@@ -1725,12 +2149,75 @@ + Width="100%" + OnRowCreated="gvCxPPorSucursal_RowCreated"> - - - - + + +
+ Sucursal + + + +
+
+ + + +
+ + + +
+ Vencido +
+ + +
+
+
+ + + +
+ + + + +
+ Por Vencer +
+ + +
+
+
+ + + +
+ + + +
+ Total CxP +
+ + +
+
+
+ + + +
@@ -1748,12 +2235,75 @@ + Width="100%" + OnRowCreated="gvCxPPorProveedor_RowCreated"> - - - - + + +
+ Proveedor + + + +
+
+ + + +
+ + + +
+ Vencido +
+ + +
+
+
+ + + +
+ + + + +
+ Por Vencer +
+ + +
+
+
+ + + +
+ + + +
+ Total CxP +
+ + +
+
+
+ + + +
@@ -1774,11 +2324,59 @@ + Width="100%" + OnRowCreated="gvPagosPorSucursal_RowCreated"> - - - + + +
+ Sucursal + + + +
+
+ + + +
+ + + + +
+ Pagado +
+ + +
+
+
+ + + +
+ + + + +
+ Avg. Días +
+ + +
+
+
+ + + +
@@ -1796,11 +2394,59 @@ + Width="100%" + OnRowCreated="gvPagosPorProveedor_RowCreated"> - - - + + +
+ Proveedor + + + +
+
+ + + +
+ + + + +
+ Recuperado +
+ + +
+
+
+ + + +
+ + + + +
+ Avg. Días +
+ + +
+
+
+ + + +
diff --git a/General/Dashboard.aspx.vb b/General/Dashboard.aspx.vb index 5fe165fe6..ed3cef61a 100644 --- a/General/Dashboard.aspx.vb +++ b/General/Dashboard.aspx.vb @@ -758,6 +758,378 @@ Partial Class General_Dashboard End If End Sub + Protected Sub gvRecuperacionPorSucursal_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Sucursal ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Recuperado", "chkRecuperado", "Recuperado")) + headerRow2.Cells.Add(CreateSubHeaderCell("PromedioDiasRecuperacion", "chkDiasRecuperado", "Avg. Días Recuperación")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvRecuperacionPorCliente_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Cliente ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Recuperado", "chkRecuperado", "Recuperado")) + headerRow2.Cells.Add(CreateSubHeaderCell("PromedioDiasRecuperacion", "chkDiasRecuperado", "Avg. Días Recuperación")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvComprasPorClasificacion_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Clasificación ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año")) + headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes")) + headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana")) + headerRow2.Cells.Add(CreateSubHeaderCell("Dia", "chkDia", "Dia")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvComprasPorMarca_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Marca ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año")) + headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes")) + headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana")) + headerRow2.Cells.Add(CreateSubHeaderCell("Dia", "chkDia", "Dia")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvComprasPorPS_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("PS ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año")) + headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes")) + headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana")) + headerRow2.Cells.Add(CreateSubHeaderCell("Dia", "chkDia", "Dia")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvComprasPorProveedor_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Proveedor ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Año", "chkAño", "Año")) + headerRow2.Cells.Add(CreateSubHeaderCell("Mes", "chkMes", "Mes")) + headerRow2.Cells.Add(CreateSubHeaderCell("Semana", "chkSemana", "Semana")) + headerRow2.Cells.Add(CreateSubHeaderCell("Dia", "chkDia", "Dia")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvCxPPorSucursal_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Sucursal ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Vencido", "chkVencido", "Vencido")) + headerRow2.Cells.Add(CreateSubHeaderCell("Por Vencer", "chkPorVencer", "PorVencer")) + headerRow2.Cells.Add(CreateSubHeaderCell("Total", "chkTotalCxC", "Total CxP")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvCxPPorProveedor_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Proveedor ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Vencido", "chkVencido", "Vencido")) + headerRow2.Cells.Add(CreateSubHeaderCell("Por Vencer", "chkPorVencer", "PorVencer")) + headerRow2.Cells.Add(CreateSubHeaderCell("Total", "chkTotalCxP", "Total CxP")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvPagosPorSucursal_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Sucursal ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Recuperado", "chkRecuperado", "Pagado")) + headerRow2.Cells.Add(CreateSubHeaderCell("PromedioDias", "chkDiasRecuperado", "Avg. Días")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + Protected Sub gvPagosPorProveedor_RowCreated(sender As Object, e As GridViewRowEventArgs) + If e.Row.RowType = DataControlRowType.Header Then + e.Row.Cells.Clear() + Dim grid As GridView = DirectCast(sender, GridView) + + ' --- Fila 1 --- + Dim headerRow1 As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Celda principal (Sucursal) + Dim cellSucursal As New TableHeaderCell() + cellSucursal.RowSpan = 2 + cellSucursal.VerticalAlign = VerticalAlign.Middle + cellSucursal.Controls.Add(New LiteralControl("Proveedor ")) + Dim hypGrafica As New HyperLink() + hypGrafica.NavigateUrl = "javascript:void(0);" + hypGrafica.Attributes.Add("onclick", "return generarGrafica('" & grid.ClientID & "');") + hypGrafica.CssClass = "grafica-icon" + hypGrafica.Controls.Add(New LiteralControl("")) + cellSucursal.Controls.Add(hypGrafica) + headerRow1.Cells.Add(cellSucursal) + + headerRow1.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(0, headerRow1) + + ' --- Fila 2 (Subheaders) --- + Dim headerRow2 As New GridViewRow(1, 0, DataControlRowType.Header, DataControlRowState.Normal) + + ' Subheaders con checkboxes + headerRow2.Cells.Add(CreateSubHeaderCell("Recuperado", "chkRecuperado", "Recuperado")) + headerRow2.Cells.Add(CreateSubHeaderCell("PromedioDias", "chkDiasRecuperado", "Avg. Días")) + + headerRow2.TableSection = TableRowSection.TableHeader + grid.Controls(0).Controls.AddAt(1, headerRow2) + End If + End Sub + + + ''' ''' Ahora emitimos HTML puro para el checkbox + label, ''' así el label realmente dispara el toggle del input.