From b7b9249beab929f747282a955eb32fb0a86436cf Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 21 May 2025 01:01:07 -0700 Subject: [PATCH] eFacturas correciones decargas sustitucion de pdf --- AF/AF.aspx | 95 +++++++++++++++++++++++++++++++++++++++ AF/AF.aspx.vb | 35 +++++++++++++++ Compras/eFacturas.aspx.vb | 22 +++++++-- 3 files changed, 148 insertions(+), 4 deletions(-) diff --git a/AF/AF.aspx b/AF/AF.aspx index 9c9d4f745..16220043b 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -932,6 +932,101 @@ + + <%-- Documentos --%> +
+
+
+
+ Documentos +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index 03cc2db05..45d284ece 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -4947,4 +4947,39 @@ Partial Class AF_AF RegistraScript("$('#ModalContaCuenta').modal('show');") End Sub + + + 'Private Sub CargaDocumentacion() + + ' If CveActivoFijo > 0 Then + ' Dim objRH As New ClsEdocumentacion() + + ' If objRH.DocumentacionElectronicaGet(CvePersonal, -1, -1, UsuarioActual.Empresa.CveEmpresa, -1) Then + ' DTDocumentacion = objRH.DtResultados + ' End If + + ' If DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ").Rows.Count > 0 Then + ' GvDocumentosFirma.DataSource = DTDocumentacion.FiltraParametros(" CveDocumentacionTipo = 7 ") + ' Else + ' GvDocumentosFirma.DataSource = Nothing + ' End If + + + ' If DTDocumentacion.FiltraParametros(" Modulo = 7 ").Rows.Count > 0 Then + ' GVMaterialidad.DataSource = DTDocumentacion.FiltraParametros(" Modulo = 7 ") + ' Else + ' GVMaterialidad.DataSource = Nothing + ' End If + + ' GVMaterialidad.DataBind() + ' GvDocumentosFirma.DataBind() + + ' UpMaterialidad.Update() + ' UPGvDocumentosFirma.Update() + ' UpGvDocumentosFirma2.Update() + ' End If + + 'End Sub + + End Class \ No newline at end of file diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index fcb3d3044..eda8a2cb2 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1612,7 +1612,7 @@ Partial Class Compras_eFacturas End Sub - Private Sub SubirFacturas(ByRef ListComprimidos As List(Of String), ByRef ListXML As List(Of String), ByRef ListPDF As List(Of String), Optional Validada As Integer = 0) + Private Sub SubirFacturas(ByRef ListComprimidos As List(Of String), ByRef ListXML As List(Of String), ByRef ListPDF As List(Of String), Optional Validada As Integer = 0, Optional SobreEscribirPDFSiExiste As Boolean = True) Dim DTLOG As New DataTable DTLOG.Columns.Add("Serie", GetType(String)) DTLOG.Columns.Add("Folio", GetType(String)) @@ -1753,11 +1753,25 @@ Partial Class Compras_eFacturas If FF IsNot Nothing AndAlso FF.CveFactura > 0 Then + Dim PDfDestino As String = $"{UsuarioActual.Empresa.Ruta}\Compras\{FF.EmisorRFC}\{FF.CveFactura}.PDF" + + If RutaPDF = "" Then + Dim Hilo As New System.Threading.Thread(Sub() ProcesarPDF(UsuarioActual, a, FF)) - Hilo.Start() + + 'no valida nada solo lo crea y lo pone en la carpeta, no importa si ya existe + If SobreEscribirPDFSiExiste Then + Hilo.Start() + Else + 'si no existe el pdf, lo procesa + If Not File.Exists(RutaPDF) Then + Hilo.Start() + End If + End If + Else - Dim PDfDestino As String = $"{UsuarioActual.Empresa.Ruta}\Compras\{FF.EmisorRFC}\{FF.CveFactura}.PDF" + If File.Exists(RutaPDF) Then If File.Exists(PDfDestino) Then File.Delete(PDfDestino) @@ -3036,7 +3050,7 @@ Partial Class Compras_eFacturas End If If SeVerifico Then - SubirFacturas(ListComprimidos, ListXML, ListPDF, Validada:=1) + SubirFacturas(ListComprimidos, ListXML, ListPDF, Validada:=1, SobreEscribirPDFSiExiste:=False) End If 'If UsuarioActual.CveRol = 1 Then