This commit is contained in:
2023-10-19 13:16:24 -07:00
16 changed files with 117 additions and 70 deletions

View File

@@ -7,12 +7,12 @@
<style>
#chartdiv {
width: 100%;
height: 500px;
height: 400px;
}
#chartdivgral {
width: 100%;
min-height: 500px;
min-height: 400px;
}
.fa.fa-bar-chart {
@@ -1231,6 +1231,11 @@
<asp:HyperLink ID="HLAnterior" runat="server" Text='<%# Eval("ImporteAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="%" ItemStyle-Width="30px" ItemStyle-Font-Size="10px" >
<ItemTemplate>
<asp:Label ID="LblPorcentajeAcumualdo" runat="server" Text='<%# Eval("PorcentajeAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="100px" />--%>
</Columns>
@@ -1407,7 +1412,15 @@
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" ItemStyle-Width="30px" ItemStyle-Font-Size="10px" />
<asp:TemplateField HeaderText="%" ItemStyle-Width="30px" ItemStyle-Font-Size="10px" >
<ItemTemplate>
<asp:Label ID="LblPorcentajeAcumualdo" runat="server" Text='<%# Eval("PorcentajeAcumulado", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:Label>
</ItemTemplate>
<ItemStyle Width="150px" HorizontalAlign="Right" />
</asp:TemplateField>
<%--<asp:BoundField HeaderText="%" DataField="PorcentajeAcumulado" DataFormatString="{0:N2}" />--%>
</Columns>
</asp:GridView>
@@ -1528,10 +1541,12 @@
}
function CargaGraficaBarras() {
let data = cdatos;
let newData = JSON.parse(JSON.stringify(data));
newData.sort((a, b) => a.Valor - b.Valor);
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": data,
"dataProvider": newData,
"startDuration": 2,
"valueAxes": [{
"position": "left",
@@ -1565,11 +1580,21 @@
function CargaGraficaPastel() {
let data = cdatos;
let newData = JSON.parse(JSON.stringify(data));
newData = newData.map(function (item) {
if (item.Valor < 0) {
item.Valor = Math.abs(item.Valor);
}
return item;
});
newData.sort((a, b) => b.Valor - a.Valor );
//console.log(newData);
var chart = AmCharts.makeChart("chartdiv", {
"type": "pie",
"theme": "light",
"dataProvider":
data,
newData,
"valueField": "Valor",
"titleField": "Texto",
"outlineAlpha": 0.4,
@@ -1583,11 +1608,17 @@
}
function ADSBegin() {
$('.DdlGrafica').on('select2:select', function (e) {
var data = e.params.data;
currentid = data.id;
if (currentid == 1) {
$("#chartdiv").css("height", "400px");
$("#chartdivgral").css("height", "400px");
CargaGraficaBarras();
} else {
$("#chartdiv").css("height", "700px");
$("#chartdivgral").css("height", "700px");
CargaGraficaPastel();
}
});
@@ -1752,7 +1783,9 @@
});
}
}
function initamgrafica() {
AmCharts.addInitHandler(function (chart) {
function handleCustomMarkerToggle(legendEvent) {
var dataProvider = legendEvent.chart.dataProvider;

View File

@@ -2096,20 +2096,16 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
DtGastosSubProyectoH = DtDatosSubProyectoH.FiltraParametros("Tipo ='G' ")
DTTotalesSubProyectoH = DtDatosSubProyectoH.Clone()
Dim Row As DataRow = DtIngresosSubProyectoH.NewRow
Dim TotalActual = 0.0, TotalAnterior = 0.0
Dim IndexData As Integer = 0
Dim IndexGv As Integer = 1
Dim IndexMax As Integer = 1
Dim IndexSubProyecto = 0
Dim IndexSubProyectoMax As Integer = DTSubProyectosCabecerasH.Rows.Count - 1
If IndexSubProyectoMax > GvIngresosSubProyectoH.Columns.Count - 2 Then
IndexSubProyectoMax = GvIngresosSubProyectoH.Columns.Count - 2
End If
@@ -2121,7 +2117,7 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
'34
Dim IDX_LIMPIAR As Integer = 1
For IDX_LIMPIAR = 1 To GvIngresosSubProyectoH.Columns.Count - 2
For IDX_LIMPIAR = 1 To GvIngresosSubProyectoH.Columns.Count - 3
CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).DataField = Nothing
CType(GvIngresosSubProyectoH.Columns(IDX_LIMPIAR), BoundField).HeaderText = ""
GvIngresosSubProyectoH.Columns(IDX_LIMPIAR).Visible = False
@@ -2236,13 +2232,11 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Next
Row.Item("Nombre") = "TOTAL INGRESOS "
Row.Item("ImporteActual") = DtIngresosSubProyectoH.SUM("ImporteActual", "Not CtaMayor In (3,4)") 'TotalActual.ToString
Row.Item("PorcentajeActual") = "100.00"
Row.Item("PorcentajeActual") = 100.0
Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM("ImporteAcumulado", "Not CtaMayor In (3,4)") 'TotalAnterior.ToString
Row.Item("PorcentajeAcumulado") = "100.00"
Row.Item("PorcentajeAcumulado") = 100.0
Row.Item("CtaMayor") = -1
Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico")
CountDinamicoSubProyecto = DtIngresosSubProyectoH.MAX("CountDinamico").ToEntero
@@ -2299,11 +2293,15 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
End If
Next
Dim totalTemp As Decimal = DtIngresosSubProyectoH.SUMD($"ImporteAcumulado", "Not CtaMayor In (-1,3,4)") - DtGastosSubProyectoH.SUMD($"ImporteAcumulado", "Not CtaMayor In (-1,3,4)")
Row.Item("Nombre") = "Resultado del ejercicio"
Row.Item("ImporteAcumulado") = DtIngresosSubProyectoH.SUM($"ImporteAcumulado", "Not CtaMayor In (-1,3,4)") - DtGastosSubProyectoH.SUM($"ImporteAcumulado", "Not CtaMayor In (-1,3,4)")
Row.Item("CtaMayor") = -2
Row.Item("CountDinamico") = DtIngresosSubProyectoH.MAX("CountDinamico").ToString.ToEntero
Row.Item("PorcentajeAcumulado") = If(DdlvistaPorcentaje.SelectedValue.ToEntero = 1, 100, (totalTemp * 100 / DtIngresosSubProyectoH.SUMD($"ImporteAcumulado", "Not CtaMayor In (-1,3,4)")))
DTTotalesSubProyectoH.Rows.Add(Row)
End If
@@ -2316,6 +2314,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
GvIngresosSubProyectoH.DataBind()
'GvIngresosSubProyectoH.Columns(55).Visible = True
'GvIngresosSubProyectoH.Columns(56).Visible = True
UpDatosSubProyectoH.Update()
@@ -2469,6 +2470,9 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
Dim lista As New List(Of Object)
Dim colorindex As Integer = 0
For Each campo As String() In listaCampos
'Dim valorCampo As Decimal = If(e.Row.DBCampo(campo(0)).ToDecimal() < 0, (e.Row.DBCampo(campo(0)).ToDecimal() * -1), e.Row.DBCampo(campo(0)).ToDecimal())
lista.Add(New With {.Texto = campo(1), .Valor = e.Row.DBCampo(campo(0)).ToDecimal(), .Color = listacolores(colorindex)})
colorindex = colorindex + 1
If colorindex >= listacolores.Count Then
@@ -2727,3 +2731,4 @@ Partial Class Contabilidad_RepEstadoResultadosHorizontal
End Class