Cambios en reportes de utilidad

This commit is contained in:
Raul Pimienta
2019-08-28 11:33:43 -07:00
parent f01f6ed68d
commit cad0f0c45d
3 changed files with 572 additions and 46 deletions

View File

@@ -136,6 +136,12 @@ Partial Class Ventas_RepVentasUtilidadPadre
LblNeto.Text = Neto.ToString("N2")
LblPorNeto.Text = PorNeto.ToString("N2")
End If
LblNombreRentabilidad.Text = "Rentabilidad"
DivClaseRentabilidad.Attributes.Add("class", "dashboard-stat dashboard-stat-v2 green")
LblRentabilidadIndicador.Attributes.Add("data-original-title", "Rentabilidad")
LblRentabilidad.Text = DtDatos.Rows(0)("Rentabilidad").ToString.ToDouble.ToString("N2")
End If
ObjVentas.Dispose()
@@ -161,26 +167,52 @@ Partial Class Ventas_RepVentasUtilidadPadre
LblTituloGrafica.Text = $"Agrupado por: {Agrupador}"
RegistraScript("$('#DivModalGrafica').modal('show')")
Dim Dt As New DataTable()
Dt.Columns.Add("gpo")
Dt.Columns.Add("utilidad")
Dt.Columns.Add("perdida")
For Each Dr As DataRow In DtDatos.Rows
If Dr("GPO").ToString <> "" Then
Dim Row As DataRow = Nothing
Row = Dt.NewRow()
Row("gpo") = Dr("GPO").ToString
Row("utilidad") = Dr("Utilidad").ToString.FormatoNumero
Row("perdida") = Dr("Perdida").ToString.FormatoNumero
Dt.Rows.Add(Row)
End If
Next
CargaGrafica()
End Sub
Private Sub CargaGrafica()
If DdlVer.SelectedValue.ToEntero = 1 Then
Dim Dt As New DataTable()
Dt.Columns.Add("gpo")
Dt.Columns.Add("neto")
For Each Dr As DataRow In DtDatos.Rows
If Dr("GPO").ToString <> "" Then
Dim Row As DataRow = Nothing
Row = Dt.NewRow()
Row("gpo") = Dr("GPO").ToString
Row("neto") = Dr("Neto").ToString.FormatoNumero
Dt.Rows.Add(Row)
End If
Next
Dim query = From s In Dt.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .neto = s("neto").ToString().ToDouble()}
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
RegistraScript($"CargaGraficaBarrasNeto({json})", "22")
ElseIf DdlVer.SelectedValue.ToEntero = 2 Then
Dim Dt2 As New DataTable()
Dt2.Columns.Add("gpo")
Dt2.Columns.Add("rentabilidad")
For Each Dr As DataRow In DtDatos.Rows
If Dr("GPO").ToString <> "" Then
Dim Row As DataRow = Nothing
Row = Dt2.NewRow()
Row("gpo") = Dr("GPO").ToString
Row("rentabilidad") = Dr("Rentabilidad").ToString.FormatoNumero
Dt2.Rows.Add(Row)
End If
Next
Dim query2 = From s In Dt2.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .rentabilidad = s("rentabilidad").ToString().ToDouble()}
Dim json2 As String = Newtonsoft.Json.JsonConvert.SerializeObject(query2)
RegistraScript($"CargaGraficaBarrasRentabilidad({json2})", "23")
End If
Dim query = From s In Dt.AsEnumerable() Select New With {.gpo = s("gpo").ToString(), .utilidad = s("utilidad").ToString().ToDouble(), .perdida = s("perdida").ToString().ToDouble}
Dim json As String = Newtonsoft.Json.JsonConvert.SerializeObject(query)
RegistraScript($"CargaGraficaCompracion({json})", "22")
UPModalProd.Update()
End Sub
Protected Sub DdlVer_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaGrafica()
End Sub
#End Region
@@ -197,7 +229,12 @@ Partial Class Ventas_RepVentasUtilidadPadre
e.Row.DBCampo("FechaI"), e.Row.DBCampo("FechaF"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"))
e.Row.Cells(0).Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.Cells(0).Text & "</a>"
Else
e.Row.Cells(9).BackColor = Drawing.Color.LightGray
End If
End If
End Sub
@@ -234,6 +271,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
params.Add(New ReportParameter("Filtros", StrFiltro.ToString))
params.Add(New ReportParameter("Neto", LblNeto.Text))
params.Add(New ReportParameter("PorNeto", $"{LblPorNeto.Text}%"))
params.Add(New ReportParameter("Rentabilidad", $"{LblRentabilidad.Text}%"))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
@@ -248,4 +286,5 @@ Partial Class Ventas_RepVentasUtilidadPadre
End Class