E172 Rep Indicadores revertir agrupado de dlls/pesos, sumar en MN en datatables
This commit is contained in:
@@ -594,11 +594,11 @@
|
|||||||
//AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, type: "serial", dataProvider: json["VxP"] }); // Ventas x Producto
|
//AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, type: "serial", dataProvider: json["VxP"] }); // Ventas x Producto
|
||||||
|
|
||||||
$('#' + "chartdiv_vxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["VxP"]) }] })
|
$('#' + "chartdiv_vxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["VxP"]) }] })
|
||||||
//$('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], type: 'pie', data: customAccessor(json["CompProductores"]) }] })
|
$('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], type: 'pie', data: customAccessor(json["CompProductores"]) }] })
|
||||||
//$('#' + "chartdiv_compacreed").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CompAcreed"]) }] })
|
$('#' + "chartdiv_compacreed").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CompAcreed"]) }] })
|
||||||
//$('#' + "chartdiv_cxp192").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP192"]) }] })
|
$('#' + "chartdiv_cxp192").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP192"]) }] })
|
||||||
//$('#' + "chartdiv_cxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP"]) }] })
|
$('#' + "chartdiv_cxp").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxP"]) }] })
|
||||||
//$('#' + "chartdiv_cxc").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxC"]) }, { type: 'line', data: customAccessor(json["CxCR"]) }] })
|
$('#' + "chartdiv_cxc").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], data: customAccessor(json["CxC"]) }, { type: 'line', data: customAccessor(json["CxCR"]) }] })
|
||||||
|
|
||||||
function customAccessor(data) {
|
function customAccessor(data) {
|
||||||
const newData = [];
|
const newData = [];
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ Partial Class General_RepIndicadorResumen
|
|||||||
'DtVxP.Columns.Add("Color")
|
'DtVxP.Columns.Add("Color")
|
||||||
DtVxP.Columns.Add("Unidad")
|
DtVxP.Columns.Add("Unidad")
|
||||||
'RowColorIndex = 0
|
'RowColorIndex = 0
|
||||||
If GvVxP.DataSource IsNot Nothing Then
|
|
||||||
For Each Dr As DataRow In CType(GvVxP.DataSource, DataTable).FiltraParametros("", "SubTotalMN DESC").Rows
|
For Each Dr As DataRow In CType(GvVxP.DataSource, DataTable).FiltraParametros("", "SubTotalMN DESC").Rows
|
||||||
If Not Dr("Orden").ToString = "" Then
|
If Not Dr("Orden").ToString = "" Then
|
||||||
Dim Row = DtVxP.NewRow()
|
Dim Row = DtVxP.NewRow()
|
||||||
@@ -206,16 +205,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
'End If
|
'End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
Dim vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim group_vxp = vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
'Dim vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
.Texto = g.Key,
|
||||||
'Dim group_vxp = vxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
' .Texto = g.Key,
|
.Unidad = "MXN"
|
||||||
' .Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
}).ToDataTable
|
||||||
' .Unidad = "MXN"
|
Dim top_vxp = From s In group_vxp.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
'}).ToDataTable
|
Dim resto_vxp = From s In group_vxp.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim top_vxp = From s In DtVxP.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
|
||||||
Dim resto_vxp = From s In DtVxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .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),
|
||||||
@@ -238,8 +235,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
Row("Unidad") = "Kg"
|
Row("Unidad") = "Kg"
|
||||||
DtCompProductores.Rows.Add(Row)
|
DtCompProductores.Rows.Add(Row)
|
||||||
Next
|
Next
|
||||||
Dim top_comp_productores = From s In DtCompProductores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_comp_productores = From s In DtCompProductores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_comp_productores = comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_comp_productores = From s In group_comp_productores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_comp_productores = From s In group_comp_productores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_comp_productores = resto_comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_comp_productores = resto_comp_productores.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),
|
||||||
@@ -261,8 +264,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCompAcreed.Rows.Add(Row)
|
DtCompAcreed.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_comp_acreed = From s In DtCompAcreed.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim comp_acreed = From s In DtCompAcreed.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_comp_acreed = From s In DtCompAcreed.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_comp_acreed = comp_acreed.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_comp_acreed = From s In group_comp_acreed.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_comp_acreed = From s In group_comp_acreed.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_comp_acreed = resto_comp_acreed.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_comp_acreed = resto_comp_acreed.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),
|
||||||
@@ -284,8 +293,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCxC.Rows.Add(Row)
|
DtCxC.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_cxc = From s In DtCxC.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim cxc = From s In DtCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_cxc = From s In DtCxC.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_cxc = cxc.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_cxc = From s In group_cxc.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cxc = From s In group_cxc.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_cxc = resto_cxc.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_cxc = resto_cxc.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),
|
||||||
@@ -308,8 +323,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCxCR.Rows.Add(Row)
|
DtCxCR.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_cxcr = From s In DtCxCR.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim cxcr = From s In DtCxCR.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_cxcr = From s In DtCxCR.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_cxcr = cxcr.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_cxcr = From s In group_cxcr.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cxcr = From s In group_cxcr.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_cxcr = resto_cxcr.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_cxcr = resto_cxcr.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),
|
||||||
@@ -331,8 +352,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCxP192.Rows.Add(Row)
|
DtCxP192.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Dim top_cxp192 = From s In DtCxP192.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_cxp192 = From s In DtCxP192.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_cxp192 = cxp192.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_cxp192 = From s In group_cxp192.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cxp192 = From s In group_cxp192.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim group_resto_cxp192 = resto_cxp192.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
Dim group_resto_cxp192 = resto_cxp192.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),
|
||||||
@@ -354,8 +381,14 @@ Partial Class General_RepIndicadorResumen
|
|||||||
DtCxP.Rows.Add(Row)
|
DtCxP.Rows.Add(Row)
|
||||||
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(), .Unidad = s("Unidad").ToString()}
|
Dim cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
Dim resto_cxp = From s In DtCxP.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
Dim group_cxp = cxp.GroupBy(Function(x) x.Texto).[Select](Function(g) New With {
|
||||||
|
.Texto = g.Key,
|
||||||
|
.Valor = Math.Round(g.Sum(Function(x) x.Valor), 2),
|
||||||
|
.Unidad = "MXN"
|
||||||
|
}).ToDataTable
|
||||||
|
Dim top_cxp = From s In group_cxp.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Unidad = s("Unidad").ToString()}
|
||||||
|
Dim resto_cxp = From s In group_cxp.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Valor = s("Valor").ToString().ToDouble(), .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),
|
||||||
|
|||||||
Reference in New Issue
Block a user