From ab65b91b62665deac7b60568214368550b3068b3 Mon Sep 17 00:00:00 2001 From: MLopez Date: Sat, 7 Jan 2023 19:40:38 -0700 Subject: [PATCH 01/19] E172 Rep Indicador Resumen: + Totales en Portlets, Promedio precio VxP, Fila totales Comp Productores y + info en grafica de pastel --- Compras/Proveedores.aspx.vb | 3 - General/RepIndicadorResumen.aspx | 198 +++++++++++++--------------- General/RepIndicadorResumen.aspx.vb | 80 ++++++++--- Site.master | 4 +- Styles/ReportePDF.html | 9 +- 5 files changed, 162 insertions(+), 132 deletions(-) diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb index 0fcad37ea..26a459684 100644 --- a/Compras/Proveedores.aspx.vb +++ b/Compras/Proveedores.aspx.vb @@ -3835,7 +3835,6 @@ Partial Class Compras_Proveedores Private Sub ImprimirReporteCxPCrystal(Optional Formato As String = "PDF") Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/RepProveedorCxP.rpt", UsuarioActual.Empresa.Ruta)) Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") - 'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa) Dim DTCxPTempral As DataTable = Nothing @@ -4217,7 +4216,6 @@ Partial Class Compras_Proveedores params.Add(New ReportParameter("LimiteCredito", TxtLimiteCredito.Text)) params.Add(New ReportParameter("SaldoDisponible", (TxtLimiteCredito.Text.ToDouble - dr("Saldo").ToString.ToDouble).ToString.FormatoNumero)) params.Add(New ReportParameter("AgrupadoPor", $"Agrupado Por: {Proveedor}{FechaIn}{FechaFn}{FechVI}{FechVF}")) - params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, $"file://{Imagen.FullName}", ""))) ImprimirPDF("Empresas/Grales/Formatos/RepProveedorCxP.rdlc", DTCxPTempral, params, "RepCxP") @@ -4225,7 +4223,6 @@ Partial Class Compras_Proveedores Alert("No se encontraron datos con los filtros especificados", TipoMensaje.MsgAdvertencia) End If - ElseIf rblreporte.SelectedValue = "anc" Then 'OBTENEMOS LOS DATOS diff --git a/General/RepIndicadorResumen.aspx b/General/RepIndicadorResumen.aspx index 31e334953..6b1c27c79 100644 --- a/General/RepIndicadorResumen.aspx +++ b/General/RepIndicadorResumen.aspx @@ -19,25 +19,27 @@ background-color: #95A5A6; color: white; } - .table-scrollable { margin-top: 0px !important; margin-bottom: 0px !important; } - .margenbound { margin-left: 15px; text-align: right; } - .amChartsAttribution { - margin-top: -2px; - margin-bottom: 8px; - visibility: hidden; - } div[id^=chartdiv] { width: 100%; height: 400px; } + .portlet-total { + float:right!important; + display:inline-block!important; + } + .abbr { + overflow: hidden; + text-overflow: ellipsis; + display:block!important; + } @@ -96,12 +98,6 @@ - <%----%>
@@ -111,15 +107,15 @@
- Ventas por Productos -
-
-
-
+ Ventas por Productos
+
+ + +
- + <%--TODO: Esto se puede meter en el stored procedured, pero me da cosa moverle :S--%> + + + <%--TODO: Esto puede tronar si el valor es DBNull --%> + <%# If(Convert.ToDecimal(Eval("Cantidad")) = 0, 0.ToString("C"), (Convert.ToDecimal(Eval("SubTotal")) / Convert.ToInt32(Eval("Cantidad"))).ToString("C")) %> + +
@@ -143,11 +145,7 @@
- Ventas por Productos - Gráfica -
-
-
-
+ Ventas por Productos - Gráfica
@@ -168,20 +166,20 @@
- Compras Productores -
-
-
-
+ Compras Productores
+
+ + +
+ AutoGenerateColumns="False" AllowPaging="False" ShowFooter="True"> @@ -190,6 +188,7 @@ +
@@ -202,11 +201,7 @@
- Compras Productores - Gráfica por Cantidad(Kg) -
-
-
-
+ Compras Productores - Gráfica por Cantidad(Kg)
@@ -227,15 +222,15 @@
- Gastos -
-
-
-
+ Gastos
+
+ + +
- Compras por clasificación - Gráfica -
-
-
-
+ Compras por clasificación - Gráfica
@@ -283,15 +274,15 @@
- Cuentas por cobrar -
-
-
-
+ Cuentas por cobrar
+
+ + +
- Cuentas por cobrar - Gráfica Saldo VS Recuperado -
-
-
-
+ Cuentas por cobrar - Gráfica Saldo VS Recuperado
@@ -330,30 +317,6 @@
- -
- - -
-
- - Cuentas por cobrar - Gráfica Recuperado -
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
@@ -363,15 +326,15 @@
- Cuentas por Pagar productores -
-
-
-
+ Cuentas por Pagar productores
+
+ + +
- Cuentas por Pagar productores - Gráfica -
-
-
-
+ Cuentas por Pagar productores - Gráfica
@@ -418,15 +377,15 @@
- Cuentas por Pagar no productores -
-
-
-
+ Cuentas por Pagar no productores
+
+ + +
- Cuentas por Pagar no productores - Gráfica -
-
-
-
+ Cuentas por Pagar no productores - Gráfica
@@ -507,7 +462,17 @@ align: 'left' }, legend: { - enabled: false + enabled: false, + // esto es para la grafica de pie + layout: 'vertical', + align: 'right', + width: 220, + verticalAlign: 'middle', + borderWidth: 0, + useHTML: true, + labelFormatter: function () { + return '
' + this.name + '
' + '
' + this.y.toLocaleString() + this.unit + '' + '$' + this.y2.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + '
'; + }, }, xAxis: { type: 'category' @@ -547,6 +512,10 @@ // }, // //footerFormat: '{point.key}' //}, + tooltip: { + //valuePrefix: '$', + valueSuffix: " " + '{point.unit}' + }, plotOptions: { series: { animation: true, @@ -577,9 +546,14 @@ } }, pie: { + allowPointSelect: true, + cursor: 'pointer', dataLabels: { - enabled: true - } + enabled: true, + distance: -30, + format: '{point.percentage:.1f} %' + }, + showInLegend: true } }, series: [ @@ -594,11 +568,11 @@ //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_compproductores").highcharts({ ...chartconfig, series: [{ ...chartconfig.series[0], type: 'pie', data: customAccessor(json["CompProductores"]) }] }) + $('#' + "chartdiv_compproductores").highcharts({ ...chartconfig, chart: {}, legend: { ...chartconfig.legend, enabled: true }, series: [{ ...chartconfig.series[0], keys: ['name', 'y', 'y2', 'unit', 'unit2'], type: 'pie', data: customAccessorPie(json["CompProductores"]) }] }) $('#' + "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_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"]) }, { ...chartconfig.series[0], type: 'line', data: customAccessor(json["CxCR"]) }] }) function customAccessor(data) { const newData = []; @@ -609,10 +583,18 @@ newData.push([point.Texto, point.Valor, point.Unidad]); } }); - //newData.sort(function (a, b) { - // return a[0] > b[0] ? 1 : -1; - //}); - //console.log(JSON.stringify(newData)) + return newData; + } + + function customAccessorPie(data) { + const newData = []; + data.forEach(function (point, index) { + if (point.Texto == "Otros") { + newData.push({ name: point.Texto, y: point.Cantidad, y2: point.Importe, unit: point.UnidadC, unit2:point.UnidadI, color: '#000000' }); + } else { + newData.push([point.Texto, point.Cantidad, point.Importe, point.UnidadC, point.UnidadI]); + } + }); return newData; } diff --git a/General/RepIndicadorResumen.aspx.vb b/General/RepIndicadorResumen.aspx.vb index 0566e31e4..b2bf87ec9 100644 --- a/General/RepIndicadorResumen.aspx.vb +++ b/General/RepIndicadorResumen.aspx.vb @@ -83,38 +83,51 @@ Partial Class General_RepIndicadorResumen GvCxC.HeaderRow.Cells(2).Text = "Recuperado" End If - 'Mostrar gráficos solo si hay datos en su respectiva tabla + 'Mostrar gráficos y totales en portlets solo si hay datos en su respectiva tabla If GvVxP.Rows.Count > 0 Then UPGraficaVxP.Visible = True + PLVxPTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvVxP.DataSource, DataTable).SUM("Cantidad", "Orden IS NOT NULL")) _ + + "" + "Total: " + "" + String.Format("{0:c} MXN", CType(GvVxP.DataSource, DataTable).SUM("SubTotalMN", "Orden IS NOT NULL")) Else UPGraficaVxP.Visible = False + PLVxPTot.InnerHtml = Nothing End If If GvCompProductores.Rows.Count > 0 Then UPGraficaCompProductores.Visible = True + PLCompProductoresTot.InnerHtml = "" + "Cantidad: " + "" + String.Format("{0:n} Kg", CType(GvCompProductores.DataSource, DataTable).SUM("Cantidad", "")) Else UPGraficaCompProductores.Visible = False + PLCompProductoresTot.InnerHtml = Nothing End If If GvCompAcreed.Rows.Count > 0 Then UPGraficaCompAcreed.Visible = True + PLGastosTot.InnerHtml = "" + "Importe: " + "" + String.Format("{0:c} MXN", CType(GvCompAcreed.DataSource, DataTable).SUM("SubTotalMN", "CveClasificacion IS NOT NULL")) Else UPGraficaCompAcreed.Visible = False + PLGastosTot.InnerHtml = Nothing End If If GvCxC.Rows.Count > 0 Then UPGraficaCxC.Visible = True - 'UPGraficaCxCRec.Visible = True + PLCxCTot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxC.DataSource, DataTable).SUM("SaldoMN", "CveCliente IS NOT NULL")) + Dim Recuper As Double = CType(GvCxC.DataSource, DataTable).SUM("RecuperadoMN", "CveCliente IS NOT NULL") + If (Recuper > 0) Then PLCxCTot.InnerHtml += "" + "Rec: " + "" + String.Format("{0:c} MXN", CType(GvCxC.DataSource, DataTable).SUM("RecuperadoMN", "CveCliente IS NOT NULL")) Else UPGraficaCxC.Visible = False - 'UPGraficaCxCRec.Visible = False + PLCxCTot.InnerHtml = Nothing End If If GvCxP192.Rows.Count > 0 Then UPGraficaCxP192.Visible = True + PLCxP192Tot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxP192.DataSource, DataTable).SUM("SaldoMN", "CveProveedor IS NOT NULL")) Else UPGraficaCxP192.Visible = False + PLCxP192Tot.InnerHtml = Nothing End If If GvCxP.Rows.Count > 0 Then UPGraficaCxP.Visible = True + PLCxPTot.InnerHtml = "" + "Saldo: " + "" + String.Format("{0:c} MXN", CType(GvCxP.DataSource, DataTable).SUM("SaldoMN", "CveProveedor IS NOT NULL")) Else UPGraficaCxP.Visible = False + PLCxPTot.InnerHtml = Nothing End If 'Si no había datos en ninguna tabla no cargar función de gráficos @@ -149,6 +162,32 @@ Partial Class General_RepIndicadorResumen End If End If End Sub + Dim CompProductoresTotales As Decimal() = New Decimal(5 - 1) {} + Protected Sub GvCompProductores_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompProductores.RowDataBound + 'Esto tambien se podría meter en el Stored Procedure + If e.Row.RowType = DataControlRowType.DataRow Then + CompProductoresTotales(0) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Cantidad"), 0)) + CompProductoresTotales(1) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "SubTotal"), 0)) + CompProductoresTotales(2) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "PUPromedioKG"), 0)) + CompProductoresTotales(3) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Saldo"), 0)) + CompProductoresTotales(4) += Convert.ToDecimal(IfNull(DataBinder.Eval(e.Row.DataItem, "Abonado"), 0)) + ElseIf e.Row.RowType = DataControlRowType.Footer Then + 'Movemos el pie a la primera fila de la tabla + Dim footerRow As GridViewRow = e.Row + GvCompProductores.Controls(0).Controls.Remove(footerRow) + GvCompProductores.Controls(0).Controls.AddAt(1, footerRow) + 'Ahora se registran los datos + e.Row.Cells(0).Text = "Totales" + e.Row.Cells(1).Text = CompProductoresTotales(0).ToString("N") + e.Row.Cells(2).Text = CompProductoresTotales(1).ToString("C") + e.Row.Cells(3).Text = (CompProductoresTotales(2) / GvCompProductores.Rows.Count).ToString("C") 'Promedio + e.Row.Cells(4).Text = CompProductoresTotales(3).ToString("C") + e.Row.Cells(5).Text = CompProductoresTotales(4).ToString("C") + For i As Integer = 1 To e.Row.Cells.Count - 1 + e.Row.Cells(i).CssClass = "margenbound" + Next + End If + End Sub Protected Sub GvComprasAcreed_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompAcreed.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.DBCampo("CveClasificacion") = "" Then @@ -230,32 +269,40 @@ Partial Class General_RepIndicadorResumen '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.Unidad}).ToList() - 'Compras ProveedorClasificacion=192 + 'Compras Productores ProveedorClasificacion=192 DtCompProductores.Reset() DtCompProductores.Columns.Add("Texto") - DtCompProductores.Columns.Add("Valor") - DtCompProductores.Columns.Add("Unidad") + DtCompProductores.Columns.Add("Cantidad") + DtCompProductores.Columns.Add("Importe") + DtCompProductores.Columns.Add("UnidadC") + DtCompProductores.Columns.Add("UnidadI") For Each Dr As DataRow In GvCompProductores.DataSource.Rows Dim Row = DtCompProductores.NewRow() Row("Texto") = Dr("RazonSocial").ToString - Row("Valor") = Dr("Cantidad").ToString.FormatoNumero - Row("Unidad") = "Kg" + Row("Cantidad") = Dr("Cantidad").ToString.FormatoNumero + Row("Importe") = Dr("SubTotal").ToString.FormatoNumero + Row("UnidadC") = "Kg" + Row("UnidadI") = "MXN" DtCompProductores.Rows.Add(Row) Next - 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 comp_productores = From s In DtCompProductores.AsEnumerable() Select New With {.Texto = s("Texto").ToString(), .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").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" + .Cantidad = Math.Round(g.Sum(Function(x) x.Cantidad), 2), + .Importe = Math.Round(g.Sum(Function(x) x.Importe), 2), + .UnidadC = "Kg", + .UnidadI = "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 top_comp_productores = From s In group_comp_productores.AsEnumerable().Take(10) Select New With {.Texto = s("Texto").ToString(), .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()} + Dim resto_comp_productores = From s In group_comp_productores.AsEnumerable().Skip(10) Select New With {.Texto = "Otros", .Cantidad = s("Cantidad").ToString().ToDouble(), .Importe = s("Importe").ToString().ToDouble(), .UnidadC = s("UnidadC").ToString(), .UnidadI = s("UnidadI").ToString()} Dim group_resto_comp_productores = resto_comp_productores.GroupBy(Function(x) x.Texto).[Select](Function(g) New With { .Texto = "Otros", - .Valor = Math.Round(g.Sum(Function(x) x.Valor), 2), - .Unidad = "MXN" + .Cantidad = Math.Round(g.Sum(Function(x) x.Cantidad), 2), + .Importe = Math.Round(g.Sum(Function(x) x.Importe), 2), + .UnidadC = "Kg", + .UnidadI = "MXN" }) - Dim query_comp_productores = top_comp_productores.Union(group_resto_comp_productores).OrderByDescending(Function(x) x.Valor) + Dim query_comp_productores = top_comp_productores.Union(group_resto_comp_productores).OrderByDescending(Function(x) x.Cantidad) 'Compras TipoProveedor=1 Acreedores (Gastos) DtCompAcreed.Reset() @@ -403,6 +450,7 @@ Partial Class General_RepIndicadorResumen }) Dim query_cxp = top_cxp.Union(group_resto_cxp).OrderByDescending(Function(x) x.Valor) + '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, .CompProductores = query_comp_productores, .CompAcreed = query_comp_acreed, .CxC = query_cxc, .CxCR = query_cxcr, .CxP192 = query_cxp192, .CxP = query_cxp}) 'Alert(json) diff --git a/Site.master b/Site.master index 5431b7312..0a9eac6db 100644 --- a/Site.master +++ b/Site.master @@ -15,8 +15,10 @@ <%: Scripts.Render("~/bundles/modernizr") %> <%: Styles.Render("~/Content/AjaxControlToolkit/Styles/Bundle") %> + + - + <%-- diff --git a/Styles/ReportePDF.html b/Styles/ReportePDF.html index 06a1f940c..f43adb8e4 100644 --- a/Styles/ReportePDF.html +++ b/Styles/ReportePDF.html @@ -1,16 +1,13 @@ - + \ No newline at end of file From cd996b15853d883f0efc5b37f19e0f7013e1951f Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 10:44:05 -0700 Subject: [PATCH 02/19] =?UTF-8?q?E141=20Rep=20Entradas=20salidas:=20Marca?= =?UTF-8?q?=20es=20ahora=20de=20selecci=C3=B3n=20m=C3=BAltiple=20Modificac?= =?UTF-8?q?iones=20en=20BD=20[SIG=5FResp=5FMLR]=20-=20PA=5FInv=5FReporteMo?= =?UTF-8?q?vimientos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsInventarios.vb | 4 +- Inventarios/RepEntradasSalidas.aspx | 78 +++++++++++++------------- Inventarios/RepEntradasSalidas.aspx.vb | 3 +- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 4dcd35be4..0ff33a38c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1755,7 +1755,7 @@ Public Class ClsInventarios Public Function RepMovimientos(CveEmpresa As Integer, CveMoneda As Integer, FechaI As String, FechaF As String, CveConcepto As Integer, CveProveedor As Integer, Almacenes As String, - CveCategoria As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer, Optional CveMarca As Integer = -1, Optional CvePersonal As Integer = -1, + CveCategoria As Integer, CveClasificacion As Integer, CvePS As Integer, Tipo As Integer, Optional CveMarca As String = "-1", Optional CvePersonal As Integer = -1, Optional CveClasificacion2 As Integer = -1, Optional CveTipoAlmacen As String = "-1", Optional Modalidad As Integer = -1) As Boolean Dim Retorno As Boolean = False @@ -1774,7 +1774,7 @@ Public Class ClsInventarios ' .Add("@CveSubFamilia", SqlDbType.Int).Value = CveSubFamilia .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion - .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveMarca", SqlDbType.VarChar).Value = CveMarca .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveClasificacion2", SqlDbType.Int).Value = CveClasificacion2 .Add("@CveTipoAlmacen", SqlDbType.VarChar).Value = CveTipoAlmacen diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index b541aeccc..95766bb80 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -119,7 +119,7 @@
Proveedor
- +
Categoría
@@ -127,59 +127,59 @@
Clasificación
- -
-
-
- -
Producto
-
- - <%----%> -
-
-
Marca
-
- -
+
-
+
+ +
Producto
+
+ + <%----%> +
Personal
-
Tipo Almacén:
+
+
+ +
+
Marca
- +
-
Modalidad:
-
- - - - - -
-
Clasificación 2:
-
- - -
+
+ +
Tipo Almacén:
+
+ +
+
Modalidad:
+
+ + + + + +
+
Clasificación 2:
+
+ + +
- diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index c60cd06a3..32c24f006 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -226,6 +226,7 @@ Partial Class Inventarios_ReporteEntradasSalidas 'Dim fechaF As String = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") FechaInicial = If(TxtFechaI.Text.Trim <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1") FechaFinal = If(TxtFechaF.Text.Trim <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") + Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) Dim TipoAlmacen As String = If(DdlTipoAlmacen.GetSelectedValuesM = "", "-1", DdlTipoAlmacen.GetSelectedValuesM) Dim Almacenes As String = If(DdlAlmacen.GetSelectedValuesM = "", "-1", DdlAlmacen.GetSelectedValuesM) @@ -235,7 +236,7 @@ Partial Class Inventarios_ReporteEntradasSalidas If Reporte.RepMovimientos(UsuarioActual.CveEmpresa, DdlMoneda.SelectedValue.ToEntero, FechaInicial, FechaFinal, DdlTipoMovimiento.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, Almacenes, DdlCategoria.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, - DdlMovs.SelectedValue.ToEntero, CveMarca, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero, CveTipoAlmacen:=TipoAlmacen, + DdlMovs.SelectedValue.ToEntero, CveMarca:=Marcas, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, CveClasificacion2:=DdlClasificacion2.SelectedValue.ToEntero, CveTipoAlmacen:=TipoAlmacen, Modalidad:=DdlModalidadFiltro.SelectedValue.ToEntero) Then dt = Reporte.DtResultados From 0383dabcb97413383e873de06db2aef7e459d632 Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 18:29:08 -0700 Subject: [PATCH 03/19] =?UTF-8?q?Mod=20Extensiones:=20Funciones=20para=20G?= =?UTF-8?q?ridViews,=20hacer=20posible=20DataBind=20que=20incluya=20las=20?= =?UTF-8?q?columnas=20no=20visibles=20Razonamiento:=20Las=20columnas=20mar?= =?UTF-8?q?cadas=20como=20no=20visibles=20en=20un=20GridView=20no=20almace?= =?UTF-8?q?nan=20datos,=20antes=20de=20esto=20se=20ten=C3=ADa=20que=20pone?= =?UTF-8?q?r=20visible=20la=20columna=20y=20volver=20a=20realizar=20de=20n?= =?UTF-8?q?uevo=20la=20consulta=20a=20la=20DB=20para=20recuperar=20el=20da?= =?UTF-8?q?to,=20agotando=20recursos=20innecesarios.=20-=20Se=20extiende?= =?UTF-8?q?=20DataBind()=20con=20el=20param=C3=A9tro=20BindearCamposNoVisi?= =?UTF-8?q?bles=20=20=20Ejemplo:=20Para=20Bindear=20un=20GridView=20que=20?= =?UTF-8?q?tambien=20contemple=20los=20campos=20ocultos,=20se=20manda=20a?= =?UTF-8?q?=20llamar=20Gv.DataBind(True)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/modExtensiones.vb | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index ae5d47fc5..9685028a6 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -1628,6 +1628,66 @@ Namespace Extensiones Public Function FCRangeValidator(ByVal Row As GridViewRow, ByVal Control As String) As RangeValidator Return DirectCast(Row.FindControl(Control), RangeValidator) End Function + + + Public Function GetColumn(ByVal gv As GridView, ByVal name As String) As Integer + Dim index As Integer = 0 + Dim found As Boolean = False + + For Each c As DataControlField In gv.Columns + + If TypeOf c Is BoundField Then + Dim field As BoundField = CType(c, BoundField) + + If name = field.DataField OrElse name = field.SortExpression OrElse name = field.HeaderText Then + found = True + Exit For + End If + End If + + index += 1 + Next + + Return If(found, index, -1) + End Function + + + Public Function HiddenColumns(gv As GridView) As List(Of Integer) + Dim columns As New List(Of Integer) + + For i As Integer = 0 To gv.Columns.Count - 1 + If gv.Columns(i).Visible = False Then columns.Add(i) + Next + + Return columns + End Function + + + Public Sub ShowAllColumns(gv As GridView) + For i As Integer = 0 To gv.Columns.Count - 1 + gv.Columns(i).Visible = True + Next + End Sub + + + Public Sub HideColumns(gv As GridView, columns As List(Of Integer)) + For Each i As Integer In columns + gv.Columns(i).Visible = False + Next + End Sub + + + Public Sub DataBind(gv As GridView, BindearCamposNoVisibles As Boolean) + If BindearCamposNoVisibles Then + Dim NoVisibles As List(Of Integer) = gv.HiddenColumns() + gv.ShowAllColumns() + gv.DataBind() + gv.HideColumns(NoVisibles) + Else + gv.DataBind() + End If + End Sub + #End Region #Region "Excel PDF" From 782804b7a7daa013898639003976390acb18c9b3 Mon Sep 17 00:00:00 2001 From: MLopez Date: Tue, 10 Jan 2023 18:30:09 -0700 Subject: [PATCH 04/19] =?UTF-8?q?E141=20Rep=20Entradas=20y=20salidas:=20Op?= =?UTF-8?q?ci=C3=B3n=20para=20personalizar=20columnas,=20no=20recargar=20c?= =?UTF-8?q?onsulta=20al=20personalizar=20Grid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/RepEntradasSalidas.aspx | 41 +++++++++++++++------- Inventarios/RepEntradasSalidas.aspx.vb | 47 ++++++++++++++++++++------ 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 95766bb80..82be31ee6 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -1,22 +1,37 @@ <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEntradasSalidas.aspx.vb" Inherits="Inventarios_ReporteEntradasSalidas" %> -
  • - Generar PDF -
  • -
  • - Generar Excel -
  • -
  • - Generar Formato Inventario -
  • + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • -
  • - Personalizar Columnas -
  • - <%--
  • +
  • + Excel Personalizado +
  • + +
  • + Generar Formato Inventario +
  • + +
  • + Personalizar Columnas +
  • + <%--
  • Generar Inventarios HP
  • --%> +
    + + + + + + +
    - - - - -
  • - Generar PDF + + + + +
  • + Generar PDF +
  • +
  • + Generar Excel +
  • + +
  • + Excel Personalizado +
  • + +
  • + +
  • -
  • - Generar Excel -
  • - -
  • - Excel Personalizado -
  • - -
  • -
  • - -
  • - Ver Dlls en pesos - -
  • - - -
  • - Programar Recursos - -
  • - -
    - - - - - -
    - +
  • + Ver Dlls en pesos + +
  • + + +
  • + Programar Recursos + +
  • + + + + + + + + +
    Reporte de CxP - Detalle @@ -216,18 +217,18 @@
    - -
    - - - -
    - - -
    - - - + +
    + + + +
    + + +
    + + +
    Comprobación:
    @@ -241,19 +242,19 @@
    -
    +
    Moneda:
    -
    - -
    +
    + +
    Aplica NC:
    -
    +
    - -
    + +
    @@ -264,7 +265,7 @@ - <%--0--%> diff --git a/Compras/RepCxPDetalle.aspx.vb b/Compras/RepCxPDetalle.aspx.vb index 22ed077f9..10ad64961 100644 --- a/Compras/RepCxPDetalle.aspx.vb +++ b/Compras/RepCxPDetalle.aspx.vb @@ -83,18 +83,6 @@ Partial Class RepCxPDetalle ViewState("FechaFin") = value End Set End Property - - - Private Property Personalizo As Integer - Get - Return ViewState("Personalizo").ToString.ToEntero - End Get - - Set(value As Integer) - ViewState("Personalizo") = value - End Set - End Property - Public Property FechaVInicio() As String Get @@ -205,7 +193,6 @@ Partial Class RepCxPDetalle Private Property TCEspecifico As Double - Public Property DTCuentasContables() As DataTable Get If ViewState("DTCuentasContables") Is Nothing Then @@ -218,20 +205,14 @@ Partial Class RepCxPDetalle Set(value As DataTable) ViewState("DTCuentasContables") = value End Set - End Property - - - + End Property #End Region - - 'pRivate ReadOnly Property ColumnasVisibles As - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not IsPostBack Then - Personalizo = 0 - + 'Private ReadOnly Property ColumnasVisibles As + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + If Not IsPostBack Then ViewState("Opcion") = IfNull(Request("Op"), "S") - MostrarOcultarColumnas() + MostrarOcultarColumnas(False) CargaCombos() If Request("Op") IsNot Nothing Then CargaDatos() @@ -274,7 +255,6 @@ Partial Class RepCxPDetalle DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1")) DdlUsuarioRegistro.SelectedValueExist(UsuarioRegistro) - Dim CveSucursal As Integer = IfNull(Request("CveSubProyecto"), -1).ToString.ToEntero 'DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1) @@ -309,7 +289,6 @@ Partial Class RepCxPDetalle FechaCorte = IfNull(Request("FechaCorte"), Now.ToDate.ToString).ToString txtCorteA.Text = $"31/12/{Now.Year}" - If Request("FechaI") <> "-1" AndAlso IsDate(Request("FechaI")) Then txtFechaI.Text = Request("FechaI") If Request("FechaF") <> "-1" AndAlso IsDate(Request("FechaF")) Then txtFechaF.Text = Request("FechaF") If Request("FechaVI") <> "-1" AndAlso IsDate(Request("FechaVI")) Then txtFechaVI.Text = Request("FechaVI") @@ -349,8 +328,6 @@ Partial Class RepCxPDetalle GvDatos.Columns(11).Visible = (UsuarioActual.Empresa.Funcionalidad(131).ToEntero > 0 Or UsuarioActual.Empresa.Funcionalidad(134).ToEntero > 0) - - For Each lItem As ListItem In DdlGrupo.Items If lItem.Value.ToEntero = 9 Then @@ -358,7 +335,6 @@ Partial Class RepCxPDetalle End If Next - End Sub Protected Sub DdlProyecto_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlProyecto.SelectedIndexChanged @@ -544,11 +520,8 @@ Partial Class RepCxPDetalle End If End If - - End If - If e.Row.DBCampo("CveCompra") = "" Then e.Row.FCLabel("LblMoneda").Text = "" End If @@ -595,7 +568,7 @@ Partial Class RepCxPDetalle #End Region #Region "PERSONALIZAR" - Protected Sub MostrarOcultarColumnas() + Protected Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True) If ChkTipoDocto.Checked Then GvDatos.Columns(0).Visible = True @@ -639,15 +612,12 @@ Partial Class RepCxPDetalle GvDatos.Columns(7).Visible = False End If - If ChkMoneda.Checked Then GvDatos.Columns(8).Visible = True Else GvDatos.Columns(8).Visible = False End If - - If ChkSaldo.Checked Then GvDatos.Columns(9).Visible = True Else @@ -692,12 +662,12 @@ Partial Class RepCxPDetalle GvDatos.Columns(16).Visible = ChkDescripcion.Checked - Personalizo = 1 - If Personalizo = 1 Then + If Personalizo Then ImgExcelPersonalizado.Visible = True Else ImgExcelPersonalizado.Visible = False - End If + End If + UPAcciones.Update() UPDatos.Update() End Sub diff --git a/Inventarios/RepEntradasSalidas.aspx b/Inventarios/RepEntradasSalidas.aspx index 82be31ee6..a6f392e96 100644 --- a/Inventarios/RepEntradasSalidas.aspx +++ b/Inventarios/RepEntradasSalidas.aspx @@ -227,7 +227,7 @@ <%--0--%> - + <%--1--%> <%--2--%> diff --git a/Inventarios/RepEntradasSalidas.aspx.vb b/Inventarios/RepEntradasSalidas.aspx.vb index a11433761..72404a554 100644 --- a/Inventarios/RepEntradasSalidas.aspx.vb +++ b/Inventarios/RepEntradasSalidas.aspx.vb @@ -54,21 +54,11 @@ Partial Class Inventarios_ReporteEntradasSalidas Return (UsuarioActual.CveEmpresa.Contiene(72, 80)) End Get End Property - Private Property Personalizo As Integer - Get - Return ViewState("Personalizo").ToString.ToEntero - End Get - - Set(value As Integer) - ViewState("Personalizo") = value - End Set - End Property #End Region Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not IsPostBack Then - Personalizo = 0 If UsuarioActual.CveEmpresa.Contiene(119) Then LnkFormatoInventario.Visible = True @@ -435,7 +425,7 @@ Partial Class Inventarios_ReporteEntradasSalidas #End Region #Region "PERSONALIZAR" - Private Sub MostrarOcultarColumnas() + Private Sub MostrarOcultarColumnas(Optional Personalizo As Boolean = True) GvM.Columns(1).Visible = ChkCodigoAlterno.Checked GvM.Columns(2).Visible = ChkCodigoBarras.Checked GvM.Columns(3).Visible = ChkClasificacion2.Checked @@ -510,12 +500,12 @@ Partial Class Inventarios_ReporteEntradasSalidas dvCan.Style.Add("width", "21%") End If - Personalizo = 1 - If Personalizo = 1 Then + If Personalizo Then LnkExcelPersonalizado.Visible = True Else LnkExcelPersonalizado.Visible = False End If + UPAcciones.Update() UpEncabezado.Update() UPPMov.Update() @@ -524,7 +514,6 @@ Partial Class Inventarios_ReporteEntradasSalidas Private Sub BtnPersonalizar_Click(sender As Object, e As EventArgs) Handles BtnPersonalizar.Click MostrarOcultarColumnas() RegistraScript("$('#DivPersonalizar').modal('hide')") - UPAcciones.Update() 'CargaDatos() End Sub From 5f741c24f6e2a70551a24bb844316136fef01ed3 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Wed, 11 Jan 2023 13:09:23 -0700 Subject: [PATCH 06/19] --- Nomina/Aguinaldo.aspx.cs | 4 +- Nomina/Nomina.aspx | 70 ++++++++++++- Nomina/Nomina.aspx.cs | 215 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 268 insertions(+), 21 deletions(-) diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs index 4b11f9b47..28e4abe3e 100644 --- a/Nomina/Aguinaldo.aspx.cs +++ b/Nomina/Aguinaldo.aspx.cs @@ -434,8 +434,8 @@ public partial class Nomina_Aguinaldo : ClsPaginas FraccionI = (aguinaldogravado / diasanio) * diasmes; FraccionII_1 = salariomensual + FraccionI; str.Clear(); - str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes); - str.AppendFormat(" dbo.Fnc_NomValues(40, 0, 00, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes); + str.AppendFormat("SELECT dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionII_2,", FraccionII_1, diasmes, DdlEjercicios.SelectedValue); + str.AppendFormat(" dbo.Fnc_NomValues(40, 0, {2}, -1, {0}, {1}, {1}) isrFraccionIII_1", salariomensual, diasmes, DdlEjercicios.SelectedValue); if (objbase.runQuerystr(str.ToString())) { DataRow drow = objbase.DtResultados.Rows[0]; diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index e5f0cdf13..c14eaccd0 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -262,6 +262,9 @@
  • Cargar masiva de conceptos
  • +
  • + Cargar netos +
  • Tablas de cálculo
  • @@ -404,7 +407,7 @@
    + DataTextField="TipoTrabajadorB" DataValueField="CveTipoTrabajador" ValidationGroup="GrpGuardar">
    @@ -629,7 +632,7 @@ <%--Descargar Cargar--%> - + Asistencia @@ -663,7 +666,7 @@
    - + @@ -3231,7 +3234,7 @@
    - +
    - +
    @@ -3364,6 +3367,9 @@
    +
    + +
    @@ -3383,6 +3389,60 @@
    + + + + +