E172 Rep Indicadores - Compras Productores Gráfica por Kg, ordenar y agrupar (top 10 y resto) correctamente en todas las tablas
This commit is contained in:
@@ -202,7 +202,7 @@
|
|||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
<i class="icon-pin font-green"></i>
|
<i class="icon-pin font-green"></i>
|
||||||
<span id="Span9" runat="server" class="caption-subject bold uppercase">Compras por Productos - Proveedor Productor - Gráfica </span>
|
<span id="Span9" runat="server" class="caption-subject bold uppercase">Compras Productores - Gráfica por Cantidad(Kg) </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -313,7 +313,7 @@
|
|||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption font-green">
|
<div class="caption font-green">
|
||||||
<i class="icon-pin font-green"></i>
|
<i class="icon-pin font-green"></i>
|
||||||
<span id="Span5" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar por Cliente - Gráfica </span>
|
<span id="Span5" runat="server" class="caption-subject bold uppercase">Cuentas por cobrar - Gráfica </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -441,12 +441,18 @@
|
|||||||
title: {
|
title: {
|
||||||
text: null
|
text: null
|
||||||
},
|
},
|
||||||
|
labels: {
|
||||||
|
//format: '${y} Kg'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
formatter: function (tooltip) {
|
formatter: function (tooltip) {
|
||||||
var tooltiptext = tooltip.defaultFormatter.call(this, tooltip);
|
var tooltiptext = tooltip.defaultFormatter.call(this, tooltip);
|
||||||
tooltiptext = tooltiptext.replace("<b>", "<b>$");
|
var isCurrency = /^(\d|-)?(\d|,)*\.?\d*$/.test(/<b>(.*?)<\/b>/.exec(tooltiptext));
|
||||||
tooltiptext = tooltiptext.replace("</b>", " " + this.point.currency + "</b>");
|
if (isCurrency) {
|
||||||
|
tooltiptext = tooltiptext.replace("<b>", "<b>$");
|
||||||
|
}
|
||||||
|
tooltiptext = tooltiptext.replace("</b>", " " + this.point.unit + "</b>");
|
||||||
console.log(tooltiptext)
|
console.log(tooltiptext)
|
||||||
return tooltiptext
|
return tooltiptext
|
||||||
},
|
},
|
||||||
@@ -466,11 +472,11 @@
|
|||||||
type: "bar",
|
type: "bar",
|
||||||
dataLabels: {
|
dataLabels: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
// format: '${y}'
|
// format: '${y}'
|
||||||
formatter: function () {
|
formatter: function () {
|
||||||
var defaultlabel = Highcharts.getOptions().plotOptions[this.point.series.type].dataLabels.formatter.call(this);
|
var defaultlabel = Highcharts.getOptions().plotOptions[this.point.series.type].dataLabels.formatter.call(this);
|
||||||
var isNumber = /^(\d|-)?(\d|,)*\.?\d*$/.test(defaultlabel);
|
var isCurrency = /^(\d|-)?(\d|,)*\.?\d*$/.test(defaultlabel);
|
||||||
return isNumber ? "$" + defaultlabel : defaultlabel;
|
return isCurrency ? "$" + defaultlabel : defaultlabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -478,7 +484,7 @@
|
|||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
keys: ['name', 'y', 'color', 'currency'],
|
keys: ['name', 'y', 'color', 'unit'],
|
||||||
data: undefined
|
data: undefined
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -501,7 +507,7 @@
|
|||||||
function customAccessor(data) {
|
function customAccessor(data) {
|
||||||
const newData = [];
|
const newData = [];
|
||||||
data.forEach(function (point, index) {
|
data.forEach(function (point, index) {
|
||||||
newData.push([point.Texto, point.Valor, point.Color, point.Moneda]);
|
newData.push([point.Texto, point.Valor, point.Color, point.Unidad]);
|
||||||
});
|
});
|
||||||
return newData;
|
return newData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,11 +96,10 @@ Partial Class General_RepIndicadorResumen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, UsuarioActual.CveUsuario, DdlSubProyecto.SelectedValue.ToEntero) Then
|
If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text, UsuarioActual.CveUsuario, DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||||
'ObjCitrus.DTSetResultados.Tables(0).DefaultView.Sort = "CveMoneda,SubTotal DESC"
|
ObjCitrus.DTSetResultados.Tables(0).DefaultView.Sort = "Cantidad DESC"
|
||||||
GvCxP192.DataSource = ObjCitrus.DTSetResultados.Tables(0).DefaultView.ToTable
|
GvCxP192.DataSource = ObjCitrus.DTSetResultados.Tables(0).DefaultView.ToTable
|
||||||
'ObjCitrus.DTSetResultados.Tables(1).DefaultView.Sort = "CveMoneda,SubTotal DESC"
|
ObjCitrus.DTSetResultados.Tables(1).DefaultView.Sort = "Moneda,SubTotal DESC"
|
||||||
GvComprasAcreed.DataSource = ObjCitrus.DTSetResultados.Tables(1).DefaultView.ToTable
|
GvComprasAcreed.DataSource = ObjCitrus.DTSetResultados.Tables(1).DefaultView.ToTable
|
||||||
'GvCPxP.DataSource = ObjCitrus.DTSetResultados.Tables(1).DefaultView.ToTable
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -112,10 +111,11 @@ Partial Class General_RepIndicadorResumen
|
|||||||
GvCxP192.DataBind()
|
GvCxP192.DataBind()
|
||||||
GvComprasAcreed.DataBind()
|
GvComprasAcreed.DataBind()
|
||||||
GvCCxC.DataBind()
|
GvCCxC.DataBind()
|
||||||
'GvCCxC.HeaderRow.Cells(1).Text = "<a href=""/CxC/RepCxC.aspx"" target=""_blank"">Saldo</a>"
|
If GvCCxC.DataSource IsNot Nothing Then
|
||||||
|
GvCCxC.HeaderRow.Cells(1).Text = "<a href=""/CxC/RepCxC.aspx"" target=""_blank"">Saldo</a>"
|
||||||
|
End If
|
||||||
GvCPxP.DataBind()
|
GvCPxP.DataBind()
|
||||||
|
|
||||||
|
|
||||||
'Mostrar gráficos solo si hay datos en su respectiva tabla
|
'Mostrar gráficos solo si hay datos en su respectiva tabla
|
||||||
If GvVxP.Rows.Count > 0 Then
|
If GvVxP.Rows.Count > 0 Then
|
||||||
UPGraficaVxP.Visible = True
|
UPGraficaVxP.Visible = True
|
||||||
@@ -279,7 +279,7 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtVxP.Columns.Add("Texto")
|
DtVxP.Columns.Add("Texto")
|
||||||
DtVxP.Columns.Add("Valor")
|
DtVxP.Columns.Add("Valor")
|
||||||
DtVxP.Columns.Add("Color")
|
DtVxP.Columns.Add("Color")
|
||||||
DtVxP.Columns.Add("Moneda")
|
DtVxP.Columns.Add("Unidad")
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
For Each Dr As DataRow In GvVxP.DataSource.Rows
|
For Each Dr As DataRow In GvVxP.DataSource.Rows
|
||||||
If Not Dr("Orden").ToString = "" Then
|
If Not Dr("Orden").ToString = "" Then
|
||||||
@@ -288,7 +288,7 @@ Partial Class General_RepIndicadorResumen
|
|||||||
Row("Texto") = Dr("GPO").ToString
|
Row("Texto") = Dr("GPO").ToString
|
||||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||||
Row("Moneda") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Unidad") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||||
DtVxP.Rows.Add(Row)
|
DtVxP.Rows.Add(Row)
|
||||||
RowColorIndex += 1
|
RowColorIndex += 1
|
||||||
If RowColorIndex = 17 Then
|
If RowColorIndex = 17 Then
|
||||||
@@ -296,34 +296,34 @@ Partial Class General_RepIndicadorResumen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_vxp = From s In DtVxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim top_vxp = From s In DtVxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_vxp = From s In DtVxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim resto_vxp = From s In DtVxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_vxp = resto_vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_vxp = resto_vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
.Texto = "Otros",
|
.Texto = "Otros",
|
||||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
.Color = "#000000",
|
.Color = "#000000",
|
||||||
.Moneda = "MXN"
|
.Unidad = "MXN"
|
||||||
})
|
})
|
||||||
Dim query_vxp = top_vxp.Union(group_resto_vxp)
|
Dim query_vxp = top_vxp.Union(group_resto_vxp)
|
||||||
'Dim query_vxp = top_vxp.Concat(From e In resto_vxp Group e By e.Texto Into gpo = Group)
|
'Dim query_vxp = top_vxp.Concat(From e In resto_vxp Group e By e.Texto Into gpo = Group)
|
||||||
'Dim group_resto_vxp = From e In resto_vxp Group e By e.Texto Into gpo = Group
|
'Dim group_resto_vxp = From e In resto_vxp Group e By e.Texto Into gpo = Group
|
||||||
'Dim group_resto_vxp = resto_vxp.GroupBy(Function(e) New With {Key e.Texto, Key e.Valor, Key e.Color, Key e.Moneda}).ToList()
|
'Dim group_resto_vxp = resto_vxp.GroupBy(Function(e) New With {Key e.Texto, Key e.Valor, Key e.Color, Key e.Unidad}).ToList()
|
||||||
|
|
||||||
'Compras x Producto TipoProveedor=1 Acreedores (Gastos)
|
'Compras x Producto TipoProveedor=1 Acreedores (Gastos)
|
||||||
DtCxP.Reset()
|
DtCxP.Reset()
|
||||||
DtCxP.Columns.Add("Texto")
|
DtCxP.Columns.Add("Texto")
|
||||||
DtCxP.Columns.Add("Valor")
|
DtCxP.Columns.Add("Valor")
|
||||||
DtCxP.Columns.Add("Color")
|
DtCxP.Columns.Add("Color")
|
||||||
DtCxP.Columns.Add("Moneda")
|
DtCxP.Columns.Add("Unidad")
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
For Each Dr As DataRow In GvComprasAcreed.DataSource.Rows
|
For Each Dr As DataRow In GvComprasAcreed.DataSource.Rows
|
||||||
If Dr("CveClasificacion").ToString <> "" Then
|
If Dr("CveClasificacion").ToString <> "" Then
|
||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
Row = DtCxP.NewRow()
|
Row = DtCxP.NewRow()
|
||||||
Row("Texto") = Dr("Clasificacion").ToString ' $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Texto") = Dr("Clasificacion").ToString
|
||||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
||||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||||
Row("Moneda") = Dr("Moneda").ToString
|
Row("Unidad") = Dr("Moneda").ToString
|
||||||
DtCxP.Rows.Add(Row)
|
DtCxP.Rows.Add(Row)
|
||||||
RowColorIndex += 1
|
RowColorIndex += 1
|
||||||
If RowColorIndex = 17 Then
|
If RowColorIndex = 17 Then
|
||||||
@@ -331,13 +331,13 @@ Partial Class General_RepIndicadorResumen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_cxp = From s In DtCxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim top_cxp = From s In DtCxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_cxp = From s In DtCxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim resto_cxp = From s In DtCxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_cxp = resto_cxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_cxp = resto_cxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
.Texto = "Otros",
|
.Texto = "Otros",
|
||||||
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
.Color = "#000000",
|
.Color = "#000000",
|
||||||
.Moneda = "MXN"
|
.Unidad = "MXN"
|
||||||
})
|
})
|
||||||
Dim query_cxp = top_cxp.Union(group_resto_cxp)
|
Dim query_cxp = top_cxp.Union(group_resto_cxp)
|
||||||
|
|
||||||
@@ -346,22 +346,30 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCxP192.Columns.Add("Texto")
|
DtCxP192.Columns.Add("Texto")
|
||||||
DtCxP192.Columns.Add("Valor")
|
DtCxP192.Columns.Add("Valor")
|
||||||
DtCxP192.Columns.Add("Color")
|
DtCxP192.Columns.Add("Color")
|
||||||
DtCxP192.Columns.Add("Moneda")
|
DtCxP192.Columns.Add("Unidad")
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
For Each Dr As DataRow In GvCxP192.DataSource.Rows
|
For Each Dr As DataRow In GvCxP192.DataSource.Rows
|
||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
Row = DtCxP192.NewRow()
|
Row = DtCxP192.NewRow()
|
||||||
Row("Texto") = $"{Dr("RazonSocial").ToString}"
|
Row("Texto") = Dr("RazonSocial").ToString
|
||||||
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
|
Row("Valor") = Dr("Cantidad").ToString.FormatoNumero
|
||||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||||
'Row("Moneda") = "MXN"
|
Row("Unidad") = "Kg"
|
||||||
DtCxP192.Rows.Add(Row)
|
DtCxP192.Rows.Add(Row)
|
||||||
RowColorIndex += 1
|
RowColorIndex += 1
|
||||||
If RowColorIndex = 17 Then
|
If RowColorIndex = 17 Then
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim query_cxp192 = From s In DtCxP192.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim top_cxp192 = From s In DtCxP192.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cxp192 = From s In DtCxP192.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim group_resto_cxp192 = resto_cxp192.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = "Otros",
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Color = "#000000",
|
||||||
|
.Unidad = "MXN"
|
||||||
|
})
|
||||||
|
Dim query_cxp192 = top_cxp192.Union(group_resto_cxp192)
|
||||||
|
|
||||||
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
|
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
|
||||||
|
|
||||||
@@ -370,16 +378,16 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCCxC.Columns.Add("Texto")
|
DtCCxC.Columns.Add("Texto")
|
||||||
DtCCxC.Columns.Add("Valor")
|
DtCCxC.Columns.Add("Valor")
|
||||||
DtCCxC.Columns.Add("Color")
|
DtCCxC.Columns.Add("Color")
|
||||||
DtCCxC.Columns.Add("Moneda")
|
DtCCxC.Columns.Add("Unidad")
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
For Each Dr As DataRow In GvCCxC.DataSource.Rows
|
For Each Dr As DataRow In GvCCxC.DataSource.Rows
|
||||||
If Not Dr("Orden").ToString = "" Then
|
If Not Dr("Orden").ToString = "" Then
|
||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
Row = DtCCxC.NewRow()
|
Row = DtCCxC.NewRow()
|
||||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Texto") = Dr("GPO").ToString
|
||||||
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
||||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||||
Row("Moneda") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Unidad") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||||
DtCCxC.Rows.Add(Row)
|
DtCCxC.Rows.Add(Row)
|
||||||
RowColorIndex += 1
|
RowColorIndex += 1
|
||||||
If RowColorIndex = 17 Then
|
If RowColorIndex = 17 Then
|
||||||
@@ -387,14 +395,22 @@ Partial Class General_RepIndicadorResumen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim query_ccxc = From s In DtCCxC.AsEnumerable().Take(20) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim top_ccxc = From s In DtCCxC.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_ccxc = From s In DtCCxC.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim group_resto_ccxc = resto_ccxc.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = "Otros",
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Color = "#000000",
|
||||||
|
.Unidad = "MXN"
|
||||||
|
})
|
||||||
|
Dim query_ccxc = top_ccxc.Union(group_resto_ccxc)
|
||||||
|
|
||||||
'Cuentas por pagar x Proveedor
|
'Cuentas por pagar x Proveedor
|
||||||
DtCPxP.Reset()
|
DtCPxP.Reset()
|
||||||
DtCPxP.Columns.Add("Texto")
|
DtCPxP.Columns.Add("Texto")
|
||||||
DtCPxP.Columns.Add("Valor")
|
DtCPxP.Columns.Add("Valor")
|
||||||
DtCPxP.Columns.Add("Color")
|
DtCPxP.Columns.Add("Color")
|
||||||
DtCPxP.Columns.Add("Moneda")
|
DtCPxP.Columns.Add("Unidad")
|
||||||
RowColorIndex = 0
|
RowColorIndex = 0
|
||||||
For Each Dr As DataRow In GvCPxP.DataSource.Rows
|
For Each Dr As DataRow In GvCPxP.DataSource.Rows
|
||||||
If Not Dr("Orden").ToString = "" Then
|
If Not Dr("Orden").ToString = "" Then
|
||||||
@@ -403,7 +419,7 @@ Partial Class General_RepIndicadorResumen
|
|||||||
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||||
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
|
||||||
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
|
||||||
Row("Moneda") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
Row("Unidad") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
|
||||||
DtCPxP.Rows.Add(Row)
|
DtCPxP.Rows.Add(Row)
|
||||||
RowColorIndex += 1
|
RowColorIndex += 1
|
||||||
If RowColorIndex = 17 Then
|
If RowColorIndex = 17 Then
|
||||||
@@ -411,7 +427,15 @@ Partial Class General_RepIndicadorResumen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim query_cpxp = From s In DtCPxP.AsEnumerable().Take(20) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
|
Dim top_cpxp = From s In DtCPxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cpxp = From s In DtCPxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim group_resto_cpxp = resto_cpxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = "Otros",
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Color = "#000000",
|
||||||
|
.Unidad = "MXN"
|
||||||
|
})
|
||||||
|
Dim query_cpxp = top_cpxp.Union(group_resto_cpxp)
|
||||||
|
|
||||||
'TODO: Indicadores x Proveedor -- Determinar qué poner en la gráfica con E172
|
'TODO: Indicadores x Proveedor -- Determinar qué poner en la gráfica con E172
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user