-
+
@@ -610,7 +629,8 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
@@ -680,7 +668,7 @@
} else {
CargaGraficaPastel();
}
- $('.LblTituloGrafica').text($(obj).parent().text());
+ $('.LblTituloGrafica').text($(obj).closest('tr').text().trim());
}
function CargaGraficaBarras() {
let data = cdatos;
@@ -698,7 +686,7 @@
"colorField": "Color",
"fillAlphas": 1,
"lineAlpha": 0.1,
- "type": "column",
+ "type": "line",
"valueField": "Valor"
}],
"depth3D": 20,
@@ -718,7 +706,6 @@
}
});
}
-
function CargaGraficaPastel() {
let data = cdatos;
var chart = AmCharts.makeChart("chartdiv", {
@@ -747,137 +734,50 @@
CargaGraficaPastel();
}
});
- $(".rdblistgrafica:not(.clicked) input").change(cargaGraficaBarras2);
-
- $('.rdblistgrafica').addClass('clicked')
$('.DdlGrafica').removeClass('DdlGrafica')
-
-
initamgrafica();
}
- let objetos;
- let Colores = ["#FF0F00", "#FF6600", "#F8FF01", "#04D215", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#000000"];
- function graficarshow() {
- $('.btngraficarborrar').remove();
- $('#C_Tab_header').append(' Graficar');
- $('#C_Tab_body').addClass('showgrph');
- }
- function cargaGraficaBarras2(Titulo) {
- $('.LblTituloGraficaGral').text(Titulo);
- cargaGraficaBarras2();
- }
function cargaGraficaBarras2() {
-
//Hypgrafica
- $("#DivModalGraficaGral").modal();
- let infogral = $('#grafInfo');
- infogral.find('>*').remove();
+ $("#DivModalGrafica").modal();
+ $('.LblTituloGrafica').text('grafica');
let items = []
let data;
- let icolor = 0;
- let tipografica = $('.rdblistgrafica input:checked').val();
-
- $('.ajax__tab_panel:visible .chkgraf input:checked').each(function () {
- data = $(this).closest('tr').find('.Hypgrafica').data('values')
- let name = $(this).closest('td').text().trim()
- items.push({ id: icolor, data: data, name: name, Color: Colores[icolor], tipografica })
- gettitlegraf(infogral, icolor, Colores[icolor], name, tipografica);
- icolor = icolor + 1;
- if (icolor >= Colores.length) { icolor = 0; }
- });
- objetos = items;
-
- $(".chkonchange input").each(function () {
- let _this = $(this)
- _this.change(function () {
- let _this = $(this)
- let id = Number(_this.data('id'))
- objetos[id].tipografica = _this.is(':checked') ? 1 : 2;
- ShowGraf2();
- })
- });
- $(function () {
- $('.chkonchange').tooltip()
- });
- ShowGraf2();
- }
- function gettitlegraf(infogral, id, Color, name, tipografica) {
- let strtipografica = '';
-
- let contenedor = $("");
- let divcolspan = $("");
- let divcolor = $('');
- let divtexto = $("" + name + "
");
- let divtipografica = $("" + strtipografica + "
");
- infogral.append(contenedor);
- /*contenedor.append(divcolspan);*/ contenedor.append(divcolor); contenedor.append(divtexto); contenedor.append(divtipografica);
- }
- function ShowGraf2() {
- let items = objetos;
let series = [];
+ $('.chkgraf input:checked').each(function () {
+ data = $(this).closest('tr').find('.Hypgrafica').data('values')
+ let name = $(this).closest('tr').text().trim()
+ items.push({ data: data, name: name })
+ });
if (items) {
data = items[0].data;
- series.push((
- (items[0].tipografica == 1) ?
- {
- "balloonText": "[[title]]: [[value]] [[Moneda]]",
- "colorField": "Color",
- "fillAlphas": 1,
- "lineAlpha": 0.1,
- "type": "column",
- "title": items[0].name,
- "valueField": 'Valor'
- } :
- {
- "balloonText": "[[title]]: [[value]] [[Moneda]]",
- "colorField": "Color",
- "bullet": "round",
- "dashLength": 3,
- "colorField": "color",
- "type": "line",
- "title": items[0].name,
- "valueField": "Valor"
- }
- ));
-
- for (var i = 0; i < data.length; i++) {
- data[i]['Color'] = items[0].Color
- }
-
+ series.push({
+ "balloonText": "[[title]]: [[value]] [[Moneda]]",
+ "colorField": "Color",
+ "fillAlphas": 1,
+ "lineAlpha": 0.1,
+ "type": "column",
+ "title": items[0].name,
+ "valueField": 'Valor'
+ })
for (var indexcol = 1; indexcol < items.length; indexcol++) {
let cdatos = items[indexcol].data;
let valueField = 'Valor' + indexcol;
- let colorField = 'Color' + indexcol;
- let tipografica = "column";
for (var i = 0; i < cdatos.length; i++) {
data[i][valueField] = cdatos[i].Valor
- data[i][colorField] = items[indexcol].Color
}
- series.push((
- (items[indexcol].tipografica == 1) ?
- {
- "balloonText": "[[title]]: [[value]] [[Moneda]]",
- "colorField": colorField,
- "fillAlphas": 1,
- "lineAlpha": 0.1,
- "type": "column",
- "title": items[indexcol].name,
- "valueField": valueField
- } :
- {
- "balloonText": "[[title]]: [[value]] [[Moneda]]",
- "colorField": colorField,
- "bullet": "round",
- "dashLength": 3,
- "colorField": "color",
- "type": "line",
- "title": items[indexcol].name,
- "valueField": valueField
- }
- ));
+ series.push({
+ "balloonText": "[[title]]: [[value]] [[Moneda]]",
+ "colorField": "Color",
+ "fillAlphas": 1,
+ "lineAlpha": 0.1,
+ "type": "column",
+ "title": items[indexcol].name,
+ "valueField": valueField
+ })
}
- var chart = AmCharts.makeChart("chartdivgral", {
+ var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": data,
@@ -960,4 +860,171 @@
}
+
+
diff --git a/Finanzas/RepRazonesFinancieras2.aspx.vb b/Finanzas/RepRazonesFinancieras2.aspx.vb
index 107f5fdcb..4b372cd9a 100644
--- a/Finanzas/RepRazonesFinancieras2.aspx.vb
+++ b/Finanzas/RepRazonesFinancieras2.aspx.vb
@@ -58,40 +58,55 @@ Partial Class Finanzas_RepRazonesFinancieras2
CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto)
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual)
- ValidaEjercicios()
+ ValidaEjercicios(EnumInicioFin.Fin)
End If
End Sub
Protected Sub DdlEjercicio_SelectedIndexChanged(sender As Object, e As EventArgs)
- ValidaEjercicios()
+ ValidaEjercicios(EnumInicioFin.Inicio)
End Sub
Protected Sub DdlEjercicio2_SelectedIndexChanged(sender As Object, e As EventArgs)
- ValidaEjercicios()
+ ValidaEjercicios(EnumInicioFin.Fin)
End Sub
- Private Sub ValidaEjercicios()
+ Enum EnumInicioFin
+ Inicio
+ Fin
+ End Enum
+ Private Sub ValidaEjercicios(enuInicioFin As EnumInicioFin)
- Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero
-
-
- If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then
-
- If DdlEjercicio2.Items.Count > 0 Then
- DdlEjercicio2.SelectedIndex = DdlEjercicio2.Items.Count - 1
+ If enuInicioFin = EnumInicioFin.Inicio Then
+ If DdlEjercicio.SelectedIndex > DdlEjercicio2.SelectedIndex Then
+ DdlEjercicio2.SelectedIndex = DdlEjercicio.SelectedIndex
End If
-
- Dim Fejerciosio As Integer = DdlEjercicio2.SelectedValue.ToEntero
-
- If Not EInicio + 1 > Fejerciosio Then
- DdlEjercicio2.SelectedValueExist(EInicio + 1)
+ Else
+ If DdlEjercicio.SelectedIndex > DdlEjercicio2.SelectedIndex Then
+ DdlEjercicio.SelectedIndex = DdlEjercicio2.SelectedIndex
End If
-
End If
+ 'Dim EInicio As Integer = DdlEjercicio.SelectedValue.ToEntero
+
+
+ 'If EInicio > DdlEjercicio2.SelectedValue.ToEntero Then
+
+ ' If DdlEjercicio2.Items.Count > 0 Then
+ ' DdlEjercicio2.SelectedIndex = DdlEjercicio2.Items.Count - 1
+ ' End If
+
+ ' Dim Fejerciosio As Integer = DdlEjercicio2.SelectedValue.ToEntero
+
+ ' If Not EInicio + 1 > Fejerciosio Then
+ ' DdlEjercicio2.SelectedValueExist(EInicio + 1)
+ ' End If
+
+ 'End If
+
+
UpFiltros.Update()
End Sub
@@ -358,7 +373,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
Private Sub GVRatiosOcultarColumnas(ByRef Gv As GridView, Optional index As Integer = 2)
- For index = 1 To Gv.Columns.Count - 1
+ For index = 2 To Gv.Columns.Count - 1
CType(Gv.Columns(index), BoundField).DataField = Nothing
Gv.Columns(index).Visible = False
Next
@@ -366,7 +381,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
End Sub
Private Sub GVRatiosMostrarColumnas(dt As DataTable, ByRef Gv As GridView)
- Dim index = 4
+
For index = 4 To dt.Columns.Count - 2
@@ -383,6 +398,10 @@ Partial Class Finanzas_RepRazonesFinancieras2
If e.Row.RowType = DataControlRowType.DataRow Then
+
+
+
+
For x = 1 To DTRatios.Columns.Count
If e.Row.DataKey("Ratio") = "INCREMENTO DE VENTAS" Then
@@ -411,7 +430,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
Dim EsPorcentaje = If(e.Row.DataKey("EsPorcentaje").ToEntero = 1, True, False)
- For x = 1 To DTRatios.Columns.Count - 2
+ For x = 2 To DTRatios.Columns.Count - 2
If EsPorcentaje Then
e.Row.Cells(x).Text = $"{(e.Row.Cells(x).Text.ToDecimal * 100.0).ToString("###,####,###.00")}%"
Else
@@ -420,6 +439,7 @@ Partial Class Finanzas_RepRazonesFinancieras2
Next
End If
+
If e.Row.DataKey("Formula").Trim().Length > 0 Then
'data-html="true" data-toggle="tooltip" data-placement="left" title="Agregar
Familiares"
@@ -430,16 +450,87 @@ Partial Class Finanzas_RepRazonesFinancieras2
End If
+ Dim Titulo As String = e.Row.FCLabel("LblRatio").Text
+ Dim SubTitulo As String = ""
+ Dim YReferencia As String = "$"
+ Dim Info As String = ""
+ Dim XReferencia As String = ""
+ Dim Promedio As String = ""
+
+ Dim lista As New List(Of Object)
+ Dim Lista2 As New List(Of String)
+ For x = 2 To GVRatios.Columns.Count - 1
+
+ If GVRatios.Columns(x).Visible = True Then
+
+ Dim headerString As String = GVRatios.Columns(x).HeaderText
+
+ If IsDate(headerString) Then
+ Dim valor As String = e.Row.Cells(x).Text.ToString.Replace("%", "").Replace(" ", "").Replace(" ", "").Replace(",", "").Trim
+
+ If valor.Length > 0 Then
+ lista.Add(New With {.Texto = headerString, .Valor = valor.ToDecimal, .Color = "#FF0F00"})
+ Lista2.Add($"['{headerString}',{valor}]")
+ End If
+
+ End If
+
+ End If
+
+ Next
+ 'e.Row.FCHyperLink("Hypgrafica").Attributes.Add("data-values", Newtonsoft.Json.JsonConvert.SerializeObject(lista))
+
+ If e.Row.DataKey("Tipo").ToEntero <> 1 Then
+ Info = String.Join(",", Lista2)
+ e.Row.FCHyperLink("hpl2").Attributes.Add("onclick", "$('#DivModalGrafica').modal('show'); " &
+ String.Format("graficahighchartsFinan('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}],'{9}');", chartdiv2.ClientID, "", SubTitulo, YReferencia, Info, XReferencia, Promedio, "", "", Titulo))
+ Else
+ e.Row.FCHyperLink("hpl2").Visible = False
+ End If
-
-
+ 'AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, "", "")
End If
End Sub
+
+ Private Function MuestraGrafica(divcontainer As HtmlGenericControl, DTDatos As DataTable, DTPie As DataTable, ColTitle As String, ColValue As String, Titulo As String, SubTitulo As String, Indicador As String, XReferencia As String, Promedio As String, Optional YReferencia As String = "") As String
+ Dim SBPie1 As New StringBuilder
+ Dim SBPie2 As New StringBuilder
+ Dim Info As String = ""
+ Dim SBJSScript As New StringBuilder
+
+ 'If DTDatos IsNot Nothing AndAlso DTDatos.Rows.Count > 0 Then
+ ' For Each DbRow As DataRow In DTDatos.Rows
+ ' Info = String.Format("{2}['{1}',{0}],", DbRow(ColValue), DbRow(ColTitle), Info)
+ ' Next
+ ' Info = Info.Remove(Info.Length - 1, 1)
+ 'End If
+
+ 'For Each DbRow As DataRow In DTPie.Rows
+ ' If DbRow("Importe").ToString.ToDouble > 0 Then SBPie1.AppendFormat("{{ name:'{1}- {2}',y:{0} }},", DbRow("Importe"), DbRow("Banco"), DbRow("NumCuenta"))
+ 'Next
+
+ 'pesos y dolares
+ 'Dim Dolares As Double = DTPie.SUM("Importe", "CveMoneda = 2")
+
+ 'If Dolares > 0 Then
+ ' SBPie2.AppendFormat("{{ name:'Dólares',y:{0} }},", Dolares)
+ ' SBPie2.AppendFormat("{{ name:'Pesos',y:{0} }},", DTPie.SUM("Importe", "CveMoneda = 1"))
+ 'End If
+
+
+ SBJSScript.AppendFormat("graficahighcharts2('{0}','{1}','{2}','{3}',[{4}],1,'{5}','{6}',[{8}],[{7}]);", divcontainer.ClientID, Titulo, SubTitulo, YReferencia, Info, XReferencia, Promedio, "", "")
+
+ Return SBJSScript.ToString
+
+ 'RegistraScript(SBJSScript.ToString, Indicador)
+
+ End Function
+
#End Region
@@ -513,15 +604,15 @@ Partial Class Finanzas_RepRazonesFinancieras2
LblPeriodo.Visible = True
DivPeriodo.Visible = True
- AddHandler DdlEjercicio.SelectedIndexChanged, AddressOf DdlEjercicio_SelectedIndexChanged
- AddHandler DdlEjercicio2.SelectedIndexChanged, AddressOf DdlEjercicio2_SelectedIndexChanged
+ 'AddHandler DdlEjercicio.SelectedIndexChanged, AddressOf DdlEjercicio_SelectedIndexChanged
+ 'AddHandler DdlEjercicio2.SelectedIndexChanged, AddressOf DdlEjercicio2_SelectedIndexChanged
CargaEjercicios()
Else
DVVisualizacion.Visible = True
LblVisualizacion.Visible = True
- RemoveHandler CType(DdlEjercicio, DropDownList).SelectedIndexChanged, AddressOf DdlEjercicio_SelectedIndexChanged
- RemoveHandler CType(DdlEjercicio2, DropDownList).SelectedIndexChanged, AddressOf DdlEjercicio2_SelectedIndexChanged
+ 'RemoveHandler CType(DdlEjercicio, DropDownList).SelectedIndexChanged, AddressOf DdlEjercicio_SelectedIndexChanged
+ 'RemoveHandler CType(DdlEjercicio2, DropDownList).SelectedIndexChanged, AddressOf DdlEjercicio2_SelectedIndexChanged
CargaMeses()
End If
@@ -633,7 +724,10 @@ Partial Class Finanzas_RepRazonesFinancieras2
ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd"))
While FechaFinal >= FechaTemp
FechaTemp = FechaTemp.AddMonths(1).LastDayOfMonth
- ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd"))
+ If FechaFinal >= FechaTemp Then
+ ListaFechas.Add(FechaTemp.ToString("yyyy-MM-dd"))
+ End If
+
End While
@@ -647,6 +741,9 @@ Partial Class Finanzas_RepRazonesFinancieras2
End Function
+
+
+
End Class
diff --git a/Inicio.aspx b/Inicio.aspx
index 69a8ec09f..aac7cdca9 100644
--- a/Inicio.aspx
+++ b/Inicio.aspx
@@ -212,6 +212,7 @@