From adbd4bb959b24d5fbebd184f0274a1b43eb92240 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 11:07:35 -0700 Subject: [PATCH 01/16] =?UTF-8?q?--=20correcci=C3=B3n=20del=20cambio=20ant?= =?UTF-8?q?erior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/RepVentaDetalle.aspx | 4 +- Ventas/RepVentaDetalle.aspx.vb | 335 +++------------------------------ 2 files changed, 31 insertions(+), 308 deletions(-) diff --git a/Ventas/RepVentaDetalle.aspx b/Ventas/RepVentaDetalle.aspx index 91ec23517..c6a069f88 100644 --- a/Ventas/RepVentaDetalle.aspx +++ b/Ventas/RepVentaDetalle.aspx @@ -582,13 +582,13 @@ - + - + diff --git a/Ventas/RepVentaDetalle.aspx.vb b/Ventas/RepVentaDetalle.aspx.vb index 188b6390e..4e097c201 100644 --- a/Ventas/RepVentaDetalle.aspx.vb +++ b/Ventas/RepVentaDetalle.aspx.vb @@ -114,8 +114,6 @@ Partial Class RepVentaDetalle DVServicioDomicilio.Visible = True End If - - End If End Sub @@ -452,6 +450,7 @@ Partial Class RepVentaDetalle If Not UsuarioActual.Empresa.MostrarRetISR Then GvDatos.Columns(11).Visible = False ChkIEPS.Checked = UsuarioActual.Empresa.Funcionalidad(713) = "1" 'empresa deduce IEPS + GvDatos.Columns(9).Visible = ChkIEPS.Checked End Sub Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatos.RowDataBound @@ -482,24 +481,6 @@ Partial Class RepVentaDetalle e.Row.FCLiteral("LtlFacturaCotizacion").Text = "" & e.Row.DBCampo("FolioVenta") & "" End If - 'e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Left - 'e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(7).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(8).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(9).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(10).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(11).HorizontalAlign = HorizontalAlign.Right - 'e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Left - 'e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(15).HorizontalAlign = HorizontalAlign.Center - 'e.Row.Cells(20).HorizontalAlign = HorizontalAlign.Left - If e.Row.DBCampo("SubTotal").ToDouble = 0 Then e.Row.FCLiteral("LtlSubTotal").Text = "-" If e.Row.DBCampo("Descuento").ToDouble = 0 Then e.Row.FCLiteral("LtlDescuento").Text = "-" @@ -550,178 +531,38 @@ Partial Class RepVentaDetalle Protected Sub BtnPersonalizar_Click(sender As Object, e As System.EventArgs) Handles BtnPersonalizar.Click - If ChkFolio.Checked Then - GvDatos.Columns(1).Visible = True - Else - GvDatos.Columns(1).Visible = False - End If - - If ChkFecha.Checked Then - GvDatos.Columns(2).Visible = True - - Else - GvDatos.Columns(2).Visible = False - End If - - If ChkCliente.Checked Then - GvDatos.Columns(3).Visible = True - Else - GvDatos.Columns(3).Visible = False - End If - - If ChkSubTotal.Checked Then - GvDatos.Columns(4).Visible = True - Else - GvDatos.Columns(4).Visible = False - End If - - If ChkDescuento.Checked Then - GvDatos.Columns(5).Visible = True - Else - GvDatos.Columns(5).Visible = False - End If - - If ChlMotivoDescuento.Checked Then - GvDatos.Columns(6).Visible = True - Else - GvDatos.Columns(6).Visible = False - End If - - If ChkAmortizacion.Checked Then - GvDatos.Columns(7).Visible = True - Else - GvDatos.Columns(7).Visible = False - End If - - If ChkIVA.Checked Then - GvDatos.Columns(8).Visible = True - Else - GvDatos.Columns(8).Visible = False - End If - - If ChkIEPS.Checked Then - GvDatos.Columns(9).Visible = True - Else - GvDatos.Columns(9).Visible = False - End If - - If ChkRetIVA.Checked Then - GvDatos.Columns(10).Visible = True - Else - GvDatos.Columns(10).Visible = False - End If - - If ChkRetISR.Checked Then - GvDatos.Columns(11).Visible = True - Else - GvDatos.Columns(11).Visible = False - End If - - If ChkTotalImpuestos.Checked Then - GvDatos.Columns(12).Visible = True - Else - GvDatos.Columns(12).Visible = False - End If - - If ChkTotal.Checked Then - GvDatos.Columns(13).Visible = True - Else - GvDatos.Columns(13).Visible = False - End If + GvDatos.Columns(1).Visible = ChkFolio.Checked + GvDatos.Columns(2).Visible = ChkFecha.Checked + GvDatos.Columns(3).Visible = ChkCliente.Checked + GvDatos.Columns(4).Visible = ChkSubTotal.Checked + GvDatos.Columns(5).Visible = ChkDescuento.Checked + GvDatos.Columns(6).Visible = ChlMotivoDescuento.Checked + GvDatos.Columns(7).Visible = ChkAmortizacion.Checked + GvDatos.Columns(8).Visible = ChkIVA.Checked + GvDatos.Columns(9).Visible = ChkIEPS.Checked + GvDatos.Columns(10).Visible = ChkRetIVA.Checked + GvDatos.Columns(11).Visible = ChkRetISR.Checked + GvDatos.Columns(12).Visible = ChkTotalImpuestos.Checked + GvDatos.Columns(13).Visible = ChkTotal.Checked GvDatos.Columns(14).Visible = ChkMoneda.Checked - - If ChkSucursal.Checked Then - GvDatos.Columns(15).Visible = True - Else - GvDatos.Columns(15).Visible = False - End If - - If ChkSucursalEjecucion.Checked Then - GvDatos.Columns(16).Visible = True - Else - GvDatos.Columns(16).Visible = False - End If - - If ChkCodigo.Checked Then - GvDatos.Columns(17).Visible = True - Else - GvDatos.Columns(17).Visible = False - End If - - If ChkSucursalCliente.Checked Then - GvDatos.Columns(18).Visible = True - Else - GvDatos.Columns(18).Visible = False - End If - - If ChkSucursalCobranza.Checked Then - GvDatos.Columns(19).Visible = True - Else - GvDatos.Columns(19).Visible = False - End If - - If ChkSucursalEjecucion.Checked Then - GvDatos.Columns(20).Visible = True - Else - GvDatos.Columns(20).Visible = False - End If - - If ChkVendedor.Checked Then - GvDatos.Columns(21).Visible = True - Else - GvDatos.Columns(21).Visible = False - End If - - If ChkEstatusFactura.Checked Then - GvDatos.Columns(22).Visible = True - Else - GvDatos.Columns(22).Visible = False - End If - - If ChkMotivoCancelacion.Checked Then - GvDatos.Columns(23).Visible = True - Else - GvDatos.Columns(23).Visible = False - End If - - If ChkSeTimbro.Checked Then - GvDatos.Columns(24).Visible = True - Else - GvDatos.Columns(24).Visible = False - End If - - If ChkSeEnvioMail.Checked Then - GvDatos.Columns(25).Visible = True - Else - GvDatos.Columns(25).Visible = False - End If - - If ChkCuentaContable.Checked Then - GvDatos.Columns(26).Visible = True - Else - GvDatos.Columns(26).Visible = False - End If - - If ChkUsuario.Checked Then - GvDatos.Columns(27).Visible = True - Else - GvDatos.Columns(27).Visible = False - End If - - If ChkObservaciones.Checked Then - GvDatos.Columns(28).Visible = True - Else - GvDatos.Columns(28).Visible = False - End If - + GvDatos.Columns(15).Visible = ChkSucursal.Checked + GvDatos.Columns(16).Visible = ChkSucursalEjecucion.Checked + GvDatos.Columns(17).Visible = ChkCodigo.Checked + GvDatos.Columns(18).Visible = ChkSucursalCliente.Checked + GvDatos.Columns(19).Visible = ChkSucursalCobranza.Checked + GvDatos.Columns(20).Visible = ChkSucursalEjecucion.Checked + GvDatos.Columns(21).Visible = ChkVendedor.Checked + GvDatos.Columns(22).Visible = ChkEstatusFactura.Checked + GvDatos.Columns(23).Visible = ChkMotivoCancelacion.Checked + GvDatos.Columns(24).Visible = ChkSeTimbro.Checked + GvDatos.Columns(25).Visible = ChkSeEnvioMail.Checked + GvDatos.Columns(26).Visible = ChkCuentaContable.Checked + GvDatos.Columns(27).Visible = ChkUsuario.Checked + GvDatos.Columns(28).Visible = ChkObservaciones.Checked GvDatos.Columns(29).Visible = ChkFolioFiscal.Checked - GvDatos.Columns(30).Visible = ChkMailCliente.Checked - - GvDatos.Columns(31).Visible = True = ChkEstatusFacturacion.Checked - + GvDatos.Columns(31).Visible = ChkEstatusFacturacion.Checked GvDatos.Columns(32).Visible = ChkFolioFacturacion.Checked - GvDatos.Columns(33).Visible = ChkSaldo.Checked Personalizo = 1 @@ -966,124 +807,6 @@ Partial Class RepVentaDetalle Private Function GenerarFacturaVentaDEV(CveVenta As Integer, CveUsuario As Integer) As Byte() Return DescargarFactura(CveVenta, UsuarioActual.CveEmpresa, CveUsuario) - 'Dim ObjVentas As New ClsVentas - 'Dim Vta As Modelos.Factura = Nothing - - 'Dim TmpDTImpuestos = New DataTable - 'TmpDTImpuestos.Columns.Add("ImpuestoLocal", GetType(String)) - 'TmpDTImpuestos.Columns.Add("Importe", GetType(Double)) - 'TmpDTImpuestos.Columns.Add("Orden", GetType(Integer)) - - 'If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then - ' Dim dtVentas As DataTable = ObjVentas.DtResultados - - ' ' se rellenan los campos de la factura - ' Vta = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, Server.MapPath("/")) - - ' Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString - ' 'se rellena la sucursal - ' Vta.Cliente.Sucursal = New Modelos.ClienteModel(dtVentas(0)("CveCliente").ToString.ToEntero, UsuarioActual.CveEmpresa) - ' Vta.Cliente = New Modelos.ClienteModel - ' Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString - ' Vta.Cliente.Telefono = dtVentas(0)("Telefono").ToString - ' Vta.Cliente.Direccion = dtVentas(0)("ClienteDireccion").ToString - ' Vta.Cliente.CP = dtVentas(0)("CPCliente").ToString - ' Vta.Cliente.Ciudad = dtVentas(0)("ClienteCiudad").ToString - ' Vta.Cliente.Localidad = dtVentas(0)("ClienteLocalidad").ToString - ' Vta.Cliente.Estado = dtVentas(0)("ClienteEstado").ToString - ' Vta.Cliente.Pais = dtVentas(0)("ClientePais").ToString - ' Vta.Cliente.RFC = dtVentas(0)("ClienteRFC").ToString - ' Vta.Cliente.Colonia = dtVentas(0)("ColoniaCliente").ToString - ' Vta.AtencionA = dtVentas(0)("AtencionA").ToString - ' Vta.Cliente.NoExt = dtVentas(0)("ClienteNoExt").ToString - ' Vta.Cliente.NoInt = dtVentas(0)("ClienteNoInt").ToString - ' Vta.Cliente.Codigo = dtVentas(0)("ClienteCodigo").ToString - ' Vta.Cliente.Mail = dtVentas(0)("Mail").ToString - ' Vta.RefDocto = dtVentas(0)("Ref").ToString - ' Vta.CveVenta = dtVentas(0)("CveVenta").ToString.ToEntero - - - ' Vta.ClienteSucursal = New Modelos.SucursalModel - ' Vta.ClienteSucursal.Direccion = dtVentas(0)("SucClienteDireccion").ToString - ' Vta.ClienteSucursal.NoExt = dtVentas(0)("SucClienteNoExt").ToString - ' Vta.ClienteSucursal.NoInt = dtVentas(0)("SucClienteNoInt").ToString - ' Vta.ClienteSucursal.Colonia = dtVentas(0)("SucClienteColonia").ToString - ' Vta.ClienteSucursal.CP = dtVentas(0)("SucClienteCP").ToString - ' Vta.ClienteSucursal.Municipio = dtVentas(0)("SucClienteCiudad").ToString - ' Vta.ClienteSucursal.Estado = dtVentas(0)("SucClienteEstado").ToString - ' Vta.ClienteSucursal.Pais = dtVentas(0)("SucClientePais").ToString - ' Vta.ClienteSucursal.Localidad = dtVentas(0)("SucClienteLocalidad").ToString - ' Vta.ClienteSucursal.CorreoSucursal = dtVentas(0)("SucClienteCorreo").ToString - ' Vta.ClienteSucursal.TelefonoSucursal = dtVentas(0)("SucClienteTelefono").ToString - ' Vta.ClienteSucursal.Sucursal = dtVentas(0)("SucursalCliente").ToString - - ' Vta.EnviarA = New Modelos.EnviarAModel - ' Vta.EnviarA.CveDireccionEnvio = dtVentas(0)("CveDireccionEnvio").ToString.ToEntero - ' Vta.EnviarA.EnvioDireccion = dtVentas(0)("EnvioDireccion").ToString - ' Vta.EnviarA.EnvioColonia = dtVentas(0)("EnvioColonia").ToString - ' Vta.EnviarA.EnvioCiudad = dtVentas(0)("EnvioCiudad").ToString - ' Vta.EnviarA.EnvioEstado = dtVentas(0)("EnvioEstado").ToString - ' Vta.EnviarA.EnvioCP = dtVentas(0)("EnvioCP").ToString - - ' Dim DR As DataRow = TmpDTImpuestos.NewRow() - ' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - ' If dtVentas(0)("SubTotal").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Subtotal" : DR("Importe") = dtVentas(0)("SubTotal").ToString.ToDouble : DR("Orden") = 10 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("Descuento").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Descuentos" : DR("Importe") = dtVentas(0)("Descuento").ToString.ToDouble : DR("Orden") = 20 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("Amortizacion").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Amort.Ant" : DR("Importe") = dtVentas(0)("Amortizacion").ToString.ToDouble : DR("Orden") = 30 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("SubTotal").ToString.ToDouble <> (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) Then DR("ImpuestoLocal") = "SubTotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) : DR("Orden") = 40 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("IVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "IVA" : DR("Importe") = dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 50 : TmpDTImpuestos.Rows.Add(DR) - - ' 'solo para eclipse, que muesre un subtotal debajo de IVA - ' If UsuarioActual.CveEmpresa = 15 Then DR = TmpDTImpuestos.NewRow() : DR("ImpuestoLocal") = "Subtotal2" : DR("Importe") = (dtVentas(0)("SubTotal").ToString.ToDouble - dtVentas(0)("Descuento").ToString.ToDouble - dtVentas(0)("Amortizacion").ToString.ToDouble) + dtVentas(0)("IVA").ToString.ToDouble : DR("Orden") = 51 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("RetIVA").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.IVA" : DR("Importe") = dtVentas(0)("RetIVA").ToString.ToDouble : DR("Orden") = 60 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("RetISR").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Ret.ISR" : DR("Importe") = dtVentas(0)("RetISR").ToString.ToDouble : DR("Orden") = 70 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' If dtVentas(0)("Total").ToString.ToDouble <> 0 Then DR("ImpuestoLocal") = "Total" : DR("Importe") = dtVentas(0)("Total").ToString.ToDouble : DR("Orden") = 1000 : TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' End If - - ' If ObjVentas.GetVentaDetalle(CveVenta) Then 'Obtenemos el Detalle de la Oorden de Compra - ' Vta.DtDetalle = ObjVentas.DtResultados - ' End If - - ' If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then - ' If UsuarioActual.CveEmpresa.Contiene(1, 5, 15, 17, 72, 66, 79, 81, 109, 110, 111, 76) Then - ' Dim dtImpuesto As DataTable = ObjVentas.DtResultados - ' If dtImpuesto.Rows.Count > 0 Then - ' For Each Row As DataRow In dtImpuesto.Rows - ' Dim Orden = 80 - ' If Row("Importe").ToString.ToDouble <> 0 Then - ' DR("ImpuestoLocal") = Row("ImpuestoLocal").ToString - ' DR("Importe") = Row("Importe").ToString.ToDouble - ' DR("Orden") = Orden - ' TmpDTImpuestos.Rows.Add(DR) - ' DR = TmpDTImpuestos.NewRow() - ' Orden = Orden + 1 - ' End If - ' Next - ' End If - ' Vta.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC") - ' Else - ' Vta.DtDeduccion = ObjVentas.DtResultados - ' End If - ' End If - - ' If ObjVentas.GetVentasFirmas(CveVenta) Then - ' Vta.DtFirmas = ObjVentas.DtResultados - ' End If - 'End If - 'ObjVentas.Dispose() - - 'If Not IsNothing(Vta) Then - ' PdfFactura(Vta) - ' Vta = Nothing - 'End If End Function From 42235bddda5717cbc6bad2db2487e8df910ec1af Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 17:17:10 -0700 Subject: [PATCH 02/16] --validaciones de cuadre --- Contabilidad/RegPrePolizaS.aspx | 22 +++++++++------------- Contabilidad/RegPrePolizaS.aspx.vb | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx index 26240fae6..421e49bb0 100644 --- a/Contabilidad/RegPrePolizaS.aspx +++ b/Contabilidad/RegPrePolizaS.aspx @@ -300,7 +300,7 @@
-
+
@@ -416,12 +416,12 @@ -
+
- Movimientos2 + Movimientos.
@@ -551,14 +551,14 @@ - + - + @@ -614,7 +614,7 @@
- +
@@ -622,7 +622,7 @@
- +
@@ -657,11 +657,7 @@
- - -
-
@@ -893,7 +889,7 @@
- +
@@ -901,7 +897,7 @@
- +
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb index 169028c41..d213f08be 100644 --- a/Contabilidad/RegPrePolizaS.aspx.vb +++ b/Contabilidad/RegPrePolizaS.aspx.vb @@ -1,12 +1,8 @@  Imports System.Data -Imports System.Net.NetworkInformation -Imports ADSNetLibrary.SIGAPI.Models.OC.Response 'Imports DocumentFormat.OpenXml Imports Extensiones Imports GemBox.Spreadsheet -Imports Microsoft.JScript -Imports Microsoft.Reporting.WebForms Partial Class ContabilidadC_RegPrePolizaS Inherits ClsPaginas @@ -260,6 +256,8 @@ Partial Class ContabilidadC_RegPrePolizaS 'End If Tick = DateTime.Now.Ticks.ToString + TxtTotalCargos.Attributes.Add("readonly", "readonly") + TxtTotalAbonos.Attributes.Add("readonly", "readonly") CveMoneda = 1 ViewState("CvePrePoliza") = 0 @@ -778,6 +776,7 @@ Partial Class ContabilidadC_RegPrePolizaS CargaSubProyectos() CargaCuentasContables() End If + divPrePolizas.Visible = True GvPrePoliza.Visible = True DivAgregarConceptos.Visible = False divMovtos.Visible = False @@ -786,6 +785,7 @@ Partial Class ContabilidadC_RegPrePolizaS Else DivAgregarConceptos.Visible = False divMovtos.Visible = True + divPrePolizas.Visible = False UPMovs.Update() End If @@ -936,12 +936,15 @@ Partial Class ContabilidadC_RegPrePolizaS End If 'validaciones - If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) AndAlso UsuarioActual.CveRol <> 1 Then + If ((GvPrePoliza.Visible AndAlso GvPrePoliza.Rows.Count = 0) OrElse ((GvMov.Visible AndAlso GvMov.Rows.Count = 0))) Then + Alert(" No se han especificado partidas", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + If (TotalCargos <> TotalAbonos) Then Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia) Exit Sub End If - If Not CvePrePoliza > 0 Then For Each Gvr As GridViewRow In GvMov.Rows @@ -1119,10 +1122,9 @@ Partial Class ContabilidadC_RegPrePolizaS If CveIE > 0 AndAlso gvr.DataKey("CveConceptoContable").ToEntero = 30 Then MensajeAlert.AppendFormat("

Folio Bancario: {1}", CveIE, FolioIE) End If - Next - If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePolizaInsertada, 1) Then + If MsgError = "" AndAlso Not ObjMov.ValidacionesPrePoliza(CvePrePolizaInsertada, UsuarioActual) Then If ObjMov.ValorPolizaDescuadre > 0 Then GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePolizaInsertada}", "LogPrePolizas") MsgError = ObjMov.MensajePolizaDescuadre From 6f5f41793b336c69791db904ecceea2d5891841e Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 19:46:09 -0700 Subject: [PATCH 03/16] =?UTF-8?q?--=20EN=20LA=20devoluci=C3=B3n=20que=20af?= =?UTF-8?q?ecta=20al=20almacen=20de=20recepci=C3=B3n,=20considerar=20si=20?= =?UTF-8?q?tiene=20oc=20vinculada,=20de=20ser=20as=C3=AD,=20que=20mande=20?= =?UTF-8?q?el=20dato=20al=20registro=20de=20comprasdetalle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx | 10 +++++--- Compras/Compras.aspx.vb | 51 +++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 5c3e6548a..2df209c95 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -4886,11 +4886,10 @@
Saldo: $
-
-
+
- + @@ -4915,6 +4914,11 @@ + + + + +
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 35a212363..72bb963e5 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3048,8 +3048,10 @@ Partial Class Compras_Compras 'ELIMINAR A FUERZAS If UsuarioActual.TienePermisoProceso(77) Then - If Not (IdPoliza > 0) Then - BtnEliminarCompra.Visible = True + BtnEliminarCompra.Visible = True + If CompraSaldo <> TxtTotal.Text.ToDouble AndAlso dr("TipoDocto").ToString = "Fac" Then + BtnEliminarCompra.Enabled = False + BtnEliminarCompra.ToolTip = "La compra tiene pagos asociados, elimine los pagos primero." End If End If @@ -3061,7 +3063,7 @@ Partial Class Compras_Compras If UsuarioActual.Empresa.UsaAC Then BtnEliminarCompra.Attributes.Add("data-original-title", String.Format("¿Está seguro que desea eliminar la Compra, {0} y la Poliza Asociada?", StrInventario)) - Else + ElseIf BtnEliminarCompra.Enabled Then BtnEliminarCompra.Attributes.Add("data-original-title", String.Format("¿Está seguro que desea eliminar la Compra y {0}?", StrInventario)) End If End If @@ -6600,7 +6602,7 @@ Partial Class Compras_Compras 'no es necesario, ya se está interpretandoe l usado como producto Dim ConceptoContabilizacionNC = 225 - Dim tCveClasif As Integer = -1 + Dim tCveClasif As Integer = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero Dim tCveSubProyecto As Integer = TmpDT.FiltroPrimeroValor("CveSubProyecto", "CveSubProyecto > 0 ").ToEntero Dim CveMovimientoDevolucion As Integer = -1 @@ -6612,11 +6614,14 @@ Partial Class Compras_Compras 'cuando es garantía. If DdlTipoCompra.SelectedValue = "12" Then ConceptoContabilizacionNC = 259 - tCveClasif = TmpDT.FiltroPrimeroValor("CveClasificacion", "CveClasificacion > 0 ").ToEntero End If Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}" + If Not ObjCompras.UpdateEstatusAlmacen(CveCompra, 2, UsuarioActual.CveUsuario) Then + ErrorMovInv = True + End If + If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then RegistroCuentaPuente = True Dim ImporteTransito As Decimal = 0 @@ -16205,7 +16210,7 @@ Partial Class Compras_Compras 'HACEMOS CALCULOS SubTotalIVA = TmpDT.SUM("IVA") SubTotalIEPSIVA = TmpDT.SUM("IEPSPSIVA") - SubTotal = (TmpDT.SUM("Total") + TmpDT.SUM("Descuento")).RoundSQL(6) + SubTotal = (TmpDT.SUM("Total") + TmpDT.SUM("Descuento")).RoundSQL(8) RetIVA = TmpDT.SUM("RetIVA") RetISR = TmpDT.SUM("RetISR") IEPSPS = TmpDT.SUM("IEPSPS") @@ -16674,7 +16679,7 @@ Partial Class Compras_Compras ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble - TxtPrecio.Text = GvRow.DataKey("PU").ToDecimal.ToString("#,##0.00####") + TxtPrecio.Text = GvRow.DataKey("PU").ToDecimal.ToString("#,##0.00########") TxtDescuentoModal.Text = GvRow.DataKey("Descuento").ToDecimal.ToString("#,##0.00####") LblTotalPS.Text = GvRow.DataKey("Total").FormatoNumero @@ -18271,7 +18276,7 @@ Partial Class Compras_Compras End If Else If ChkNCInvNC.Checked Then - Alert("Niguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia) + Alert("Ninguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia) ChkNCInvNC.Checked = False UpChkNCInvNC.Update() Exit Sub @@ -18360,15 +18365,18 @@ Partial Class Compras_Compras 'Dim ObjCompras As New ClsCompras 'Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL) 'Dim TieneError = False - - 'For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows - ' If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then - ' If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then - ' TieneError = True - ' Exit For - ' End If - ' End If - 'Next + Dim i As Integer = 0 + For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows + If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then + If i < TmpDT.Rows.Count Then + TmpDT.Rows(i)("CveOrdenCompraDetalle") = Gvr.DataKey("CveOrdenCompraDetalle") + End If + 'If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then + ' TieneError = True + ' Exit For + 'End If + End If + Next 'If Not TieneError Then ' Alert("Se guardo la devolución correctamente", TipoMensaje.MsgInformacion) @@ -20492,6 +20500,10 @@ Partial Class Compras_Compras dRow8_5("Descuento") = dRow8_5("Descuento").ToString.ToDecimal * Mul85 dRow8_5("Total") = dRow8_5("Total").ToString.ToDecimal * Mul85 dRow8_5("NoDeducible") = 0 + If DdlAsignaSubProyecto.SelectedValue.ToEntero > 0 Then + dRow8_5("CveSubProyecto") = DdlAsignaSubProyecto.SelectedValue.ToEntero + dRow8_5("SubProyecto") = DdlAsignaSubProyecto.SelectedItem.Text + End If psCvePs = 700563 rowPS = GlobalDTPS(UsuarioActual.CveEmpresa, psCvePs).Rows(0) @@ -20518,6 +20530,11 @@ Partial Class Compras_Compras dRow91_5("Descuento") = dRow91_5("Descuento").ToString.ToDecimal * Mul91_5 dRow91_5("Total") = dRow91_5("Total").ToString.ToDecimal * Mul91_5 dRow91_5("NoDeducible") = 1 + If DdlAsignaSubProyecto.SelectedValue.ToEntero > 0 Then + dRow91_5("CveSubProyecto") = DdlAsignaSubProyecto.SelectedValue.ToEntero + dRow91_5("SubProyecto") = DdlAsignaSubProyecto.SelectedItem.Text + End If + DTProtateo.Rows.Add(dRow8_5) DTProtateo.Rows.Add(dRow91_5) Consec = Consec + 2 From 9d1184920e31ffee3367766490605b23cef1cc9b Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 19:46:37 -0700 Subject: [PATCH 04/16] -- mejora --- Contabilidad/ContabilizacionCompras.aspx | 2 +- Contabilidad/ContabilizacionVentas.aspx | 2 +- Contabilidad/ContabilizacionVentas.aspx.cs | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Contabilidad/ContabilizacionCompras.aspx b/Contabilidad/ContabilizacionCompras.aspx index 38d109764..a655fde16 100644 --- a/Contabilidad/ContabilizacionCompras.aspx +++ b/Contabilidad/ContabilizacionCompras.aspx @@ -191,7 +191,7 @@ - + diff --git a/Contabilidad/ContabilizacionVentas.aspx b/Contabilidad/ContabilizacionVentas.aspx index cb4705728..407c6b052 100644 --- a/Contabilidad/ContabilizacionVentas.aspx +++ b/Contabilidad/ContabilizacionVentas.aspx @@ -158,7 +158,7 @@ - + diff --git a/Contabilidad/ContabilizacionVentas.aspx.cs b/Contabilidad/ContabilizacionVentas.aspx.cs index 0a7d03748..3232a689d 100644 --- a/Contabilidad/ContabilizacionVentas.aspx.cs +++ b/Contabilidad/ContabilizacionVentas.aspx.cs @@ -418,20 +418,29 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas int index = Convert.ToInt32(row.RowIndex); int CvePrePoliza = GvV.DataKeys[row.RowIndex]["CvePrePoliza"].ToString().ToEntero(); - + ObjMov.IniciaTransacSQL(); + bool HuboError = false; if (ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa)) { - if (ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 5))// por default manda la opcion 5, para ajustar a fluctuacion + var usuario = UsuarioActual; + if (ObjMov.ValidacionesPrePoliza(CvePrePoliza, ref usuario, Opcion:5,AutoConta:false))// por default manda la opcion 5, para ajustar a fluctuacion { - + Alert("Se ha simplificado la poliza correctamente", ModExtensiones.TipoMensaje.MsgInformacion); } - Alert("Se ha simplificado la poliza correctamente", ModExtensiones.TipoMensaje.MsgInformacion); + else + { HuboError = true; } } else { + HuboError = true; Alert("Ocurrió un error al simplificar la póliza", ModExtensiones.TipoMensaje.MsgError); } + if (!HuboError) + { ObjMov.Commit(); } + else + { ObjMov.RollBack(); } + ObjMov.Dispose(); cargaPolizas(); } From 466646fde9f5993cd31bda124ac46284ecc1ca86 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 19:47:07 -0700 Subject: [PATCH 05/16] -- clase texto --- Bancos/FluctuacionCambiaria.aspx.vb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Bancos/FluctuacionCambiaria.aspx.vb b/Bancos/FluctuacionCambiaria.aspx.vb index ddea8c483..6792fb427 100644 --- a/Bancos/FluctuacionCambiaria.aspx.vb +++ b/Bancos/FluctuacionCambiaria.aspx.vb @@ -464,7 +464,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() BtnGeneraCompras.Visible = False - Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) @@ -547,7 +547,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() BtnGeneraComprasAnt.Visible = False - Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() Alert("Error al generar la fluctuación", TipoMensaje.MsgError) @@ -648,7 +648,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() BtnGeneraVentas.Visible = False - Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() @@ -745,7 +745,7 @@ Partial Class Bancos_FluctuacionCambiaria If Not ErrorRegistrar Then Conta.Commit() BtnClientesAnticipos.Visible = False - Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) + Alert(String.Format("La Fluctuación se ha generado
Ver PrePóliza", CvePrePoliza), TipoMensaje.MsgInformacion) Else Conta.RollBack() From 5d96a1588bbcfe4f7d950ce0cb8506e6934f5a38 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 19:47:57 -0700 Subject: [PATCH 06/16] =?UTF-8?q?--=20comentar=20c=C3=B3dgo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad2/RepSituacionFinanciera.aspx | 4 ++-- Contabilidad2/RepSituacionFinanciera.aspx.vb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Contabilidad2/RepSituacionFinanciera.aspx b/Contabilidad2/RepSituacionFinanciera.aspx index fa55f44f0..e122aab97 100644 --- a/Contabilidad2/RepSituacionFinanciera.aspx +++ b/Contabilidad2/RepSituacionFinanciera.aspx @@ -547,7 +547,7 @@

Total del Activo:

- + @@ -571,7 +571,7 @@ - + diff --git a/Contabilidad2/RepSituacionFinanciera.aspx.vb b/Contabilidad2/RepSituacionFinanciera.aspx.vb index 516435df9..3e2dfd059 100644 --- a/Contabilidad2/RepSituacionFinanciera.aspx.vb +++ b/Contabilidad2/RepSituacionFinanciera.aspx.vb @@ -333,9 +333,9 @@ Partial Class AC2_SituacionFinanciera 'PATRIMONIO Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (5,6,8,7)") - Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (6,8)") - Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=7") - Dim DtUtilidad = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=5") + 'Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta in (6,8)") + 'Dim DtPatrimonioActualizacion = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=7") + 'Dim DtUtilidad = DtDatos.FiltraParametros("Tipo in ('F') AND TipoCuenta=5") 'Dim DtPatrimonioContribuido = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00031%' ") 'Dim DtPatrimonioGenerado = DtDatos.FiltraParametros("Tipo in ('F') AND Orden LIKE '%/00032%' ") From 524998c68a595accfb7082c1d8a5bccb8314ef49 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 19 Jun 2023 19:49:49 -0700 Subject: [PATCH 07/16] =?UTF-8?q?--=20generar=20prep=C3=B3liza=20en=20base?= =?UTF-8?q?=20a=20poliza.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Contabilidad/RegPoliza.aspx | 1 + Contabilidad/RegPoliza.aspx.vb | 252 ++++++++++++--------------------- 2 files changed, 95 insertions(+), 158 deletions(-) diff --git a/Contabilidad/RegPoliza.aspx b/Contabilidad/RegPoliza.aspx index eaee667a9..5cf040c61 100644 --- a/Contabilidad/RegPoliza.aspx +++ b/Contabilidad/RegPoliza.aspx @@ -548,6 +548,7 @@ + Prep  <%----%> diff --git a/Contabilidad/RegPoliza.aspx.vb b/Contabilidad/RegPoliza.aspx.vb index 9b89d7ad8..564ecad8c 100644 --- a/Contabilidad/RegPoliza.aspx.vb +++ b/Contabilidad/RegPoliza.aspx.vb @@ -2,6 +2,7 @@ Option Strict On Imports System.Data +Imports System.Drawing Imports Extensiones 'Imports System.Activities.Statements 'Imports msExcel = Microsoft.Office.Interop.Excel @@ -11,8 +12,7 @@ Imports Extensiones Partial Class RegPoliza Inherits ClsPaginas - Private Shared missing As Object = System.Reflection.Missing.Value - 'Dim RemoveMovimientos As New ArrayList() + #Region "P R O P E R T Y" Private Property NumRow As Integer Private Property IDPoliza As Integer @@ -213,6 +213,8 @@ Partial Class RegPoliza End If ObjConta.Dispose() + + Else Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) BtnConsultar.Enabled = False @@ -624,110 +626,6 @@ Partial Class RegPoliza End Sub - '#Region "E X C E L" - ' Private Function GetMacro() As String - ' Dim SB As New StringBuilder - ' SB.Append(" Sub AddRow(Row As String) " & vbLf) - ' SB.Append(" Rows(Row & "":"" & Row).Select " & vbLf) - ' SB.Append(" Selection.Copy " & vbLf) - ' SB.Append(" Selection.Insert Shift:=xlDown " & vbLf) - ' SB.Append(" Rows(Row+1 & "":"" & Row+1).Select " & vbLf) - ' SB.Append(" Selection.ClearContents " & vbLf) - ' SB.Append(" End Sub " & vbLf) - ' Return SB.ToString - ' End Function - - ' Private Sub GeneraPDF() - ' Dim Msg As New StringBuilder - ' Dim Excel As msExcel.Application = New msExcel.Application() - ' Dim VB_Module As VBComponent = Nothing - ' Excel.Visible = True - ' Excel.ScreenUpdating = True - ' Excel.DisplayAlerts = True - ' Dim ArchivoBase As New System.IO.FileInfo(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza.xlsm") - ' 'ArchivoBase.CopyTo(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & LtlNumeroPoliza.Text.ToString() & ".xlsm", True) - ' ArchivoBase.CopyTo(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & TxtNumeroPoliza.Text.ToString() & ".xlsm", True) - ' 'Dim ArchivoTemp As New System.IO.FileInfo(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & LtlNumeroPoliza.Text.ToString() & ".xlsm") - ' Dim ArchivoTemp As New System.IO.FileInfo(ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & TxtNumeroPoliza.Text.ToString() & ".xlsm") - - ' Dim Libro As msExcel.Workbook = Excel.Workbooks.Open(ArchivoTemp.FullName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing) - ' Libro.Activate() - - ' Dim Hoja As msExcel.Worksheet = CType(Libro.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet) - ' Hoja.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetVisible - ' Hoja.Activate() - ' VB_Module = CType(Libro.VBProject.VBComponents.Add(Microsoft.Vbe.Interop.vbext_ComponentType.vbext_ct_StdModule), VBComponent) - ' VB_Module.CodeModule.AddFromString(GetMacro) - - ' 'Encabezado - ' Hoja.Range("A1:A1").Value = UsuarioActual.Empresa.Empresa.ToString.Trim - ' Hoja.Range("F2:F2").Value = "Impresión de póliza del " + TxtFechaPoliza.Text.Trim.ToDate.ToShortDateString + " al " + TxtFechaPoliza.Text.Trim.ToDate.ToShortDateString - ' Hoja.Range("K2:K2").Value = TxtFechaPoliza.Text.Trim.ToDate.ToShortDateString - - ' 'Linea 1 datos de la poliza - ' Dim CeldaI As Integer = 9 - ' Dim CeldaF As Integer = 9 - ' Hoja.Range("A" & CeldaF & ":A" & CeldaF).Value = TxtFechaPoliza.Text.Trim.ToDate.ToShortDateString - ' Hoja.Range("C" & CeldaF & ":C" & CeldaF).Value = DdlTipoPoliza.SelectedItem.ToString.Trim - ' 'Hoja.Range("E" & CeldaF & ":E" & CeldaF).Value = LtlNumeroPoliza.Text.Trim - ' Hoja.Range("E" & CeldaF & ":E" & CeldaF).Value = TxtNumeroPoliza.Text.Trim - ' Hoja.Range("F" & CeldaF & ":F" & CeldaF).Value = TxtConcepto.Text.Trim - - ' CeldaF = CeldaF + 1 - ' 'Movimientos de la poliza Debe de haceptar 36 renglones de excel - ' For Each Row As DataRow In TmpDT.Rows - ' Libro.Application.Run("AddRow", (CeldaF - 1).ToString, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, - ' missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing) - ' Hoja.Range("A" & CeldaF & ":A" & CeldaF).Value = Row("NumMovto").ToString.Trim - ' Hoja.Range("B" & CeldaF & ":B" & CeldaF).Value = Row("Referencia").ToString.Trim - ' Hoja.Range("D" & CeldaF & ":D" & CeldaF).Value = Row("CuentaFormato").ToString.Trim - ' Hoja.Range("F" & CeldaF & ":F" & CeldaF).Value = Row("Cuenta").ToString.Trim - ' If Row("Cargo").ToString.ToDouble <> 0 Then - ' Hoja.Range("J" & CeldaF & ":J" & CeldaF).Value = Row("Cargo").ToString.FormatoNumero - ' End If - ' If Row("Abono").ToString.ToDouble <> 0 Then - ' Hoja.Range("K" & CeldaF & ":K" & CeldaF).Value = Row("Abono").ToString.FormatoNumero - ' End If - ' CeldaF = CeldaF + 1 - ' Libro.Application.Run("AddRow", (CeldaF - 1).ToString, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, - ' missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing) - ' Hoja.Range("F" & CeldaF & ":F" & CeldaF).Value = Row("Concepto").ToString.Trim - ' CeldaF = CeldaF + 1 - ' Next - ' Hoja.Range("J" & CeldaF & ":J" & CeldaF).Value = TmpDT.SUM("Cargo").FormatoNumero - ' Hoja.Range("K" & CeldaF & ":K" & CeldaF).Value = TmpDT.SUM("Abono").FormatoNumero - - ' 'Exportar PDF - ' 'Dim pdfFileOut As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & LtlNumeroPoliza.Text.ToString() & ".pdf" - ' Dim pdfFileOut As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\" & UsuarioActual.CveEmpresa & "\Formatos\Poliza_" & TxtNumeroPoliza.Text.ToString() & ".pdf" - ' Dim outputFileName As Object = pdfFileOut - ' Dim fileFormat As msExcel.XlFixedFormatType = msExcel.XlFixedFormatType.xlTypePDF - ' Libro.ExportAsFixedFormat(fileFormat, outputFileName, missing, missing, missing, missing, missing, missing, missing) - ' System.Runtime.InteropServices.Marshal.ReleaseComObject(Hoja) - ' Hoja = Nothing - ' Dim saveChanges As Object = msExcel.XlSaveAction.xlDoNotSaveChanges - ' CType(Libro, msExcel._Workbook).Close(saveChanges, missing, missing) - ' System.Runtime.InteropServices.Marshal.ReleaseComObject(Libro) - ' Libro = Nothing - ' Excel.Quit() - ' System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel) - ' Excel = Nothing - ' GC.Collect() - ' GC.WaitForPendingFinalizers() - ' ArchivoTemp.Delete() - - ' Dim Descargas As New StringBuilder() - ' 'Descargas.AppendFormat("
  • PDF
  • ", UsuarioActual.CveEmpresa, LtlNumeroPoliza.Text) - ' Descargas.AppendFormat("
  • PDF
  • ", UsuarioActual.CveEmpresa, TxtNumeroPoliza.Text) - - ' Alert("
    La impresión se generó correctamente.


    Descargas:
      " & Descargas.ToString & "
    ", TipoMensaje.MsgInformacion) - ' 'RegistraScript("AbrirVentana('/Ventas/PopUpImprimir.aspx?CveVenta=" & If(EsVistaPrevia, UsuarioActual.CveUsuario.ToString, VentaFolio) & "&Ext=PDF', 700, 400, 'N', 'ImpVenta')") - - - ' End Sub - - '#End Region - #Region " P O L I Z A S - C O M P L E M E N T A R I A S " Private Sub CargaPolizaComplementaria(tIDPoliza As Integer) @@ -982,17 +880,26 @@ Partial Class RegPoliza If ObjConta.GetPrePoliza(-1, UsuarioActual.CveEmpresa, IDPoliza) Then If ObjConta.DtResultados.Rows.Count > 0 Then CvePrePoliza = ObjConta.DtResultados.Rows(0)("CvePrePoliza").ToString.ToEntero + If UsuarioActual.CveRol = 1 Then + BtnNuevo.BackColor = Color.Yellow + BtnNuevo.ToolTip = CvePrePoliza.ToString + HplCvePrep.Visible = True + HplCvePrep.NavigateUrl = "/Contabilidad/RegPrePolizas.aspx?CvePrePoliza=" & CvePrePoliza + + End If End If End If If UsuarioActual.TienePermisoProceso(145) Then - BtnEliminar.Visible = True - End If - ' CargaDevoluciones() + BtnEliminar.Visible = True End If - - + ' CargaDevoluciones() End If + If Request("Regenera") IsNot Nothing AndAlso Request("Regenera").ToString = "1" Then + GeneraPrePoliza(tIDPoliza, DT, CvePrePoliza) + End If + + End If ObjPoliza.Dispose() ObjConta.Dispose() @@ -1244,6 +1151,82 @@ Partial Class RegPoliza ObjContabilidad.Dispose() End Sub + + Private Sub GeneraPrePoliza(tIdPoliza As Integer, dtt As DataTable, tCvePrePoliza As Integer) + Dim ObjConta As New ClsContabilidad() + ObjConta.IniciaTransacSQL() + Dim ObjContaq As New ClsContPAQi(UsuarioActual.Empresa) + ObjContaq.IniciaTransacSQL() + Dim ErrorRegistro As Boolean = False + Dim dr As DataRow = dtt.FiltroPrimero("") + Dim tCvePrePolizaOriginal As Integer = tCvePrePoliza + + If tCvePrePoliza <= 0 Then + tCvePrePoliza = ObjConta.AddPrePolizas("RegPreP/Man", 53, 0, 0, 1, dr("FechaPol").ToString.ToDate, If(dr("ConceptoPoliza").ToString = "", ".", dr("ConceptoPoliza").ToString), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, + FolioFijo:=dr("Folio").ToString.ToEntero) + Else + 'ocultar los que ya están registrados en la prepóliza + If ObjConta.GetPrePolizasDetalle(tCvePrePoliza, UsuarioActual.CveEmpresa) Then + For Each drtt As DataRow In ObjConta.DtResultados.FiltraParametros("Contabilizable = 1").Rows + ObjConta.UpdateContabilizable(drtt("CvePrePolizaDetalle").ToString.ToEntero, False) + Next + End If + End If + + If tCvePrePoliza > 0 Then + Dim dtc As DataTable = Nothing + If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then + dtc = ObjConta.DtResultados + End If + + For Each drt As DataRow In dtt.Rows + 'PrePólizaDetalle + Dim tCveCuenta As Integer = dtc.FiltroPrimeroValor("CveCuenta", $"IdCompaq={drt("IdCuenta")}").ToEntero + Dim tCveSub As Integer = If(drt("IdSegNeg").ToString <> "", GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"SubProyecto ='{drt("SegNeg")}'").ToEntero, -1) + 'If tCveSub <= 0 AndAlso drt("IdSegNeg").ToString.ToEntero = 0 Then 'toma el primero + ' tCveSub = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero + 'End If + If ObjConta.AddPrePolizasDetalle(tCvePrePoliza, drt("TipoMovto").ToString = "True", + drt("Importe").ToString.ToDecimal, + drt("Concepto").ToString, 299, + drt("Concepto").ToString, Now, + drt("IdCuenta").ToString.ToEntero, 0, + CveSubProyecto:=tCveSub, + ImporteMX:=drt("Importe").ToString.ToDecimal, CveCuenta:=tCveCuenta) Then + 'registro + If Not ObjContaq.UpdateMovimientoPrePolizaDetalle(drt("IdPoliza").ToString.ToEntero, + drt("Id").ToString.ToEntero, + ObjConta.CvePrePolizaDetalle) Then + ErrorRegistro = True + Exit For + End If + Else + ErrorRegistro = True + Exit For + End If + Next + + If Not ErrorRegistro AndAlso tCvePrePolizaOriginal <= 0 AndAlso Not ObjConta.UpdatePrePoliza(dr("FechaPol").ToString.ToDate, dr("Folio").ToString.ToEntero, -1, tIdPoliza, tCvePrePoliza, UsuarioActual.CveEmpresa, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then + ErrorRegistro = True + End If + Else + ErrorRegistro = True + End If + + If Not ErrorRegistro Then + Alert($"Ver Póliza   ") + ObjConta.Commit() + ObjContaq.Commit() + Else + ObjConta.RollBack() + ObjContaq.RollBack() + End If + + ObjConta.Dispose() + ObjContaq.Dispose() + + End Sub + #End Region #Region "Historial de Modificacion" @@ -1259,53 +1242,6 @@ Partial Class RegPoliza End Sub #End Region - 'Protected Sub TxtNumeroPoliza_TextChanged(sender As Object, e As EventArgs) Handles TxtNumeroPoliza.TextChanged - ' If HdnFolioPoliza.Value.ToEntero <> TxtNumeroPoliza.Text.Trim.ToEntero Then - ' BtnGuardar.OnClientClick = "return confirm('Intenta cambiar el número de la póliza?')" - ' Else - ' BtnGuardar.OnClientClick = "" - ' End If - ' upDatos.Update() - 'End Sub - - 'Protected Sub TxtFechaPoliza_TextChanged(sender As Object, e As EventArgs) Handles TxtFechaPoliza.TextChanged - ' If HdnFechaPoliza.Value.ToDate.ToShortDateString <> TxtFechaPoliza.Text.ToDate.ToShortDateString Then - ' BtnGuardar.OnClientClick = "return confirm('Intenta cambiar la fecha de la póliza?')" - ' Else - ' BtnGuardar.OnClientClick = "" - ' End If - ' upDatos.Update() - ' upTitulos.Update() - 'End Sub - - 'Protected Sub DdlTipoPoliza_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPoliza.SelectedIndexChanged - ' If HdnTipoPoliza.Value <> DdlTipoPoliza.SelectedValue Then - ' BtnGuardar.OnClientClick = "return confirm('Intenta Cambiar el tipo de póliza?')" - ' Else - ' BtnGuardar.OnClientClick = "" - ' End If - ' upDatos.Update() - ' upTitulos.Update() - 'End Sub - - 'TmpDT = Nothing - 'GvDatos.DataBind() - 'TxtFechaPoliza.Text = "" - 'TxtFecha.Text = "" - 'DdlTipoPoliza.SelectedIndex = 0 - 'TxtNumero.Text = "" - ''LtlNumeroPoliza.Text = "-" - 'TxtNumeroPoliza.Text = "-" - 'HdnIdPoliza.Value = "" - 'TxtConcepto.Text = "" - 'TxtReferencia.Text = "" - 'DdlCuenta.SelectedIndex = 0 - 'DdlSegNeg.SelectedIndex = 0 - 'TxtNombreConcepto.Text = "" - 'TxtCargo.Text = "" - 'TxtAbono.Text = "" - 'LblCargo.Text = "0.00" - 'LblAbono.Text = "0.00" Private Sub limpia() HdnCveCuenta.Value = "" From 30705128821210dd4acdb5f227ec39c371135f21 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Mon, 19 Jun 2023 20:07:46 -0700 Subject: [PATCH 08/16] Rep personal DIM --- App_Code/ClsNominas.vb | 20 +++++ App_Code/ClsPaginas.vb | 1 + Compras/eFacturas.aspx.vb | 61 +++++++++++--- Nomina/RepPersonalDIM.aspx | 97 ++++++++++++++++++++++ Nomina/RepPersonalDIM.aspx.vb | 149 ++++++++++++++++++++++++++++++++++ 5 files changed, 316 insertions(+), 12 deletions(-) create mode 100644 Nomina/RepPersonalDIM.aspx create mode 100644 Nomina/RepPersonalDIM.aspx.vb diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 3bc8643af..500315bf5 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -3633,6 +3633,24 @@ Public Class ClsNominas Return retorno End Function + + + Public Function GetRepPersonalDIM(Ejercicio As Integer, CveEmpresa As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_Nom_PersonalDIM", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@Ejercicio", SqlDbType.Int).Value = Ejercicio + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener el reporte Personal DIM.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) @@ -3656,6 +3674,8 @@ Public Class ClsNominas Dispose(True) GC.SuppressFinalize(Me) End Sub + + #End Region End Class diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 4757d6158..1da462c12 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -8911,6 +8911,7 @@ Public Class ClsPaginas PaginaDict.Add("/Nomina/CatSatTipoIncapacidad.aspx".ToUpper(), 258) PaginaDict.Add("/Nomina/CatSatRiesgoPuesto.aspx".ToUpper(), 259) PaginaDict.Add("/Nomina/ReportePTU.aspx".ToUpper(), 870) + PaginaDict.Add("/Nomina/RepPersonalDIM.aspx".ToUpper(), 1340) #End Region #Region "Ordenes de Servicios" PaginaDict.Add("/OS/PopUpBuscarOS.aspx".ToUpper(), 80) diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 5464021b3..ce502c1e2 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -2790,6 +2790,8 @@ Partial Class Compras_eFacturas Protected Sub LnkverificarSolicitudes_Click(ByVal sender As Object, ByVal e As EventArgs) Try Dim sbResultado As StringBuilder = New StringBuilder() + Dim TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion + For Each GvRow As GridViewRow In GVSolicitudesPendientes.Rows Dim CveSolicitudActual As Integer = GvRow.DataKey("CveSolicitud").ToEntero() @@ -2800,17 +2802,33 @@ Partial Class Compras_eFacturas Dim resultVerificacion As List(Of String) = New List(Of String)() Dim ResultadoVerificaionOK = False Dim SeVerifico = False - Dim TipoMensaje = ModExtensiones.TipoMensaje.MsgInformacion + Dim ResultadoSolicitudOK = False Dim api = New GeneralesAPIeFacturas() + Dim Verificar As Boolean = True + If idSolicitud.Length = 0 Then Dim ObjApiSolicitud As JToken = CType(api.GeneraSolicitud(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual), JToken) If Not (ObjApiSolicitud Is Nothing) Then resultSolicitud = ObjApiSolicitud.[Select](Function(token) token.Values().Aggregate(Function(i, j) $"{i}|{j}").Value(Of String)()).ToList() ResultadoSolicitudOK = Boolean.Parse(resultSolicitud(0)) - sbResultado.Append($"Solicitud {Folio} solicitada a SAT.
    ") + + Try + sbResultado.Append($"Solicitud {Folio} { resultSolicitud(1)}.
    ") + + If resultSolicitud(1).Contains("No se Generaron solicitudes al SAT") Then + Verificar = False + Else + Verificar = True + End If + Catch ex As Exception + sbResultado.Append($"Solicitud {Folio} solicitada a SAT.
    ") + Verificar = False + End Try + + Else TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia End If @@ -2821,13 +2839,24 @@ Partial Class Compras_eFacturas resultSolicitud.Add("") resultSolicitud.Add("") ResultadoSolicitudOK = True + Verificar = True End If - If ResultadoSolicitudOK Then + If ResultadoSolicitudOK And Verificar Then Dim ObjApiVerificacion As JToken = CType(api.VerificaSolicitudesNominas(UsuarioActual.CveEmpresa, CveTipoSolicitud, CveSolicitudActual), JToken) If Not (ObjApiVerificacion Is Nothing) Then resultVerificacion = ObjApiVerificacion.[Select](Function(token) token.Values().Aggregate(Function(i, j) $"{i}|{j}").Value(Of String)()).ToList() + + 'If UsuarioActual.CveRol = 1 Then + ' Dim respesta = New StringBuilder + ' For Each s As String In resultVerificacion + ' respesta.AppendLine($"{s} - ") + ' Next + + ' Alert(respesta.ToString) + 'End If + ResultadoVerificaionOK = Boolean.Parse(resultVerificacion(0)) SeVerifico = True Else @@ -2835,7 +2864,7 @@ Partial Class Compras_eFacturas End If Else - If resultSolicitud.Count = 4 Then + If resultSolicitud.Count >= 4 Then sbResultado.Append($"({resultSolicitud(1)})
    Folio:{Folio}
    ") Else sbResultado.Append($"Solicitud pendiente de verificar en SAT
    Folio:{Folio}
    ") @@ -2844,22 +2873,30 @@ Partial Class Compras_eFacturas TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia End If - If SeVerifico AndAlso resultVerificacion.Count = 4 Then - If ResultadoVerificaionOK Then - sbResultado.Append($"Solicitud procesada.
    Folio: {Folio}
    {resultVerificacion(1)}") + 'If UsuarioActual.CveRol = 1 Then + ' Alert($"SeVerifico {SeVerifico.ToString} resultVerificacion.Count {resultVerificacion.Count }") + 'End If + If Verificar Then + If SeVerifico AndAlso resultVerificacion.Count >= 4 Then + + If ResultadoVerificaionOK Then + sbResultado.Append($"Solicitud procesadaFolio: {Folio}
    {resultVerificacion(1)}") + Else + sbResultado.Append($"Solicitud no verificada
    Folio: {Folio}{resultVerificacion(1)}.
    ") + TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia + End If Else - sbResultado.Append($"Solicitud no verificada
    Folio: {Folio}{resultVerificacion(1)}.
    ") + sbResultado.Append($"Se presento un error al verificar la solicitud Folio: {Folio}.
    ") TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia End If - Else - sbResultado.Append($"Se presento un error al verificar la solicitud
    Folio: {Folio}.") - TipoMensaje = ModExtensiones.TipoMensaje.MsgAdvertencia End If - Alert(sbResultado.ToString(), TipoMensaje) + + Next + Alert(sbResultado.ToString(), TipoMensaje) cargasolicitudes() Catch ex As Exception Alert(ex.StackTrace) diff --git a/Nomina/RepPersonalDIM.aspx b/Nomina/RepPersonalDIM.aspx new file mode 100644 index 000000000..169f12671 --- /dev/null +++ b/Nomina/RepPersonalDIM.aspx @@ -0,0 +1,97 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepPersonalDIM.aspx.vb" Inherits="Nomina_RepPersonalDIM" EnableEventValidation="false" %> + + + + + + + + + + Reporte Personal DIM + + + + +
  • + Generar Excel +
  • +
  • + Descarga Archivo +
  • +
    + + + + +
    +
    +
    + + +
    +
    +
    +
    + + +
    + + +
    + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + +
    +
    + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + +
    + + + + diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb new file mode 100644 index 000000000..df4b99ab2 --- /dev/null +++ b/Nomina/RepPersonalDIM.aspx.vb @@ -0,0 +1,149 @@ +Option Explicit On +Option Strict On + +Imports System.Data +Imports System.Drawing +Imports System.IO +Imports Extensiones +Imports GemBox.Spreadsheet +Imports Microsoft.Reporting.WebForms + +Partial Class Nomina_RepPersonalDIM + Inherits ClsPaginas + + Public Property Dt_Datos As DataTable + Get + If ViewState("Dt_Datos") Is Nothing Then + ViewState("Dt_Datos") = New DataTable + End If + Return DirectCast(ViewState("Dt_Datos"), DataTable) + End Get + Set(value As DataTable) + ViewState("Dt_Datos") = value + End Set + + End Property + + Protected Sub Nomina_RepPersonalDIM(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + CargaEjercicios() + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual) + + End If + End Sub + + + Private Sub CargaEjercicios() + 'Dim ClsConta As New ClsContPAQi(UsuarioActual.Empresa) + Dim ClsConta As New ClsContabilidad + If ClsConta.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = ClsConta.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ClsConta.Dispose() + DdlEjercicio.DataBind() + + DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) + + If DdlEjercicio.Items.Count = 0 Then + DdlEjercicio.Items.Add(New ListItem(Now.Year.ToString, Now.Year.ToString)) + End If + + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + CargaDatos() + End Sub + + + Private Sub CargaDatos() + + Dt_Datos = New DataTable + LnkDescargaArchivo.Visible = False + LnkExportar.Visible = False + + Dim ObjNom As New ClsNominas + + + If ObjNom.GetRepPersonalDIM(Ejercicio:=DdlEjercicio.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa) Then + GvDatos.DataSource = ObjNom.DtResultados + Dt_Datos = ObjNom.DtResultados + + If Dt_Datos.Rows.Count > 0 Then + LnkDescargaArchivo.Visible = True + LnkExportar.Visible = True + End If + + + Else + GvDatos.DataSource = Nothing + End If + + ObjNom.Dispose() + + GvDatos.DataBind() + + + + End Sub + + +#Region "DESCARGA EXCEL" + + Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click + Imprimir("Excel") + End Sub + + Private Sub Imprimir(Optional reporte As String = "PDF") + GvDatos.ExportToExcelGembox("RepPersonalDIM", UsuarioActual, "Reporte Personal ", "", DatosFiltros:=$"Ejercicio {DdlEjercicio.SelectedItem.Text}") + + End Sub + + Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) + End Sub + + Protected Sub LnkDescargaArchivo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LnkDescargaArchivo.Click + Dim tabla As DataTable = Dt_Datos ' Reemplaza esto con tu método para obtener la tabla + + Dim contenido As String = ConvertirTablaATexto(tabla) + + ' Guardar el archivo en el servidor + Dim nombreArchivo As String = "tabla.txt" + Dim rutaArchivo As String = Server.MapPath("~/Descargas/" & nombreArchivo) + File.WriteAllText(rutaArchivo, contenido) + + ' Descargar el archivo + Response.ContentType = "text/plain" + Response.AppendHeader("Content-Disposition", "attachment; filename=" & nombreArchivo) + Response.TransmitFile(rutaArchivo) + Response.End() + End Sub + + Public Function ConvertirTablaATexto(ByVal tabla As DataTable) As String + Dim sb As New StringBuilder() + + For Each fila As DataRow In tabla.Rows + For i As Integer = 0 To tabla.Columns.Count - 1 + sb.Append(fila(i).ToString()) + + If i < tabla.Columns.Count - 1 Then + sb.Append("|") ' Agrega el separador de pipes + End If + Next + + sb.AppendLine() ' Agrega un salto de línea al final de cada fila + Next + + Return sb.ToString() + End Function + +#End Region + + + + + +End Class + From fd5962a6e740f23e94637527cd98e6033a8d38e2 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 20 Jun 2023 10:16:38 -0700 Subject: [PATCH 09/16] Ajustes columnas rep personal DIM --- Nomina/RepPersonalDIM.aspx | 796 +++++++++++++++++++++++++++++++++- Nomina/RepPersonalDIM.aspx.vb | 37 ++ 2 files changed, 820 insertions(+), 13 deletions(-) diff --git a/Nomina/RepPersonalDIM.aspx b/Nomina/RepPersonalDIM.aspx index 169f12671..ed5119b95 100644 --- a/Nomina/RepPersonalDIM.aspx +++ b/Nomina/RepPersonalDIM.aspx @@ -4,6 +4,23 @@ @@ -55,28 +72,781 @@ - - - -
    - - - - - + + + + + Mes inicial + + + + + + Mes final + + + + + + RFC + + + + + + CURP + + + + + + Apellido paterno + + + + + + Apellido materno + + + + + + Nombre + + + + + + Área geográfica + + + + + + Si el patrón realizó cálculo anual + + + + + + Tarifa utilizada del ejercicio + + + + + + Tarifa 1991 + + + + + + Proporción del subsidio + + + + + + Sindicalizado + + + + + + Si es asimilado a salarios + + + + + + Entidad Federativa + + + + + + RFC otros patrones1 + + + + + + RFC otros patrones2 + + + + + + RFC otros patrones3 + + + + + + RFC otros patrones4 + + + + + + RFC otros patrones5 + + + + + + RFC otros patrones6 + + + + + + RFC otros patrones7 + + + + + + RFC otros patrones8 + + + + + + RFC otros patrones9 + + + + + + RFC otros patrones10 + + + + + + Pagos por separación + + + + + + Asimilados a salarios + + + + + + Pagos del patrón efectuados a sus trab + + + + + + + <%-- + CvePersonal + + + --%> + + Ingresos totales por pago en parcialidades + + + + + + Monto diario percibido por jubilaciones + + + + + + Cantidad que se hubiera percibido + + + + + + Monto total del pago en una sola exhibición + + + + + + Días + + + + + + Ingresos exentos + + + + + + Ingresos gravables + + + + + + Ingresos acumulables + + + + + + Ingresos no acumulables + + + + + + Impuesto retenido + + + + + + Monto total pagado de otros pagos + + + + + + Número de años de servicio + + + + + + Ingresos exentos + + + + + + Ingresos gravados + + + + + + Ingresos acumulables (mes) + + + + + + Impuesto correspondiente(mes) + + + + + + Ingresos no acumulables + + + + + + Impuesto retenido + + + + + + + + + + + Sueldos, salarios, rayas y jornales (Gravado) + + + + + + Sueldos, salarios, rayas y jornales (Exento) + + + + + + Gratificación anual (Gravado) + + + + + + Gratificación anual (Exento) + + + + + + Viáticos y gastos de viaje (Gravado) + + + + + + Viáticos y gastos de viaje (Exento) + + + + + + Tiempo extraordinario (Gravado) + + + + + + Tiempo extraordinario (Exento) + + + + + + Prima vacacional (Gravado) + + + + + + Prima vacacional (Exento) + + + + + + Prima dominical (Gravado) + + + + + + Prima dominical (Exento) + + + + + + PTU (Gravado) + + + + + + PTU (Exento) + + + + + + Reembolso de gastos médicos,(Gravado) + + + + + + Reembolso de gastos médicos,(Exento) + + + + + + Fondo de ahorro (Gravado) + + + + + + Fondo de ahorro (Exento) + + + + + + Caja de ahorro (Gravado) + + + + + + Caja de ahorro (Exento) + + + + + + Vales para despensa (Gravado) + + + + + + Vales para despensa (Exento) + + + + + + Ayuda para gastos de funeral (Gravado) + + + + + + Ayuda para gastos de funeral (Exento) + + + + + + Contribuciones a cargo del trab(Gravado) + + + + + + Contribuciones a cargo del trab(Exento) + + + + + + Premios por puntualidad (Gravado) + + + + + + Premios por puntualidad (Exento) + + + + + + Prima de seguro de vida (Gravado) + + + + + + Prima de seguro de vida (Exento) + + + + + + Seguro de gastos médicos mayores (Gravado) + + + + + + Seguro de gastos médicos mayores (Exento) + + + + + + Vales para restaurante (Gravado) + + + + + + Vales para restaurante (Exento) + + + + + + Vales para gasolina (Gravado) + + + + + + Vales para gasolina (Exento) + + + + + + Vales para ropa (Gravado) + + + + + + Vales para ropa (Exento) + + + + + + Ayuda para renta(Gravado) + + + + + + Ayuda para renta(Exento) + + + + + + Ayuda para artículos escolares (Gravado) + + + + + + Ayuda para artículos escolares (Exento) + + + + + + Dotación o ayuda para anteojos (Gravado) + + + + + + Dotación o ayuda para anteojos (Exento) + + + + + + Ayuda para transporte (Gravado) + + + + + + Ayuda para transporte (Exento) + + + + + + Cuotas sindicales pagadas patron(Gravado) + + + + + + Cuotas sindicales pagadas patron(Exento) + + + + + + Subsidios por incapacidad (Gravado) + + + + + + Subsidios por incapacidad (Exento) + + + + + + + + + Pagos efectuados por otros empleadores(Gravado) + + + + + + Pagos efectuados por otros empleadores(Exento) + + + + + + Otros ingresos por salarios (Gravado) + + + + + + Otros ingresos por salarios (Exento) + + + + + + Suma del ingreso GRAVADO + + + + + + Suma del ingreso EXENTO + + + + + + + + + P046G + + + + + P046E + + + + + + + + Impuesto retenido durante el ejercicio + + + + + + Impuesto retenido por otro(s) patrón(es) + + + + + + Saldo a favor en el ejercicio que declara que el patrón compensará durante el siguiente ejercicio + + + + + + Saldo a favor del ejercicio anterior no compensado durante el ejercicio que declara ++ + + + + + Suma de las cantidades que por concepto de crédito al salario le correspondió al trabajador + + + + + + Crédito al salario entregado en efectivo + + + + + + Monto total de ingresos obtenidos Prev Social + + + + + + Exentos Previsión social + + + + + + Suma de ingresos por sueldos y salarios + + + + + + Monto del impuesto local a los ingresos por sueldos y salarios + + + + + + Monto del subsidio para el empleo entregado en el ejercicio + + + + + + Total de las aportaciones voluntarias deducibles + + + + + + Impuesto conforme a la tarifa anual + + + + + + Monto del subsidio acreditable (No aplica) + + + + + + Monto del subsidio no acreditable (No aplica) + + + + + + Impuesto sobre ingresos acumulables + + + + + + Impuesto sobre ingresos no acumulables + + + + + + Impuesto local a los ingresos por sueldos, salarios y en general + + + + + + Monto del subsidio para el empleo que le correspondió al trabajador durante el ejercicio + + + + + + + + - -
    diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb index df4b99ab2..27444a59c 100644 --- a/Nomina/RepPersonalDIM.aspx.vb +++ b/Nomina/RepPersonalDIM.aspx.vb @@ -141,9 +141,46 @@ Partial Class Nomina_RepPersonalDIM #End Region + Protected Sub GvDatos_DataBound(sender As Object, e As EventArgs) + + Dim row As New GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal) + Dim cell As New TableHeaderCell() + cell.Text = "ANEXO 1 INFORMACION DEL EMPLEADO ->" + cell.ColumnSpan = 28 + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) + cell = New TableHeaderCell() + cell.ColumnSpan = 16 + cell.Text = "ANEXO 1 PAGOS POR SEPARACION ->" + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.ColumnSpan = 2 + cell.Text = " ANEXO 1 ASIM SAL-> " + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) + + + cell = New TableHeaderCell() + cell.ColumnSpan = 58 + cell.Text = "ANEXO 1 PAGOS DEL PATRÓN EFECTUADOS A SUS TRABAJADORES ->" + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) + + cell = New TableHeaderCell() + cell.ColumnSpan = 19 + cell.Text = "ANEXO 1 IMPUESTO SOBRE LA RENTA (RESUMEN) ->" + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) + + 'row.BackColor = ColorTranslator.FromHtml("#3AC0F2") + GvDatos.HeaderRow.Parent.Controls.AddAt(0, row) + + End Sub End Class From 08b8d3de9eb7d8b27a2663033039ebe52894fd8d Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 20 Jun 2023 14:57:19 -0700 Subject: [PATCH 10/16] Rep Personal DIM saltos delinea en titulos de cabecera --- Nomina/RepPersonalDIM.aspx | 1511 ++++++++++++++++++++++----------- Nomina/RepPersonalDIM.aspx.vb | 62 +- 2 files changed, 1044 insertions(+), 529 deletions(-) diff --git a/Nomina/RepPersonalDIM.aspx b/Nomina/RepPersonalDIM.aspx index ed5119b95..d1e60d6e8 100644 --- a/Nomina/RepPersonalDIM.aspx +++ b/Nomina/RepPersonalDIM.aspx @@ -5,7 +5,7 @@ @@ -30,13 +38,23 @@ + + + +
  • + Descarga Excel +
  • +
  • + Descarga Archivo +
  • + +
    + + + + +
    -
  • - Generar Excel -
  • -
  • - Descarga Archivo -
  • @@ -76,769 +94,1258 @@
    - + - - - Mes inicial - + + + + Mes inicial + - + + - - Mes final - + + + Mes final + - + + - - RFC - + + + RFC + - + + - - CURP - + + + CURP + - + + - - Apellido paterno - + + + Apellido
    + paterno +
    - + +
    - - Apellido materno - + + + Apellido
    + materno +
    - + +
    - - Nombre - + + + Nombre + - + + - - Área geográfica - + + + Área
    + geográfica +
    - + +
    - - Si el patrón realizó cálculo anual - + + + Si el patrón
    + realizó
    + cálculo anual +
    - + +
    - - Tarifa utilizada del ejercicio - + + + Tarifa
    + utilizada del
    + ejercicio +
    - + +
    - - Tarifa 1991 - + + + Tarifa 1991 + - + + - - Proporción del subsidio - + + + Proporción
    + del subsidio +
    - + +
    - - Sindicalizado - + + + Sindicalizado + - + + - - Si es asimilado a salarios - + + + Si es
    + asimilado a
    + salarios +
    - + +
    - - Entidad Federativa - + + + Entidad
    + Federativa +
    - + +
    - - RFC otros patrones1 - + + + RFC otros
    + patrones1 +
    - + +
    - - RFC otros patrones2 - + + + RFC otros
    + patrones2 +
    - + +
    - - RFC otros patrones3 - + + + RFC otros
    + patrones3 +
    - + +
    - - RFC otros patrones4 - + + + RFC otros
    + patrones4 +
    - + +
    - - RFC otros patrones5 - + + + RFC otros
    + patrones5 +
    - + +
    - - RFC otros patrones6 - + + + RFC otros
    + patrones6 +
    - + +
    - - RFC otros patrones7 - + + + RFC otros
    + patrones7 +
    - + +
    - - RFC otros patrones8 - + + + RFC otros
    + patrones8 +
    - + +
    - - RFC otros patrones9 - + + + RFC otros
    + patrones9 +
    - + +
    - - RFC otros patrones10 - + + + RFC otros
    + patrones10 +
    - + +
    - - Pagos por separación - + + + Pagos por
    + separación +
    - + +
    - - Asimilados a salarios - + + + Asimilados a
    + salarios +
    - + +
    - - Pagos del patrón efectuados a sus trab - + + + Pagos del
    + patrón +
    + efectuados
    + a sus trab +
    - + +
    - <%-- + <%-- CvePersonal --%> - - Ingresos totales por pago en parcialidades - + + + Ingresos
    + totales por
    + pago en
    + parcialidades +
    - + +
    - - Monto diario percibido por jubilaciones - + + + Monto
    + diario
    + percibido
    + por jubilaciones +
    - + +
    - - Cantidad que se hubiera percibido - + + + Cantidad
    + que se
    + hubiera
    + percibido +
    - + +
    - - Monto total del pago en una sola exhibición - + + + Monto total
    + del pago en
    + una sola
    + exhibición +
    - + +
    - - Días - + + + Días + - + + - - Ingresos exentos - + + + Ingresos
    + exentos +
    - + +
    - - Ingresos gravables - + + + Ingresos
    + gravables +
    - + +
    - - Ingresos acumulables - + + + Ingresos
    + acumulables +
    - + +
    - - Ingresos no acumulables - + + + Ingresos no
    + acumulables +
    - + +
    - - Impuesto retenido - + + + Impuesto
    + retenido +
    - + +
    - - Monto total pagado de otros pagos - + + + Monto total
    + pagado de
    + otros pagos +
    - + +
    - - Número de años de servicio - + + + Número de
    + años de
    + servicio +
    - + +
    - - Ingresos exentos - + + + Ingresos
    + exentos +
    - + +
    - - Ingresos gravados - + + + Ingresos
    + gravados +
    - + +
    - - Ingresos acumulables (mes) - + + + Ingresos
    + acumulables (mes) +
    - + +
    - - Impuesto correspondiente(mes) - + + + Impuesto
    + correspondiente(mes) +
    - + +
    - - Ingresos no acumulables - + + + Ingresos no
    + acumulables +
    - + +
    - - Impuesto retenido - + + + Impuesto
    + retenido +
    - + +
    - - - Sueldos, salarios, rayas y jornales (Gravado) - + + + + Sueldos,
    + salarios,
    + rayas y
    + jornales (Gravado) +
    - + +
    - - Sueldos, salarios, rayas y jornales (Exento) - + + + Sueldos,
    + salarios,
    + rayas y
    + jornales (Exento) +
    - + +
    - - Gratificación anual (Gravado) - + + + Gratificación anual (Gravado) + - + + - - Gratificación anual (Exento) - + + + Gratificación
    + anual (Exento) +
    - + +
    - - Viáticos y gastos de viaje (Gravado) - + + + Viáticos y
    + gastos de
    + viaje (Gravado) +
    - + +
    - - Viáticos y gastos de viaje (Exento) - + + + Viáticos y
    + gastos de
    + viaje (Exento) +
    - + +
    - - Tiempo extraordinario (Gravado) - + + + Tiempo
    + extraordinario
    + (Gravado) +
    - + +
    - - Tiempo extraordinario (Exento) - + + + Tiempo
    + extraordinario
    + (Exento) +
    - + +
    - - Prima vacacional (Gravado) - + + + Prima
    + vacacional
    + (Gravado) +
    - + +
    - - Prima vacacional (Exento) - + + + Prima
    + vacacional
    + (Exento) +
    - + +
    - - Prima dominical (Gravado) - + + + Prima
    + dominical
    + (Gravado) +
    - + +
    - - Prima dominical (Exento) - + + + Prima
    + dominical
    + (Exento) +
    - + +
    - - PTU (Gravado) - + + + PTU
    + (Gravado) +
    - + +
    - - PTU (Exento) - + + + PTU
    + (Exento) +
    - + +
    - - Reembolso de gastos médicos,(Gravado) - + + + Reembolso
    + de gastos
    + médicos,
    + (Gravado) +
    - + +
    - - Reembolso de gastos médicos,(Exento) - + + + Reembolso
    + de gastos
    + médicos,
    + (Exento) +
    - + +
    - - Fondo de ahorro (Gravado) - + + + Fondo de
    + ahorro
    + (Gravado) +
    - + +
    - - Fondo de ahorro (Exento) - + + + Fondo de
    + ahorro
    + (Exento) +
    - + +
    - - Caja de ahorro (Gravado) - + + + Caja de
    + ahorro
    + (Gravado) +
    - + +
    - - Caja de ahorro (Exento) - + + + Caja de
    + ahorro
    + (Exento) +
    - + +
    - - Vales para despensa (Gravado) - + + + Vales para
    + despensa
    + (Gravado) +
    - + +
    - - Vales para despensa (Exento) - + + + Vales para
    + despensa
    + (Exento) +
    - + +
    - - Ayuda para gastos de funeral (Gravado) - + + + Ayuda para
    + gastos de
    + funeral
    + (Gravado) +
    - + +
    - - Ayuda para gastos de funeral (Exento) - + + + Ayuda para
    + gastos de
    + funeral
    + (Exento) +
    - + +
    - - Contribuciones a cargo del trab(Gravado) - + + + Contribuciones
    + a cargo del
    + trab(Gravado) +
    - + +
    - - Contribuciones a cargo del trab(Exento) - + + + Contribuciones
    + a cargo del
    + trab(Exento) +
    - + +
    - - Premios por puntualidad (Gravado) - + + + Premios por
    + puntualidad
    + (Gravado) +
    - + +
    - - Premios por puntualidad (Exento) - + + + Premios por
    + puntualidad
    + (Exento) +
    - + +
    - - Prima de seguro de vida (Gravado) - + + + Prima de
    + seguro de
    + vida (Gravado) +
    - + +
    - - Prima de seguro de vida (Exento) - + + + Prima de
    + seguro de
    + vida (Exento) +
    - + +
    - - Seguro de gastos médicos mayores (Gravado) - + + + Seguro de
    + gastos médicos
    + mayores (Gravado) +
    - + +
    - - Seguro de gastos médicos mayores (Exento) - + + + Seguro de
    + gastos médicos
    + mayores (Exento) +
    - + +
    - - Vales para restaurante (Gravado) - + + + Vales para
    + restaurante
    + (Gravado) +
    - + +
    - - Vales para restaurante (Exento) - + + + Vales para
    + restaurante +
    + (Exento) +
    - + +
    - - Vales para gasolina (Gravado) - + + + Vales para
    + gasolina
    + (Gravado) +
    - + +
    - - Vales para gasolina (Exento) - + + + Vales para
    + gasolina
    + (Exento) +
    - + +
    - - Vales para ropa (Gravado) - + + + Vales para
    + ropa (Gravado) +
    - + +
    - - Vales para ropa (Exento) - + + + Vales para
    + ropa (Exento) +
    - + +
    - - Ayuda para renta(Gravado) - + + + Ayuda para
    + renta(Gravado) +
    - + +
    - - Ayuda para renta(Exento) - + + + Ayuda para
    + renta(Exento) +
    - + +
    - - Ayuda para artículos escolares (Gravado) - + + + Ayuda para
    + artículos +
    + escolares (Gravado) +
    - + +
    - - Ayuda para artículos escolares (Exento) - + + + Ayuda para
    + artículos
    + escolares (Exento) +
    - + +
    - - Dotación o ayuda para anteojos (Gravado) - + + + Dotación o
    + ayuda para
    + anteojos (Gravado) +
    - + +
    - - Dotación o ayuda para anteojos (Exento) - + + + Dotación o
    + ayuda para
    + anteojos (Exento) +
    - + +
    - - Ayuda para transporte (Gravado) - + + + Ayuda para
    + transporte (Gravado) +
    - + +
    - - Ayuda para transporte (Exento) - + + + Ayuda par
    + a transporte (Exento) +
    - + +
    - - Cuotas sindicales pagadas patron(Gravado) - + + + Cuotas sindicales
    + pagadas patron(Gravado) +
    - + +
    - - Cuotas sindicales pagadas patron(Exento) - + + + Cuotas sindicales
    + pagadas patron(Exento) +
    - + +
    - - Subsidios por incapacidad (Gravado) - + + + Subsidios por
    + incapacidad (Gravado) +
    - + +
    - - Subsidios por incapacidad (Exento) - + + + Subsidios por
    + incapacidad (Exento) +
    - + +
    - - Pagos efectuados por otros empleadores(Gravado) - + + + Pagos
    + efectuados
    + por otros
    + empleadores
    + (Gravado) +
    - + +
    - - Pagos efectuados por otros empleadores(Exento) - + + + Pagos
    + efectuados
    + por otros
    + empleadores
    + (Exento) +
    - + +
    - - Otros ingresos por salarios (Gravado) - + + + Otros
    + ingresos por
    + salarios
    + (Gravado) +
    - + +
    - - Otros ingresos por salarios (Exento) - + + + Otros
    + ingresos por
    + salarios
    + (Exento) +
    - + +
    - - Suma del ingreso GRAVADO - + + + Suma del
    + ingreso
    + GRAVADO +
    - + +
    - - Suma del ingreso EXENTO - + + + Suma del
    + ingreso
    + EXENTO +
    - + +
    - + P046G - + + - + P046E - + + - - - - - Impuesto retenido durante el ejercicio - + + + + + + Impuesto
    + retenido
    + durante el
    + ejercicio +
    - + +
    - - Impuesto retenido por otro(s) patrón(es) - + + + Impuesto
    + retenido por
    + otro(s)
    + patrón(es) +
    - + +
    - - Saldo a favor en el ejercicio que declara que el patrón compensará durante el siguiente ejercicio - + + + Saldo a favor
    + en el ejercicio
    + que declara +
    + que el patrón +
    + compensará durante
    + el siguiente
    + ejercicio +
    - + +
    - - Saldo a favor del ejercicio anterior no compensado durante el ejercicio que declara -+ + + + Saldo a favor
    + del ejercicio anterior
    + no compensado
    + durante el
    + ejercicio que
    + declara ++ +
    - + +
    - - Suma de las cantidades que por concepto de crédito al salario le correspondió al trabajador - + + + Suma de las
    + cantidades +
    + que por concepto
    + de crédito al +
    + salario le +
    + correspondió +
    + al trabajador +
    - + +
    - - Crédito al salario entregado en efectivo - + + + Crédito al
    + salario
    + entregado
    + en efectivo +
    - + +
    - - Monto total de ingresos obtenidos Prev Social - + + + Monto total
    + de ingresos
    + obtenidos +
    + Prev Social +
    - + +
    - - Exentos Previsión social - + + + Exentos +
    + Previsión
    + social +
    - + +
    - - Suma de ingresos por sueldos y salarios - + + + Suma de ingresos por sueldos y salarios + - + + - - Monto del impuesto local a los ingresos por sueldos y salarios - + + + Monto del
    + impuesto local
    + a los ingresos
    + por sueldos
    + y salarios +
    - + +
    - - Monto del subsidio para el empleo entregado en el ejercicio - + + + Monto del
    + subsidio para
    + el empleo
    + entregado en
    + el ejercicio +
    - + +
    - - Total de las aportaciones voluntarias deducibles - + + + Total de
    + las aportaciones
    + voluntarias
    + deducibles +
    - + +
    - - Impuesto conforme a la tarifa anual - + + + Impuesto
    + conforme a la
    + tarifa anual +
    - + +
    - - Monto del subsidio acreditable (No aplica) - + + + Monto del
    + subsidio +
    + acreditable +
    + (No aplica) +
    - + +
    - - Monto del subsidio no acreditable (No aplica) - + + + Monto del
    + subsidio no
    + acreditable +
    + (No aplica) +
    - + +
    - - Impuesto sobre ingresos acumulables - + + + Impuesto sobre
    + ingresos
    + acumulables +
    - + +
    - - Impuesto sobre ingresos no acumulables - + + + Impuesto sobre
    + ingresos
    + no acumulables +
    - + +
    - - Impuesto local a los ingresos por sueldos, salarios y en general - + + + Impuesto local
    + a los ingresos
    + por sueldos,
    + salarios +
    + y en general +
    - + +
    - - Monto del subsidio para el empleo que le correspondió al trabajador durante el ejercicio - + + + Monto del
    + subsidio para
    + el empleo
    + que le correspondió +
    + al trabajador +
    + durante +
    + el ejercicio +
    - + +
    diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb index 27444a59c..3a4c7f605 100644 --- a/Nomina/RepPersonalDIM.aspx.vb +++ b/Nomina/RepPersonalDIM.aspx.vb @@ -85,6 +85,8 @@ Partial Class Nomina_RepPersonalDIM GvDatos.DataBind() + UpAcciones.Update() + UpGvCargaDatos.Update() End Sub @@ -105,38 +107,44 @@ Partial Class Nomina_RepPersonalDIM End Sub Protected Sub LnkDescargaArchivo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LnkDescargaArchivo.Click - Dim tabla As DataTable = Dt_Datos ' Reemplaza esto con tu método para obtener la tabla + Dim tabla As DataTable = Dt_Datos - Dim contenido As String = ConvertirTablaATexto(tabla) + Dim contenidoBytes As Byte() = Encoding.UTF8.GetBytes(ConvertirTablaATexto(tabla)) - ' Guardar el archivo en el servidor - Dim nombreArchivo As String = "tabla.txt" - Dim rutaArchivo As String = Server.MapPath("~/Descargas/" & nombreArchivo) - File.WriteAllText(rutaArchivo, contenido) + Using memoryStream As New MemoryStream(contenidoBytes) + Response.Clear() + Response.ContentType = "text/plain" + Response.AddHeader("Content-Disposition", $"attachment; filename=RepPersonalDIM{DdlEjercicio.SelectedItem.Text}.txt") + memoryStream.WriteTo(Response.OutputStream) + End Using - ' Descargar el archivo - Response.ContentType = "text/plain" - Response.AppendHeader("Content-Disposition", "attachment; filename=" & nombreArchivo) - Response.TransmitFile(rutaArchivo) Response.End() + End Sub Public Function ConvertirTablaATexto(ByVal tabla As DataTable) As String + + 'Dim sb As New StringBuilder() + 'For Each GvRow As GridViewRow In GvDatos.Rows + ' For Each GvCell As TableCell In GvRow.Cells + ' sb.Append(GvCell.ID & "|") + ' Next + ' sb.AppendLine() + 'Next + 'Return sb.ToString() + Dim sb As New StringBuilder() - - For Each fila As DataRow In tabla.Rows - For i As Integer = 0 To tabla.Columns.Count - 1 - sb.Append(fila(i).ToString()) - - If i < tabla.Columns.Count - 1 Then - sb.Append("|") ' Agrega el separador de pipes - End If + For Each gvRow As GridViewRow In GvDatos.Rows + For Each gvCell As TableCell In gvRow.Cells + Dim columnIndex As Integer = gvRow.Cells.GetCellIndex(gvCell) + Dim rowIndex As Integer = gvRow.RowIndex + Dim cellID As String = "cell_" & rowIndex.ToString() & "_" & columnIndex.ToString() + sb.Append(gvRow.Cells(columnIndex).Controls(0).ClientID & "|") Next - - sb.AppendLine() ' Agrega un salto de línea al final de cada fila + sb.AppendLine() Next - Return sb.ToString() + End Function #End Region @@ -153,17 +161,17 @@ Partial Class Nomina_RepPersonalDIM cell = New TableHeaderCell() - cell.ColumnSpan = 16 + cell.ColumnSpan = 18 cell.Text = "ANEXO 1 PAGOS POR SEPARACION ->" cell.HorizontalAlign = HorizontalAlign.Left row.Controls.Add(cell) - cell = New TableHeaderCell() - cell.ColumnSpan = 2 - cell.Text = " ANEXO 1 ASIM SAL-> " - cell.HorizontalAlign = HorizontalAlign.Left - row.Controls.Add(cell) + 'cell = New TableHeaderCell() + 'cell.ColumnSpan = 2 + 'cell.Text = " ANEXO 1 ASIM SAL-> " + 'cell.HorizontalAlign = HorizontalAlign.Left + 'row.Controls.Add(cell) cell = New TableHeaderCell() From c2347ce2c09e52e2820c8d53103aad612f526410 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 20 Jun 2023 15:28:17 -0700 Subject: [PATCH 11/16] Rep Personal Dim, ajuste columnas y descarga txt --- Nomina/RepPersonalDIM.aspx | 35 ++++++++++++++------------ Nomina/RepPersonalDIM.aspx.vb | 46 ++++++++++++++++++++++------------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/Nomina/RepPersonalDIM.aspx b/Nomina/RepPersonalDIM.aspx index d1e60d6e8..6fbc9d46c 100644 --- a/Nomina/RepPersonalDIM.aspx +++ b/Nomina/RepPersonalDIM.aspx @@ -1030,6 +1030,24 @@
    + + + Becas para
    trabajadores
    (Gravado) +
    + + + +
    + + + Becas para
    trabajadores
    (Exento) +
    + + + +
    + + @@ -1096,22 +1114,7 @@ - - - - - - P046G - - - - - - P046E - - - - +
    diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb index 3a4c7f605..dcb0cdc1f 100644 --- a/Nomina/RepPersonalDIM.aspx.vb +++ b/Nomina/RepPersonalDIM.aspx.vb @@ -4,6 +4,7 @@ Option Strict On Imports System.Data Imports System.Drawing Imports System.IO +Imports CrystalDecisions.CrystalReports.Engine Imports Extensiones Imports GemBox.Spreadsheet Imports Microsoft.Reporting.WebForms @@ -122,28 +123,39 @@ Partial Class Nomina_RepPersonalDIM End Sub - Public Function ConvertirTablaATexto(ByVal tabla As DataTable) As String + Public Function ConvertirTablaATexto(ByVal DT As DataTable) As String - 'Dim sb As New StringBuilder() - 'For Each GvRow As GridViewRow In GvDatos.Rows - ' For Each GvCell As TableCell In GvRow.Cells - ' sb.Append(GvCell.ID & "|") - ' Next - ' sb.AppendLine() - 'Next - 'Return sb.ToString() + Dim DTDatos As DataTable = DT.Copy() - Dim sb As New StringBuilder() - For Each gvRow As GridViewRow In GvDatos.Rows - For Each gvCell As TableCell In gvRow.Cells - Dim columnIndex As Integer = gvRow.Cells.GetCellIndex(gvCell) - Dim rowIndex As Integer = gvRow.RowIndex - Dim cellID As String = "cell_" & rowIndex.ToString() & "_" & columnIndex.ToString() - sb.Append(gvRow.Cells(columnIndex).Controls(0).ClientID & "|") + Dim columnasARemover As New List(Of DataColumn)() + + + For Each columna As DataColumn In DTDatos.Columns + If columna.ColumnName.Contains("CvePersonal") Then + columnasARemover.Add(columna) + End If + Next + + + For Each columna As DataColumn In columnasARemover + DTDatos.Columns.Remove(columna) + Next + + DTDatos.AcceptChanges() + + Dim sb As New StringBuilder + For Each fila As DataRow In DTDatos.Rows + For i As Integer = 0 To DTDatos.Columns.Count - 1 + sb.Append(fila(i).ToString()) + + If i < DTDatos.Columns.Count - 1 Then + sb.Append("|") + End If Next sb.AppendLine() Next - Return sb.ToString() + + Return sb.tostring End Function From 0570bde1ba37ebe8a9dea328920939cb0760fd01 Mon Sep 17 00:00:00 2001 From: Oscar Irigoyen Date: Tue, 20 Jun 2023 16:22:13 -0700 Subject: [PATCH 12/16] Rep Personal DIM ajuestecolumnas --- Nomina/RepPersonalDIM.aspx | 444 +++++++++++++++++----------------- Nomina/RepPersonalDIM.aspx.vb | 255 ++++++++++++++++++- 2 files changed, 469 insertions(+), 230 deletions(-) diff --git a/Nomina/RepPersonalDIM.aspx b/Nomina/RepPersonalDIM.aspx index 6fbc9d46c..b16f700cb 100644 --- a/Nomina/RepPersonalDIM.aspx +++ b/Nomina/RepPersonalDIM.aspx @@ -101,7 +101,7 @@ Style="margin-top: -10px; text-align: center;" GridLines="None"> - + Mes inicial @@ -109,7 +109,7 @@ - + Mes final @@ -117,7 +117,7 @@ - + RFC @@ -125,7 +125,7 @@ - + CURP @@ -133,7 +133,7 @@ - + Apellido
    paterno @@ -142,7 +142,7 @@
    - + Apellido
    materno @@ -151,7 +151,7 @@
    - + Nombre @@ -159,7 +159,7 @@ - + Área
    geográfica @@ -168,7 +168,7 @@
    - + Si el patrón
    realizó
    @@ -178,7 +178,7 @@
    - + Tarifa
    utilizada del
    @@ -188,7 +188,7 @@
    - + Tarifa 1991 @@ -196,7 +196,7 @@ - + Proporción
    del subsidio @@ -205,7 +205,7 @@
    - + Sindicalizado @@ -213,7 +213,7 @@ - + Si es
    asimilado a
    @@ -223,7 +223,7 @@
    - + Entidad
    Federativa @@ -232,7 +232,7 @@
    - + RFC otros
    patrones1 @@ -241,7 +241,7 @@
    - + RFC otros
    patrones2 @@ -250,7 +250,7 @@
    - + RFC otros
    patrones3 @@ -259,7 +259,7 @@
    - + RFC otros
    patrones4 @@ -268,7 +268,7 @@
    - + RFC otros
    patrones5 @@ -277,7 +277,7 @@
    - + RFC otros
    patrones6 @@ -286,7 +286,7 @@
    - + RFC otros
    patrones7 @@ -295,7 +295,7 @@
    - + RFC otros
    patrones8 @@ -304,7 +304,7 @@
    - + RFC otros
    patrones9 @@ -313,7 +313,7 @@
    - + RFC otros
    patrones10 @@ -322,25 +322,25 @@
    - + Pagos por
    separación
    - +
    - + Asimilados a
    salarios
    - +
    - + Pagos del
    patrón @@ -349,17 +349,17 @@ a sus trab
    - +
    - <%-- + <%-- CvePersonal --%> - + Ingresos
    totales por
    @@ -367,10 +367,10 @@ parcialidades
    - +
    - + Monto
    diario
    @@ -378,10 +378,10 @@ por jubilaciones
    - +
    - + Cantidad
    que se
    @@ -389,10 +389,10 @@ percibido
    - +
    - + Monto total
    del pago en
    @@ -400,10 +400,10 @@ exhibición
    - +
    - + Días @@ -411,123 +411,123 @@ - + Ingresos
    exentos
    - +
    - + Ingresos
    gravables
    - +
    - + Ingresos
    acumulables
    - +
    - + Ingresos no
    acumulables
    - +
    - + Impuesto
    retenido
    - +
    - + Monto total
    pagado de
    otros pagos
    - +
    - + Número de
    años de
    servicio
    - +
    - + Ingresos
    exentos
    - +
    - + Ingresos
    gravados
    - +
    - + Ingresos
    acumulables (mes)
    - +
    - + Impuesto
    correspondiente(mes)
    - +
    - + Ingresos no
    acumulables
    - +
    - + Impuesto
    retenido
    - +
    @@ -535,7 +535,7 @@ - + Sueldos,
    salarios,
    @@ -543,10 +543,10 @@ jornales (Gravado)
    - +
    - + Sueldos,
    salarios,
    @@ -554,125 +554,125 @@ jornales (Exento)
    - +
    - + Gratificación anual (Gravado) - + - + Gratificación
    anual (Exento)
    - +
    - + Viáticos y
    gastos de
    viaje (Gravado)
    - +
    - + Viáticos y
    gastos de
    viaje (Exento)
    - +
    - + Tiempo
    extraordinario
    (Gravado)
    - +
    - + Tiempo
    extraordinario
    (Exento)
    - +
    - + Prima
    vacacional
    (Gravado)
    - +
    - + Prima
    vacacional
    (Exento)
    - +
    - + Prima
    dominical
    (Gravado)
    - +
    - + Prima
    dominical
    (Exento)
    - +
    - + PTU
    (Gravado)
    - +
    - + PTU
    (Exento)
    - +
    - + Reembolso
    de gastos
    @@ -680,10 +680,10 @@ (Gravado)
    - +
    - + Reembolso
    de gastos
    @@ -691,70 +691,70 @@ (Exento)
    - +
    - + Fondo de
    ahorro
    (Gravado)
    - +
    - + Fondo de
    ahorro
    (Exento)
    - +
    - + Caja de
    ahorro
    (Gravado)
    - +
    - + Caja de
    ahorro
    (Exento)
    - +
    - + Vales para
    despensa
    (Gravado)
    - +
    - + Vales para
    despensa
    (Exento)
    - +
    - + Ayuda para
    gastos de
    @@ -762,10 +762,10 @@ (Gravado)
    - +
    - + Ayuda para
    gastos de
    @@ -773,100 +773,100 @@ (Exento)
    - +
    - + Contribuciones
    a cargo del
    trab(Gravado)
    - +
    - + Contribuciones
    a cargo del
    trab(Exento)
    - +
    - + Premios por
    puntualidad
    (Gravado)
    - +
    - + Premios por
    puntualidad
    (Exento)
    - +
    - + Prima de
    seguro de
    vida (Gravado)
    - +
    - + Prima de
    seguro de
    vida (Exento)
    - +
    - + Seguro de
    gastos médicos
    mayores (Gravado)
    - +
    - + Seguro de
    gastos médicos
    mayores (Exento)
    - +
    - + Vales para
    restaurante
    (Gravado)
    - +
    - + Vales para
    restaurante @@ -874,66 +874,66 @@ (Exento)
    - +
    - + Vales para
    gasolina
    (Gravado)
    - +
    - + Vales para
    gasolina
    (Exento)
    - +
    - + Vales para
    ropa (Gravado)
    - +
    - + Vales para
    ropa (Exento)
    - +
    - + Ayuda para
    renta(Gravado)
    - +
    - + Ayuda para
    renta(Exento)
    - +
    - + Ayuda para
    artículos @@ -941,115 +941,115 @@ escolares (Gravado)
    - +
    - + Ayuda para
    artículos
    escolares (Exento)
    - +
    - + Dotación o
    ayuda para
    anteojos (Gravado)
    - +
    - + Dotación o
    ayuda para
    anteojos (Exento)
    - +
    - + Ayuda para
    transporte (Gravado)
    - +
    - + Ayuda par
    a transporte (Exento)
    - +
    - + Cuotas sindicales
    pagadas patron(Gravado)
    - +
    - + Cuotas sindicales
    pagadas patron(Exento)
    - +
    - + Subsidios por
    incapacidad (Gravado)
    - +
    - + Subsidios por
    incapacidad (Exento)
    - +
    - + Becas para
    trabajadores
    (Gravado)
    - +
    - + Becas para
    trabajadores
    (Exento)
    - +
    - + Pagos
    efectuados
    @@ -1058,10 +1058,10 @@ (Gravado)
    - +
    - + Pagos
    efectuados
    @@ -1070,10 +1070,10 @@ (Exento)
    - +
    - + Otros
    ingresos por
    @@ -1081,10 +1081,10 @@ (Gravado)
    - +
    - + Otros
    ingresos por
    @@ -1092,33 +1092,33 @@ (Exento)
    - +
    - + Suma del
    ingreso
    GRAVADO
    - +
    - + Suma del
    ingreso
    EXENTO
    - +
    - + Impuesto
    retenido
    @@ -1126,10 +1126,10 @@ ejercicio
    - +
    - + Impuesto
    retenido por
    @@ -1137,10 +1137,10 @@ patrón(es)
    - +
    - + Saldo a favor
    en el ejercicio
    @@ -1153,10 +1153,10 @@ ejercicio
    - +
    - + Saldo a favor
    del ejercicio anterior
    @@ -1167,10 +1167,10 @@ +
    - +
    - + Suma de las
    cantidades @@ -1185,10 +1185,10 @@ al trabajador
    - +
    - + Crédito al
    salario
    @@ -1196,10 +1196,10 @@ en efectivo
    - +
    - + Monto total
    de ingresos
    @@ -1208,10 +1208,10 @@ Prev Social
    - +
    - + Exentos
    @@ -1219,18 +1219,18 @@ social
    - +
    - + - Suma de ingresos por sueldos y salarios + Suma de
    ingresos
    por sueldos
    y salarios
    - +
    - + Monto del
    impuesto local
    @@ -1239,10 +1239,10 @@ y salarios
    - +
    - + Monto del
    subsidio para
    @@ -1251,10 +1251,10 @@ el ejercicio
    - +
    - + Total de
    las aportaciones
    @@ -1262,20 +1262,20 @@ deducibles
    - +
    - + Impuesto
    conforme a la
    tarifa anual
    - +
    - + Monto del
    subsidio @@ -1285,10 +1285,10 @@ (No aplica)
    - +
    - + Monto del
    subsidio no
    @@ -1297,30 +1297,30 @@ (No aplica)
    - +
    - + Impuesto sobre
    ingresos
    acumulables
    - +
    - + Impuesto sobre
    ingresos
    no acumulables
    - +
    - + Impuesto local
    a los ingresos
    @@ -1330,10 +1330,10 @@ y en general
    - +
    - + Monto del
    subsidio para
    @@ -1347,7 +1347,7 @@ el ejercicio
    - +
    diff --git a/Nomina/RepPersonalDIM.aspx.vb b/Nomina/RepPersonalDIM.aspx.vb index dcb0cdc1f..d264bf3ac 100644 --- a/Nomina/RepPersonalDIM.aspx.vb +++ b/Nomina/RepPersonalDIM.aspx.vb @@ -100,10 +100,8 @@ Partial Class Nomina_RepPersonalDIM End Sub Private Sub Imprimir(Optional reporte As String = "PDF") - GvDatos.ExportToExcelGembox("RepPersonalDIM", UsuarioActual, "Reporte Personal ", "", DatosFiltros:=$"Ejercicio {DdlEjercicio.SelectedItem.Text}") - + ExportToExcelGembox(GvDatos, "RepPersonalDIM", UsuarioActual, "Reporte Personal DIM", "", DatosFiltros:=$"Ejercicio {DdlEjercicio.SelectedItem.Text}") End Sub - Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) End Sub @@ -179,11 +177,11 @@ Partial Class Nomina_RepPersonalDIM row.Controls.Add(cell) - 'cell = New TableHeaderCell() - 'cell.ColumnSpan = 2 - 'cell.Text = " ANEXO 1 ASIM SAL-> " - 'cell.HorizontalAlign = HorizontalAlign.Left - 'row.Controls.Add(cell) + cell = New TableHeaderCell() + cell.ColumnSpan = 2 + cell.Text = " ANEXO 1 ASIM SAL-> " + cell.HorizontalAlign = HorizontalAlign.Left + row.Controls.Add(cell) cell = New TableHeaderCell() @@ -202,5 +200,246 @@ Partial Class Nomina_RepPersonalDIM GvDatos.HeaderRow.Parent.Controls.AddAt(0, row) End Sub + + + + + Public Sub ExportToExcelGembox(GridView As GridView, NombreArchivoXLSx As String, Usuario As Usuario, Titulo As String, Optional DatoTituloExtra As String = "", Optional DatosFiltros As String = "", Optional AnchoImagen As Integer = 100, Optional AlturaImagen As Integer = 100, Optional DTExtra As DataTable = Nothing) + + Dim sw1 As New StringWriter() + Dim htw1 As New HtmlTextWriter(sw1) + GridView.RenderControl(htw1) + + Dim options = GemBox.Spreadsheet.LoadOptions.HtmlDefault + + Dim htmlStream1 = New MemoryStream(options.Encoding.GetBytes(sw1.ToString())) + + htmlStream1.Position = 0 + Dim sr1 As New StreamReader(htmlStream1) + Dim myStr1 = sr1.ReadToEnd() + sr1.Dispose() + htmlStream1.Dispose() + sw1.Dispose() + + Dim HtmlCompleto As String = myStr1 + + HtmlCompleto = Regex.Replace(HtmlCompleto, "\<[\/]*a[^\>]*\>", "") + + Dim htmlStream5 = New MemoryStream(options.Encoding.GetBytes(HtmlCompleto)) + + GemBox.Spreadsheet.SpreadsheetInfo.SetLicense(SerialGemBoxSpreadsheet) + + Dim excel As GemBox.Spreadsheet.ExcelFile + + excel = GemBox.Spreadsheet.ExcelFile.Load(htmlStream5, options) + + If Usuario IsNot Nothing Then + + Dim TotalRowHeader As Integer = 6 + Dim TotalRowFooter As Integer = 2 + + + Dim worksheet = excel.Worksheets(0) + worksheet.Rows.InsertEmpty(0, TotalRowHeader) + Dim celdasConTexto = worksheet.GetUsedCellRange(True) + If celdasConTexto Is Nothing Then Exit Sub 'No se recuperaron datos, salir de sin guardar porque soltará error + 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 + + If DatoTituloExtra.Length > 0 Then + Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex) + RangoDatoTituloExtra.Merged = True + RangoDatoTituloExtra.Value = DatoTituloExtra + RangoDatoTituloExtra.Style.Font.Size = 20 * 20 + RangoDatoTituloExtra.Style.Font.Name = "Calibri Light" + RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left + RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + End If + + If DatosFiltros.Length > 0 Then + + Dim Arreglo As String() = DatosFiltros.Split("|"c) + worksheet.Rows.InsertEmpty(TotalRowHeader, Arreglo.Count) + For Each TextoFiltro As String In Arreglo + Dim RangoDatoTituloExtra = worksheet.Cells.GetSubrangeAbsolute(TotalRowHeader, celdasConTexto.FirstColumnIndex, TotalRowHeader, celdasConTexto.LastColumnIndex) + RangoDatoTituloExtra.Merged = True + RangoDatoTituloExtra.Value = TextoFiltro + RangoDatoTituloExtra.Style.Font.Size = 12 * 20 + RangoDatoTituloExtra.Style.Font.Name = "Calibri Light" + RangoDatoTituloExtra.Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Left + RangoDatoTituloExtra.Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + TotalRowHeader += 1 + + Next + End If + + ' TotalRowHeader += 2 + + For i = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + worksheet.Rows(TotalRowHeader).Cells(i).Style.Font.Size = 12 * 20 + worksheet.Rows(TotalRowHeader).Cells(i).Style.HorizontalAlignment = GemBox.Spreadsheet.HorizontalAlignmentStyle.Center + worksheet.Rows(TotalRowHeader).Cells(i).Style.VerticalAlignment = GemBox.Spreadsheet.VerticalAlignmentStyle.Center + + worksheet.Rows(TotalRowHeader).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(TotalRowHeader).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 = GridView.Rows.Count + TotalRowHeader + TotalRowFooter + + worksheet.Rows(IndexEndTable).Cells(1).Value = "Usuario Imprimió" + worksheet.Rows(IndexEndTable + 1).Cells(1).Value = Usuario.Nombre + + worksheet.Rows(IndexEndTable).Cells(3).Value = "Fecha Impresión" + worksheet.Rows(IndexEndTable + 1).Cells(3).Value = DateTime.Now.ToString("dd/MM/yyyy") + + Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", Usuario.Empresa.Ruta)) + + If Imagen.Exists Then + Dim Ruta As String = String.Format("{0}/Logo.png", Usuario.Empresa.Ruta) + Using sr As New StreamReader(Ruta) + Dim ms As New MemoryStream() + sr.BaseStream.CopyTo(ms) + worksheet.Pictures.Add(ms, ExcelPictureFormat.Png, "A1", AnchoImagen, AlturaImagen, LengthUnit.Pixel) + End Using + End If + + + For I = celdasConTexto.FirstColumnIndex To celdasConTexto.LastColumnIndex + + If I > 0 Then + + If 1 = 1 Then + worksheet.Columns(I + 1).Style.NumberFormat = "#,##0.00" + Else + worksheet.Columns(I + 1).Style.NumberFormat = "#,##" + End If + + Try + worksheet.Columns(I).AutoFit(1) + Catch ex As Exception + End Try + + End If + Next + + + + If DTExtra IsNot Nothing Then + + Dim NombreTabla As String = "" + + If DTExtra.TableName IsNot Nothing Then + NombreTabla = DTExtra.TableName + End If + + If NombreTabla.Trim = "" Then + NombreTabla = "hoja2" + End If + + 'excel.Worksheets.Add(NombreTabla) + + Dim workbookDTExtra = New ExcelFile + Dim worksheetDTExtra = workbookDTExtra.Worksheets.Add(NombreTabla) + + + worksheetDTExtra.InsertDataTable(DTExtra, + New InsertDataTableOptions() With + { + .ColumnHeaders = True, + .StartRow = 0 + }) + + + + Dim columnCount = worksheetDTExtra.CalculateMaxUsedColumns() + For i As Integer = 0 To columnCount - 1 + worksheetDTExtra.Columns(i).AutoFit(1, worksheetDTExtra.Rows(1), worksheetDTExtra.Rows(worksheetDTExtra.Rows.Count - 1)) + worksheetDTExtra.Cells(0, i).Style.FillPattern.SetSolid(Drawing.ColorTranslator.FromHtml("#4b77be")) + worksheetDTExtra.Cells(0, i).Style.Font.Color = GemBox.Spreadsheet.SpreadsheetColor.FromArgb(255, 255, 255) + + Next + + + excel.Worksheets.AddCopy(NombreTabla, worksheetDTExtra) + excel.Worksheets(0).Name = Titulo + End If + + + + Dim indexRow As Integer = 8 + Dim indexRowGV As Integer = 0 + Dim cssClassRow As String = "" + + Dim CountRowFiltros As Integer = -1 + If DatosFiltros.Trim.Length > 0 Then + CountRowFiltros = 0 + End If + + For indexRow = 8 To worksheet.Rows.Count - 4 + + Try + cssClassRow = GridView.Rows(indexRowGV).CssClass.Trim() + + Select Case cssClassRow + + Case "Totales" + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#67809f")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#ddd") + Exit Select + Case "SubTotales2" + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#c0c0c0")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#000077") + Exit Select + Case "SubTotales" + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.FillPattern.SetSolid(System.Drawing.ColorTranslator.FromHtml("#dddddd")) + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Weight = 1000 + worksheet.Cells.GetSubrangeRelative(indexRow + CountRowFiltros, 0, celdasConTexto.LastColumnIndex + 1, 1).Style.Font.Color = System.Drawing.ColorTranslator.FromHtml("#67809F") + Exit Select + Case Else + Exit Select + End Select + + Catch ex As Exception + End Try + + indexRowGV += 1 + Next + + + + End If + + excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") + + + End Sub End Class From 70321b772928489bb67ea202e2436c635d55662b Mon Sep 17 00:00:00 2001 From: rrene Date: Tue, 20 Jun 2023 16:23:06 -0700 Subject: [PATCH 13/16] -- mejora visual --- Bancos/RepProgramarRecursos.aspx | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Bancos/RepProgramarRecursos.aspx b/Bancos/RepProgramarRecursos.aspx index c8073cca1..909bba2e7 100644 --- a/Bancos/RepProgramarRecursos.aspx +++ b/Bancos/RepProgramarRecursos.aspx @@ -3,7 +3,14 @@ <%@ Import Namespace="Extensiones" %> - + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + + + + + TOTAL ACTIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!TipoCuenta.Value + Equal + + 1 + + + + 2.6512cm + 0.31432cm + 1.65cm + 10.42504cm + + + Verdana + 8pt + + + + + + + 5.36361cm + + + 2.86585cm + + + 2.19558cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum( Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + In + + =CStr("A,B,C").Split(",") + + + + =Fields!TipoCuenta.Value + Equal + + 2 + + + + 4.74417cm + 0.31432cm + 1.65cm + 10.42504cm + 1 + + + Verdana + 8pt + + + + + + + 5.21467cm + + + 2.56871cm + + + 1.91058cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!TipoCuenta.Value + Equal + + 3 + + + + 2.6512cm + 10.77464cm + 1.65cm + 9.69396cm + 2 + + + Verdana + 8pt + + + + + + + 5.21467cm + + + 2.56871cm + + + 1.91058cm + + + + + 0.6cm + + + + + true + true + + + + + PASIVO NO CIRCULANTE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL PASIVO NO CIRCULANTE + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + D + + + + =Fields!TipoCuenta.Value + Equal + + 4 + + + + 4.74417cm + 10.77464cm + 1.65cm + 9.69396cm + 3 + + + Verdana + 8pt + + + + true + true + + + + + ACTIVO + + + + + + + Textbox28 + 1.91009cm + 0.31432cm + 0.6cm + 10.46032cm + 4 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + PASIVO + + + + + + + Textbox28 + 1.91009cm + 10.77464cm + 0.6cm + 9.69395cm + 5 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 5.21467cm + + + 2.56871cm + + + 1.91058cm + + + + + 0.6cm + + + + + true + true + + + + + CAPITAL CONTABLE + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL CAPITAL + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!Tipo.Value + Equal + + F + + + + =Fields!TipoCuenta.Value + In + + 5 + 6 + 7 + 8 + + + + 8.30193cm + 10.77464cm + 1.65cm + 9.69396cm + 6 + + + Verdana + 8pt + + + + true + true + + + + + CAPITAL + + + + + + + Textbox28 + 7.52554cm + 10.77464cm + 0.6cm + 9.69395cm + 7 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total CAPITAL + + + + + + + Textbox45 + 10.22837cm + 10.77464cm + 0.6cm + 4.89717cm + 8 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPatrimonioHActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total Pasivo y Patrimonio + + + + + + + Textbox45 + 11.12267cm + 10.77464cm + 0.6cm + 4.89717cm + 11 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalpasivoYHaciendaActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Total del Pasivo: + + + + + + + Textbox45 + 6.57056cm + 10.77464cm + 0.6cm + 5.21467cm + 14 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalPasivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Iif( Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2) <.005,"" ,"La suma de los totales estan descuadradas." & Round(Math.Abs(Variables!TotalActivoActual.Value-Variables!TotalpasivoYHaciendaActual.Value),2)) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + External + = Parameters!pImg.Value + FitProportional + 0.03141cm + 0.31432cm + 1.5cm + 5.36361cm + 18 + + + + + + true + true + + + + + =Parameters!pEmp.Value + + + + + + + Textbox1 + 0.03141cm + 5.67793cm + 0.81167cm + 10.31137cm + 19 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + Estado de Situación Financiera + + + + =Parameters!periodo.Value + + + + + + + Textbox5 + 0.89924cm + 5.67793cm + 0.6cm + 10.31137cm + 20 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.07056cm + 15.98931cm + 0.81167cm + 4.47928cm + 21 + + + 2pt + 2pt + 2pt + 2pt + + + + + + + 5.36361cm + + + 2.86585cm + + + 2.19558cm + + + + + 0.6cm + + + + + true + true + + + + + ACTIVO DIFERIDO + + + + + + + Textbox7 + + + 2pt + 2pt + 2pt + 2pt + + + 3 + + + + + + + + 0.45cm + + + + + true + + + + + =Fields!Nombre.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ImporteAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + TOTAL ACTIVO DIFERIDO + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteActual.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Sum(Fields!ImporteAnterior.Value) + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + true + + + + + + Before + + + + DataSet1 + + + =Fields!TipoCuenta.Value + Equal + + 9 + + + + 6.92554cm + 0.31432cm + 1.65cm + 10.42504cm + 22 + + + Verdana + 8pt + + + + true + true + + + + + Total del Activo + + + + + + + Textbox45 + 11.12267cm + 0.31432cm + 0.6cm + 5.36361cm + 23 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoAnterior.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Variables!TotalActivoActual.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + 4.88706in + + + + =Parameters!pFechaFin.Value + + + + + + + Textbox5 + 3.454cm + 0.6cm + 12.91455cm + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + ="Fecha Impresión:" & vbcrlf & Format( Globals!ExecutionTime,"dd/MM/yyyy") + + + + + + + Textbox8 + 0.02088cm + 16.62517cm + 0.57912cm + 3.49249cm + 1 + + = (Globals.PageNumber=1) + + + + 2pt + 2pt + + + + + + + + + 2.46062cm + true + true + + + true + true + + + + + ="Página " & Globals.PageNumber & " de " & Globals.TotalPages + + + + + + + Textbox3 + 1.86062cm + 16.37931cm + 0.6cm + 3.95896cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma2.Value + + + + Textbox2 + 0.10583cm + 1.71666cm + 0.99688cm + 8.02269cm + 1 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma2.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Parameters!pFirma1.Value + + + + Textbox2 + 1.46374cm + 6.03938cm + 0.99688cm + 8.02269cm + 2 + + = Iif((Globals.PageNumber=Globals.TotalPages) and (Parameters!pFirma1.Value <> ""),false,true) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + + + + + + Textbox2 + 0.10582cm + 10.37435cm + 0.99688cm + 8.02269cm + 3 + + =Microsoft.VisualBasic.Interaction.Iif((Globals!PageNumber = Globals!TotalPages) And (Parameters!pFirma1.Value <> ""), False, True) + + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 27.94cm + 21.59cm + 0.5cm + 0.5cm + 0.5cm + 0.5cm + 0.13cm +