From 79e50a87784dc336a7937db7bf301bec63ccc201 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 20 Nov 2024 15:50:56 -0700 Subject: [PATCH] =?UTF-8?q?Correci=C3=B3n=20Compras=20Aplica=20Lote=20ps?= =?UTF-8?q?=20no=20encontrado,=20Vya=20Contrato=20Contrato=20detalle=20men?= =?UTF-8?q?sajes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Compras/Compras.aspx.vb | 21 +++++++++++++++++---- Transportes/RepContratoDetalle.aspx.vb | 15 ++++++++++++--- Transportes/RepContratos.aspx.vb | 8 +++++++- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 7355670af..3115445a3 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -11135,8 +11135,15 @@ Partial Class Compras_Compras dRow("UUIDRow") = Guid.NewGuid().ToString() End If Dim CvePS As Integer = dRow("CvePS").ToString.ToEntero - dRow("AplicaLote") = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}")) - dRow("AplicaCaducidad") = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) + + dRow("AplicaLote") = False + dRow("AplicaCaducidad") = False + + If CvePS > 0 Then + dRow("AplicaLote") = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}")) + dRow("AplicaCaducidad") = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) + End If + Next TmpDT.AcceptChanges() @@ -11229,8 +11236,14 @@ Partial Class Compras_Compras Dim CvePS As Integer = e.Row.DataKey("CvePS").ToEntero - Dim AplicaLote As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}")) - Dim AplicaCaducidad As Boolean = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) + Dim AplicaLote As Boolean = False + Dim AplicaCaducidad As Boolean = False + + If CvePS > 0 Then + AplicaLote = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaLote", $"CvePS={CvePS}")) + AplicaCaducidad = Boolean.Parse(GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("AplicaCaducidad", $"CvePS={CvePS}")) + End If + If AplicaLote Then e.Row.FCTextBox("TxtLote").Visible = True diff --git a/Transportes/RepContratoDetalle.aspx.vb b/Transportes/RepContratoDetalle.aspx.vb index 1f1950308..a48b2d8b4 100644 --- a/Transportes/RepContratoDetalle.aspx.vb +++ b/Transportes/RepContratoDetalle.aspx.vb @@ -541,6 +541,8 @@ Partial Class RepContratoDetalle Protected Sub UpdateContrato(sender As Object, e As EventArgs) Dim ArchivoUpdate As String = "-1" Dim ErrorProceso As Boolean = False + Dim SeGeneroRemision As Boolean = False + Dim SerieFolioRemision As String = "" If Session("FileExtension").ToString <> "" Then 'ArchivoUpdate = $"{CveContrato.ToString}.{ Session("FileExtension")}" @@ -584,8 +586,9 @@ Partial Class RepContratoDetalle If Respuesta.CveVenta > 0 Then CveVentaRemision = Respuesta.CveVenta - 'SerieFolioRemision = Respuesta.SerieFolio + SerieFolioRemision = Respuesta.SerieFolio ErrorProceso = False + SeGeneroRemision = True Else ErrorProceso = True Alert("se presento un error al generar la remisión", TipoMensaje.MsgAdvertencia) @@ -593,10 +596,16 @@ Partial Class RepContratoDetalle End If If Not ErrorProceso Then - ObjContratos.Commit() AgregarABitacora($"Actualización del contrato {CveContrato}") - Alert("Contrato actualizado correctamente") + + If SeGeneroRemision Then + Alert($"Contrato actualizado correctamente..
Remisión Generada {SerieFolioRemision}", TipoMensaje.MsgInformacion, "window.location.reload();") + Else + Alert("Contrato actualizado correctamente", TipoMensaje.MsgInformacion, "window.location.reload();") + End If + + Else Alert("Ocurrió un ocurrió un error al actualizar su boleto", TipoMensaje.MsgError) ObjContratos.RollBack() diff --git a/Transportes/RepContratos.aspx.vb b/Transportes/RepContratos.aspx.vb index 2a132f422..754c713f5 100644 --- a/Transportes/RepContratos.aspx.vb +++ b/Transportes/RepContratos.aspx.vb @@ -211,7 +211,13 @@ Partial Class ListadoContratos If Not ErrorProceso Then ObjContratos.Commit() - Alert($"Agregado Correctamente.
Remisión Generada {SerieFolioRemision}") + + If CveVentaRemision > 0 Then + Alert($"Agregado Correctamente.
Remisión Generada {SerieFolioRemision}") + Else + Alert($"Agregado Correctamente") + End If + Else ObjContratos.RollBack() Alert("Se presento un error al guardar el contrato.", TipoMensaje.MsgAdvertencia)