@@ -495,7 +504,7 @@
AmCharts.makeChart("chartdiv_cxp192", { ...chartconfig, dataProvider: json["CxP192"] }); // Compras x Producto ProveedorClasificacion 192
AmCharts.makeChart("chartdiv_ccxc", { ...chartconfig, dataProvider: json["CCxC"] }); // Cuentas por Cobrar x Cliente
AmCharts.makeChart("chartdiv_cpxp", { ...chartconfig, dataProvider: json["CPxP"] }); // Cuentas por Pagar x Proveedor
- // AmCharts.makeChart("chartdiv_indicadores", { ...chartconfig, dataProvider: json["Indicadores"] }); // Indicadores por Proveedor
+ // AmCharts.makeChart("chartdiv_indicadores", { ...chartconfig, dataProvider: json["Indicadores"] }); // Indicadores por Proveedor Productor
document.getElementById('amChartsAttribution').style.visibility = 'visible';
}
diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb
index f25a5be80..29e79f3e9 100644
--- a/General/RepIndicadorResumen.aspx.vb
+++ b/General/RepIndicadorResumen.aspx.vb
@@ -77,6 +77,22 @@ Partial Class General_RepIndicadorResumen
ViewState("CPxP") = value
End Set
End Property
+#If False Then
+ Private Property gv1 As DataTable
+ Get
+
+ If ViewState("gv1") Is Nothing Then
+ Return New DataTable
+ Else
+ Return DirectCast(ViewState("gv1"), DataTable)
+ End If
+
+ End Get
+ Set(value As DataTable)
+ ViewState("gv1") = value
+ End Set
+ End Property
+#End If
Private Property Indicadores As DataTable
Get
@@ -146,6 +162,8 @@ Partial Class General_RepIndicadorResumen
If ObjVentas.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), MinFecha, MaxFecha, -1,
-1, -1, -1, -1, "-1", UsuarioActual.CveEmpresa, 5, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoCambio:=1) Then
VxP = ObjVentas.DtResultados
+ VxP.DefaultView.Sort = "CveMoneda,SubTotal DESC"
+ VxP = VxP.DefaultView.ToTable
GvVxP.DataSource = VxP
Else
GvVxP.DataSource = Nothing
@@ -155,6 +173,8 @@ Partial Class General_RepIndicadorResumen
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
CxP192 = ObjCompras.DtResultados
+ CxP192.DefaultView.Sort = "CveMoneda,SubTotal DESC"
+ CxP192 = CxP192.DefaultView.ToTable
GvCxP192.DataSource = CxP192
Else
GvCxP192.DataSource = Nothing
@@ -164,6 +184,8 @@ Partial Class General_RepIndicadorResumen
If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveTipoProveedor:=1) Then
CxP = ObjCompras.DtResultados
+ CxP.DefaultView.Sort = "CveMoneda,SubTotal DESC"
+ CxP = CxP.DefaultView.ToTable
GvCxP.DataSource = CxP
Else
GvCxP.DataSource = Nothing
@@ -176,6 +198,8 @@ Partial Class General_RepIndicadorResumen
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
CCxC = ObjMovtos.DtResultados
+ CCxC.DefaultView.Sort = "CveMoneda,Saldo DESC"
+ CCxC = CCxC.DefaultView.ToTable
GvCCxC.DataSource = CCxC
Else
GvCCxC.DataSource = Nothing
@@ -186,15 +210,28 @@ Partial Class General_RepIndicadorResumen
"-1", "-1", "-1", FechaCorte:=FechaCorte.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
CPxP = ObjMovtos.DtResultados
+ CPxP.DefaultView.Sort = "CveMoneda,Saldo DESC"
+ CPxP = CPxP.DefaultView.ToTable
GvCPxP.DataSource = CPxP
Else
GvCPxP.DataSource = Nothing
CPxP = Nothing
End If
- If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa) Then
+ 'If ObjCompras.GetRepProductosServicios(-1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, TxtFechaI.Text.Trim(), TxtFechaF.Text.Trim(), -1, -1, -1,
+ ' UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
+ ' gv1 = ObjCompras.DtResultados
+ ' GridView1.DataSource = gv1
+ 'Else
+ ' GridView1.DataSource = Nothing
+ ' gv1 = Nothing
+ 'End If
+
+ If ObjCitrus.GetIndicadores(UsuarioActual.CveEmpresa, TxtFechaI.Text, TxtFechaF.Text) Then
Indicadores = ObjCitrus.DtResultados
+ Indicadores.DefaultView.Sort = "Saldo DESC"
+ Indicadores = Indicadores.DefaultView.ToTable
GvIndicadores.DataSource = Indicadores
Else
GvIndicadores.DataSource = Nothing
@@ -209,6 +246,7 @@ Partial Class General_RepIndicadorResumen
GvVxP.DataBind()
GvCxP192.DataBind()
GvCxP.DataBind()
+ 'GridView1.DataBind()
GvCCxC.DataBind()
GvCPxP.DataBind()
GvIndicadores.DataBind()
@@ -259,8 +297,19 @@ Partial Class General_RepIndicadorResumen
End Sub
Protected Sub GvCxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- If e.Row.DBCampo("Orden") = "" Then
+ 'e.Row.Cells(0).Text = e.Row.DBCampo("Orden")
+ If e.Row.DBCampo("Orden") = "00ND" Then
e.Row.CssClass = "Totales"
+ e.Row.Cells(0).Text = "Total " + e.Row.DBCampo("Abreviatura")
+ End If
+ End If
+ End Sub
+ Protected Sub GvCxP192_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCxP192.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ 'e.Row.Cells(0).Text = e.Row.DBCampo("Orden")
+ If e.Row.DBCampo("Orden") = "00ND" Then
+ e.Row.CssClass = "Totales"
+ e.Row.Cells(0).Text = "Total " + e.Row.DBCampo("Abreviatura")
End If
End If
End Sub
@@ -269,6 +318,8 @@ Partial Class General_RepIndicadorResumen
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
+ 'TODO: Sería mejor usar la Abreviatura de la tabla, pero habría que extender PA_Comp_RepCxP para incluir la columna Abreviatura
+ e.Row.Cells(2).Text = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {e.Row.DBCampo("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
End If
End Sub
Protected Sub GvCPxP_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCPxP.RowDataBound
@@ -276,6 +327,8 @@ Partial Class General_RepIndicadorResumen
If e.Row.DBCampo("Orden") = "" Then
e.Row.CssClass = "Totales"
End If
+ 'TODO: Sería mejor usar la Abreviatura de la tabla, pero habría que extender PA_Comp_RepCxP para incluir la columna Abreviatura
+ e.Row.Cells(2).Text = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {e.Row.DBCampo("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
End If
End Sub
Protected Sub GvIndicadores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvIndicadores.RowDataBound
@@ -377,7 +430,7 @@ Partial Class General_RepIndicadorResumen
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
- Row("Moneda") = Dr("Moneda").ToString
+ Row("Moneda") = Dr("Abreviatura").ToString
DtVxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
@@ -385,7 +438,7 @@ Partial Class General_RepIndicadorResumen
End If
End If
Next
- Dim query_vxp = From s In DtVxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
+ Dim query_vxp = From s In DtVxP.AsEnumerable().Take(25) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Compras x Producto TipoProveedor=1
DtCxP.Reset()
@@ -395,13 +448,13 @@ Partial Class General_RepIndicadorResumen
DtCxP.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CxP.Rows
- If Not Dr("Orden").ToString = "" Then
+ If Not Dr("Orden").ToString = "00ND" Then
Dim Row As DataRow = Nothing
Row = DtCxP.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
- Row("Moneda") = Dr("Moneda").ToString
+ Row("Moneda") = Dr("Abreviatura").ToString
DtCxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
@@ -409,7 +462,7 @@ Partial Class General_RepIndicadorResumen
End If
End If
Next
- Dim query_cxp = From s In DtCxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
+ Dim query_cxp = From s In DtCxP.AsEnumerable().Take(25) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Compras x Producto ProveedorClasificacion=192
DtCxP192.Reset()
@@ -419,13 +472,13 @@ Partial Class General_RepIndicadorResumen
DtCxP192.Columns.Add("Moneda")
RowColorIndex = 0
For Each Dr As DataRow In CxP192.Rows
- If Not Dr("Orden").ToString = "" Then
+ If Not Dr("Orden").ToString = "00ND" Then
Dim Row As DataRow = Nothing
Row = DtCxP192.NewRow()
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("SubTotal").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
- Row("Moneda") = Dr("Moneda").ToString
+ Row("Moneda") = Dr("Abreviatura").ToString
DtCxP192.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
@@ -433,7 +486,7 @@ Partial Class General_RepIndicadorResumen
End If
End If
Next
- Dim query_cxp192 = From s In DtCxP192.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
+ Dim query_cxp192 = From s In DtCxP192.AsEnumerable().Take(25) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
@@ -451,7 +504,7 @@ Partial Class General_RepIndicadorResumen
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
- Row("Moneda") = Dr("Moneda").ToString
+ Row("Moneda") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
DtCCxC.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
@@ -459,7 +512,7 @@ Partial Class General_RepIndicadorResumen
End If
End If
Next
- Dim query_ccxc = From s In DtCCxC.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
+ Dim query_ccxc = From s In DtCCxC.AsEnumerable().Take(25) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'Cuentas por pagar x Proveedor
DtCPxP.Reset()
@@ -475,7 +528,7 @@ Partial Class General_RepIndicadorResumen
Row("Texto") = $"{Dr("GPO").ToString} {GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
Row("Valor") = Dr("Saldo").ToString.FormatoNumero
Row("Color") = DtColor.Rows(RowColorIndex)("Color").ToString
- Row("Moneda") = Dr("Moneda").ToString
+ Row("Moneda") = $"{GlobalDTMonedas().FiltraParametros($"CveMoneda = {Dr("CveMoneda").ToString}").Rows(0)("Abreviatura").ToString}"
DtCPxP.Rows.Add(Row)
RowColorIndex += 1
If RowColorIndex = 17 Then
@@ -483,11 +536,11 @@ Partial Class General_RepIndicadorResumen
End If
End If
Next
- Dim query_cpxp = From s In DtCPxP.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
+ Dim query_cpxp = From s In DtCPxP.AsEnumerable().Take(25) Select New With {.Texto = s("Texto").ToString(), .Valor = s("Valor").ToString().ToDouble(), .Color = s("Color").ToString(), .Moneda = s("Moneda").ToString()}
'TODO: Indicadores x Proveedor -- Determinar qué poner en la gráfica con E172
- 'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON
+ 'Serializar datos agrupándolos por su respectivo DataTable, todos en un solo JSON
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CxP192 = query_cxp192, .CCxC = query_ccxc, .CPxP = query_cpxp})
'Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CCxC = New String() {}})
'Alert(json)