From 6fde7b5c45b224ce897f29e5e171fc8a654ac435 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 17 Sep 2020 15:10:46 -0700 Subject: [PATCH] - --- Compras/CatTipoGasto.aspx.cs | 23 +- .../RepMovimientosAuxiliaresCatalogo.rdlc | 223 +++++++++++++----- Ventas/AuxiliarCliente.aspx.vb | 88 +------ 3 files changed, 178 insertions(+), 156 deletions(-) diff --git a/Compras/CatTipoGasto.aspx.cs b/Compras/CatTipoGasto.aspx.cs index 4ffb4c9b7..da4c4276b 100644 --- a/Compras/CatTipoGasto.aspx.cs +++ b/Compras/CatTipoGasto.aspx.cs @@ -41,6 +41,16 @@ public partial class Compras_CatTipoGasto : ClsPaginas ObjCompras.Dispose(); } + private void RecargarGlobal() + { + ClsCompras ObjCompras = new ClsCompras(); + if (ObjCompras.GetTipoGasto(-1, -1)) + { + set_GlobalDTTiposGastos(UsuarioActual.CveEmpresa, ObjCompras.DtResultados); + } + ObjCompras.Dispose(); + } + protected void BtnAgregarTipoGastoD_Click(object sender, EventArgs e) { BtnAgregarTipoGasto.Text = "Agregar"; @@ -74,6 +84,7 @@ public partial class Compras_CatTipoGasto : ClsPaginas Alert("Se eliminó el Tipo de Gasto correctamente"); } ObjCompras.Dispose(); + RecargarGlobal(); } protected void BtnAgregarTipoGasto_Click(object sender, EventArgs e) @@ -82,22 +93,20 @@ public partial class Compras_CatTipoGasto : ClsPaginas if (BtnAgregarTipoGasto.Text == "Agregar") { if (ObjCompras.AddTipoGasto(TxtTipoGasto.Text,ChkEstatus.Checked,DateTime.Now.ToString(),UsuarioActual.CveUsuario,UsuarioActual.CveEmpresa)) - { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + { Alert("Se agregó el Tipo de Gasto correctamente"); } }else { if (ObjCompras.UpdateTipoGasto(CveTipoGasto,TxtTipoGasto.Text,ChkEstatus.Checked,-1,-1)) { - CargaDatos(); - UpDatos.Update(); - RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); Alert("Se actualizó el Tipo de Gasto correctamente"); } } ObjCompras.Dispose(); + CargaDatos(); + RecargarGlobal(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); } } \ No newline at end of file diff --git a/Contabilidad/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc b/Contabilidad/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc index 2683f343b..26451702f 100644 --- a/Contabilidad/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc +++ b/Contabilidad/Reportes/RepMovimientosAuxiliaresCatalogo.rdlc @@ -6,28 +6,28 @@ - 1.86091cm + 2.28424cm 1.28292cm - 1.49458cm + 1.5475cm - 7.13431cm + 5.78365cm 1.99729cm - 2.10313cm + 2.10377cm - 2.1825cm + 2.10378cm - 2.31479cm + 3.26728cm @@ -149,11 +149,84 @@ 2pt - 3 - - + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + Black + + 1pt + + 2pt + 2pt + 2pt + 2pt + + + + @@ -605,10 +678,40 @@ 2pt - 2 - + + + + true + true + + + + + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + @@ -1221,9 +1324,8 @@ External =Parameters!pImg.Value FitProportional - 0.09633cm - 1.5cm - 1.5cm + 2.07257cm + 3.56716cm 1 - 2.0944in + 2.2819in + + + + + + Textbox5 + 0.89958cm + 20.37043cm + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + 2pt + 2pt + + true true @@ -1367,43 +1502,9 @@ Textbox8 0.02088cm - 16.87794cm - 0.57912cm - 3.49249cm - - = (Globals.PageNumber=1) - - - - 2pt - 2pt - - - - true - true - - - - - ="Libro Mayor" & System.Environment.NewLine & "al " &Parameters!pFechaFin.Value - - - - - - - Textbox5 - 2.87447cm - 0.89958cm - 12.68053cm + 14.99937cm + 0.8787cm + 5.37106cm 1 = (Globals.PageNumber=1) @@ -1414,8 +1515,6 @@ 2pt 2pt - 2pt - 2pt @@ -1451,9 +1550,9 @@ Textbox3 0.0703cm - 14.85419cm + 14.99937cm 0.6cm - 5.51625cm + 5.37107cm diff --git a/Ventas/AuxiliarCliente.aspx.vb b/Ventas/AuxiliarCliente.aspx.vb index f942475e2..441481afb 100644 --- a/Ventas/AuxiliarCliente.aspx.vb +++ b/Ventas/AuxiliarCliente.aspx.vb @@ -100,93 +100,7 @@ Partial Class Ventas_AuxiliarCliente Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub Public Sub ExportToExcelGTest(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing) - Dim sw As New StringWriter() - Dim htw As New HtmlTextWriter(sw) - Gv.RenderControl(htw) - GemBox.Spreadsheet.SpreadsheetInfo.SetLicense("ESWN-4QFD-26JF-1SZ8") - - Dim excel As GemBox.Spreadsheet.ExcelFile - Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault - Using htmlStream = New MemoryStream(options.Encoding.GetBytes(sw.ToString())) - excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream, options) - If Usuario IsNot Nothing Then - Dim worksheet = excel.Worksheets(0) - Dim num As Integer = worksheet.Rows.Count - If num > 128 Then num = 128 - - Dim columnCount = worksheet.CalculateMaxUsedColumns() - 'If columnCount > 1 Then - ' For i As Integer = 1 To columnCount - 1 - ' worksheet.Columns(i).AutoFit(1, worksheet.Rows(1), worksheet.Rows(num - 1)) - ' Next - 'End If - - worksheet.Rows.InsertEmpty(0, 7) - - Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) - Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port, Usuario.CveEmpresa) - - If Imagen.Exists Then - worksheet.Pictures.Add(logouri.ToString(), "A1", "B4") - End If - - Dim celdasConTexto = worksheet.GetUsedCellRange(True) - celdasConTexto.Style.Font.Name = "Calibri Light" - - Dim RangoNombreEmpresa = worksheet.Cells.GetSubrangeAbsolute(1, celdasConTexto.FirstColumnIndex, 1, celdasConTexto.LastColumnIndex) - RangoNombreEmpresa.Merged = True - RangoNombreEmpresa.Value = Usuario.Empresa.Empresa - RangoNombreEmpresa.Style.Font.Size = 18 * 20 - RangoNombreEmpresa.Style.Font.Name = "Calibri Light" - RangoNombreEmpresa.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoNombreEmpresa.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - Dim RangoTitulo = worksheet.Cells.GetSubrangeAbsolute(3, celdasConTexto.FirstColumnIndex, 3, celdasConTexto.LastColumnIndex) - RangoTitulo.Merged = True - RangoTitulo.Value = Titulo - RangoTitulo.Style.Font.Size = 20 * 20 - RangoTitulo.Style.Font.Name = "Calibri Light" - RangoTitulo.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - RangoTitulo.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - Dim FiltroCliente = worksheet.Cells.GetSubrangeAbsolute(5, celdasConTexto.FirstColumnIndex, 5, celdasConTexto.LastColumnIndex) - FiltroCliente.Merged = True - FiltroCliente.Value = String.Format("Cliente: {0} Fecha Inicio: {1} Fecha Fin: {2} Opción: {3}", DdlClientes.SelectedText, txtFechaI.Text, txtFechaF.Text, DdlOpcion.SelectedItem.Text) - FiltroCliente.Style.Font.Size = 12 * 20 - FiltroCliente.Style.Font.Name = "Calibri Light" - FiltroCliente.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left - FiltroCliente.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - - For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex - worksheet.Rows(7).Cells(i).Style.Font.Size = 12 * 20 - worksheet.Rows(7).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center - worksheet.Rows(7).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center - worksheet.Rows(7).Cells(i).Style.FillPattern.SetPattern(GemBox.Spreadsheet.FillPatternStyle.Solid, GemBox.Spreadsheet.SpreadsheetColor.FromArgb(75, 119, 190), GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255)) - worksheet.Rows(7).Cells(i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) - 'If i > 0 Then - ' Try - ' worksheet.Columns(i).AutoFit(1) - ' Catch ex As Exception - ' End Try - 'End If - Next - - - Dim IndexEndTable As Integer = Gv.Rows.Count + 9 - - worksheet.Rows(IndexEndTable).Cells(0).Value = "Usuario Imprimió:" - worksheet.Rows(IndexEndTable + 1).Cells(0).Value = Usuario.Nombre - - worksheet.Rows(IndexEndTable).Cells(4).Value = "Fecha Impresión: " - worksheet.Rows(IndexEndTable + 1).Cells(4).Value = DateTime.Now.ToString() - - worksheet.Rows(IndexEndTable).Cells(8).Value = "Impreso en SIG" - End If - - End Using - htw.Dispose() - - excel.Save(HttpContext.Current.Response, NombreArchivoXLSx) + ExportToExcelGembox(Gv, NombreArchivoXLSx, Usuario, txtFechaI.Text, txtFechaF.Text, Titulo, "", 1) End Sub Protected Sub GvAuxCliente_RowDataBound(sender As Object, e As GridViewRowEventArgs)