E172 RepIndicadorResumen distinguir CxP segun si el Proveedor es productor o no
Modificaciones a BD: - Se actualizó PA_Comp_GetRepPS agregando dos parámetros: @CveTipoProveedor, @CveProveedorClasificacion
This commit is contained in:
@@ -34,6 +34,20 @@ Partial Class General_RepIndicadorResumen
|
||||
ViewState("CxP") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property CxP192 As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("CxP192") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("CxP192"), DataTable)
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("CxP192") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CCxC As DataTable
|
||||
Get
|
||||
@@ -124,7 +138,16 @@ Partial Class General_RepIndicadorResumen
|
||||
End If
|
||||
|
||||
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) Then
|
||||
UsuarioActual.CveEmpresa, 5, -1, -1, "-1", "-1", -1, TipoCambio:=1, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveProveedorClasificacion:=192) Then
|
||||
CxP192 = ObjCompras.DtResultados
|
||||
GvCxP192.DataSource = CxP192
|
||||
Else
|
||||
GvCxP192.DataSource = Nothing
|
||||
CxP192 = Nothing
|
||||
End If
|
||||
|
||||
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
|
||||
GvCxP.DataSource = CxP
|
||||
Else
|
||||
@@ -159,6 +182,7 @@ Partial Class General_RepIndicadorResumen
|
||||
ObjMovtos.Dispose()
|
||||
|
||||
GvVxP.DataBind()
|
||||
GvCxP192.DataBind()
|
||||
GvCxP.DataBind()
|
||||
GvCCxC.DataBind()
|
||||
GvCPxP.DataBind()
|
||||
@@ -174,6 +198,11 @@ Partial Class General_RepIndicadorResumen
|
||||
Else
|
||||
UPGraficaCxP.Visible = False
|
||||
End If
|
||||
If GvCxP192.Rows.Count > 0 Then
|
||||
UPGraficaCxP192.Visible = True
|
||||
Else
|
||||
UPGraficaCxP192.Visible = False
|
||||
End If
|
||||
If GvCCxC.Rows.Count > 0 Then
|
||||
UPGraficaCCxC.Visible = True
|
||||
Else
|
||||
@@ -186,7 +215,7 @@ Partial Class General_RepIndicadorResumen
|
||||
End If
|
||||
|
||||
' Si no había datos en ninguna tabla no cargar función de gráficos
|
||||
If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub
|
||||
If (GvVxP.Rows.Count = 0 AndAlso GvCxP.Rows.Count = 0 AndAlso GvCxP192.Rows.Count = 0 AndAlso GvCCxC.Rows.Count = 0 AndAlso GvCPxP.Rows.Count = 0) Then Exit Sub
|
||||
GraficasPastel()
|
||||
'GraficasBarras()
|
||||
End Sub
|
||||
@@ -293,7 +322,7 @@ Partial Class General_RepIndicadorResumen
|
||||
|
||||
Private Sub GraficasPastel()
|
||||
|
||||
Dim DtVxP, DtCxP, DtCCxC, DtCPxP As New DataTable
|
||||
Dim DtVxP, DtCxP, DtCxP192, DtCCxC, DtCPxP As New DataTable
|
||||
Dim RowColorIndex As Integer = 0
|
||||
|
||||
'Ventas x Producto
|
||||
@@ -320,7 +349,7 @@ Partial Class General_RepIndicadorResumen
|
||||
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()}
|
||||
|
||||
'Compras x Producto
|
||||
'Compras x Producto TipoProveedor=1
|
||||
DtCxP.Reset()
|
||||
DtCxP.Columns.Add("Texto")
|
||||
DtCxP.Columns.Add("Valor")
|
||||
@@ -344,6 +373,30 @@ Partial Class General_RepIndicadorResumen
|
||||
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()}
|
||||
|
||||
'Compras x Producto ProveedorClasificacion=192
|
||||
DtCxP192.Reset()
|
||||
DtCxP192.Columns.Add("Texto")
|
||||
DtCxP192.Columns.Add("Valor")
|
||||
DtCxP192.Columns.Add("Color")
|
||||
DtCxP192.Columns.Add("Moneda")
|
||||
RowColorIndex = 0
|
||||
For Each Dr As DataRow In CxP192.Rows
|
||||
If Not Dr("Orden").ToString = "" 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
|
||||
DtCxP192.Rows.Add(Row)
|
||||
RowColorIndex += 1
|
||||
If RowColorIndex = 17 Then
|
||||
RowColorIndex = 0
|
||||
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()}
|
||||
|
||||
'Alert(Newtonsoft.Json.JsonConvert.SerializeObject(CCxC.Rows))
|
||||
|
||||
'Cuentas por cobrar x Cliente
|
||||
@@ -395,7 +448,7 @@ Partial Class General_RepIndicadorResumen
|
||||
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()}
|
||||
|
||||
'Serializar datos agrupándolos en su respectivo DataTable, todos en un solo JSON
|
||||
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(New With {.VxP = query_vxp, .CxP = query_cxp, .CCxC = query_ccxc, .CPxP = query_cpxp})
|
||||
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)
|
||||
RegistraScript($"CargaGraficasPastel({json})", "22")
|
||||
|
||||
Reference in New Issue
Block a user