From c9e641710c07353d511fe2b58eb23f9eda3cc36b Mon Sep 17 00:00:00 2001 From: JPerez Date: Fri, 11 Jul 2025 10:24:33 -0700 Subject: [PATCH] agregar columnas de PL1 y PL2, en la descarga de excel --- Ventas/Ventas.aspx.vb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 8a1b3c747..65774ea22 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -42057,6 +42057,7 @@ Partial Class Ventas Where row.RowType = DataControlRowType.DataRow Select New With { + .CveVentaDetalle = row.DataKey("CveVentaDetalle").ToEntero(), .Codigo = row.DataKey("Codigo").Trim(), .NumeroParte = row.DataKey("NumeroParte").Trim(), .Descripcion = row.DataKey("PS").Trim(), @@ -42065,13 +42066,32 @@ Partial Class Ventas .Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(), .SubImporte = row.DataKey("TotalImporte").ToDecimal(), .MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(), - .UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal() + .UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal(), + .PL1 = 0D, + .PL2 = 0D }).QueryToDataTable(True) If DtExcel.Rows.Count < 1 Then Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia) Exit Sub End If + Dim DtPreciosLista As DataTable = Nothing + + If UsuarioActual.CveEmpresa = 189 Then + Dim ObjVta As New ClsVentas + If ObjVta.GetVentaDetallePreciosLista(Me.CveVenta, UsuarioActual.CveEmpresa) Then + DtPreciosLista = ObjVta.DtResultados.Copy() + End If + ObjVta.Dispose() + + If DtPreciosLista IsNot Nothing Then + For Each Row As DataRow In DtExcel.Rows + Row("PL1") = DtPreciosLista.FiltroPrimeroValor("PL1", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal() + Row("PL2") = DtPreciosLista.FiltroPrimeroValor("PL2", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal() + Next + End If + End If + Dim folio = LblSerie.Text + "-" + TxtFolio.Text @@ -42085,6 +42105,9 @@ Partial Class Ventas DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad" DtExcel.Columns("UltimoCosto").ColumnName = "Ăšltimo costo" + 'QUITAR COLUMNA DE VENTA DETALLE, EL USUARIO NO DEBE VERLA + DtExcel.Columns.Remove("CveVentaDetalle") + SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) Dim FileExcel As New ExcelFile() @@ -42109,6 +42132,10 @@ Partial Class Ventas worksheet.Columns(7).Style.NumberFormat = "#,##0.00" 'ULTIMO COSTO worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)" + 'PL1 + worksheet.Columns(9).Style.NumberFormat = "$#,##0.00_);($#,##0.00)" + 'PL2 + worksheet.Columns(10).Style.NumberFormat = "$#,##0.00_);($#,##0.00)" Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns() For i As Integer = 0 To columnCount