From 152426c11c0ce19e18ff380fb3006bcc35c25d6c Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 28 Jan 2021 17:39:02 -0700 Subject: [PATCH] =?UTF-8?q?eFacturas=20vingulaci=C3=B3n=20de=20complemento?= =?UTF-8?q?,=20al=20vincular=20manualmente=20vincular=20todos=20los=20docu?= =?UTF-8?q?mentos,=20si=20no=20encunetra=20la=20=20compra=20y=20prep=C3=B3?= =?UTF-8?q?lzia=20detalle=20vincular=20al=20primer=20resuiltado=20=20que?= =?UTF-8?q?=20coincida?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/eFacturas.aspx.vb | 25 ++++++++++++++----------- TareasProgramadas/Tareas119.ashx | 26 ++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb index 3b39e3541..ed6cba02e 100644 --- a/Compras/eFacturas.aspx.vb +++ b/Compras/eFacturas.aspx.vb @@ -1686,6 +1686,8 @@ Partial Class Compras_eFacturas End Using End Sub + + Public Shared Function CargaEmisordeXML(ArchivoXML As String, CampoXML As String, RFCEmpresaActual As String) As String Dim Valor As [String] = Nothing @@ -3142,15 +3144,6 @@ Partial Class Compras_eFacturas If ObjCompras.GetCompararComplementoPago(CveProveedor, -1, "", UsuarioActual.CveEmpresa, HdnCveIE.Value.ToEntero) Then - 'GvVincularPago.DataSource = ObjCompras.DtResultados - - 'If ObjCompras.DtResultados.Rows.Count > 0 Then - ' SerieFolioIE = ObjCompras.DtResultados.Rows(0)("SerieFolio").ToString - 'End If - - - 'ImportePago = ObjCompras.DtResultados.SUMD("Monto") - For Each Drow As DataRow In ObjCompras.DtResultados.Rows For Each GvRow As GridViewRow In GVPDocumentosRelacionadosPagos.Rows @@ -3171,16 +3164,26 @@ Partial Class Compras_eFacturas For Each GvRow As GridViewRow In GVPDocumentosRelacionadosPagos.Rows If GvRow.RowType = DataControlRowType.DataRow Then + If GvRow.FCLabel("LblCveIE").Text.ToEntero > 0 And GvRow.FCLabel("LblCvePrePolizaDetalle").Text.ToEntero > 0 Then ErrorVinculacion = False - Exit For + Else - ErrorVinculacion = True + + If ObjCompras.DtResultados.Rows.Count > 0 Then + GvRow.FCLabel("LblCveIE").Text = ObjCompras.DtResultados(0)("CveIE").ToString.ToEntero.ToString + GvRow.FCLabel("LblCvePrePolizaDetalle").Text = ObjCompras.DtResultados(0)("CvePrePolizaDetalle").ToString.ToEntero.ToString + Else + ErrorVinculacion = True + Exit For + End If End If End If + Next + Else ErrorVinculacion = True End If diff --git a/TareasProgramadas/Tareas119.ashx b/TareasProgramadas/Tareas119.ashx index 3ce799f59..d9a93a4e3 100644 --- a/TareasProgramadas/Tareas119.ashx +++ b/TareasProgramadas/Tareas119.ashx @@ -29,7 +29,27 @@ public class TareasJam : IHttpHandler retorno = PruebaConexionFTP("ftp://us2.hostedftp.com/", "agrojam", "A12345678"); break; case "EjecutaThalamus": - retorno =EjecutaThalamus(CveEmpresa); + + try + { + if (context.Application["EjecutaThalamusRuning"].ToEntero() == 1) + { + retorno = true; + } + else + { + context.Application["EjecutaThalamusRuning"] = 1; + System.Threading.Thread.Sleep(500); + retorno = EjecutaThalamus(CveEmpresa, context); + context.Application["EjecutaThalamusRuning"] = 0; + } + + } + catch { + retorno = false; + context.Application["EjecutaThalamusRuning"] = 0; + } + break; default: break; @@ -46,10 +66,12 @@ public class TareasJam : IHttpHandler context.Response.End(); } - private bool EjecutaThalamus(int CveEmpresa) + private bool EjecutaThalamus(int CveEmpresa, HttpContext context) { + + this.GuardaLog("EjecutaThalamus: Inicio. "); bool Respuesta = false;