From 7d643dc8ac10bca6156e772a17e56b1c01ece523 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 10 Jul 2023 11:07:12 -0700 Subject: [PATCH] Cambios en entrega almacen --- Inventarios/EntregaAlmacen.aspx | 6 +++--- Inventarios/EntregaAlmacen.aspx.vb | 29 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx b/Inventarios/EntregaAlmacen.aspx index 4a3ee93ec..277f7e9b2 100644 --- a/Inventarios/EntregaAlmacen.aspx +++ b/Inventarios/EntregaAlmacen.aspx @@ -638,12 +638,12 @@ Serie: - + <%-- - - + --%> Fecha Caducidad: diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 79d6dd7ab..2daea9ce8 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -1142,11 +1142,11 @@ Partial Class Inventarios_EntregaAlmacen If CveMetodoInventario = 6 Then - RegistraScript("$('#DivLote').modal('show')") + RegistraScript("$('#DivLote').modal({backdrop: 'static', keyboard: false});") CargaLote() UpLoteBatch.Update() Else - RegistraScript("$('#DivSerie').modal('show')") + RegistraScript("$('#DivSerie').modal({backdrop: 'static', keyboard: false});") CargaSerie() UpSerie.Update() End If @@ -1173,7 +1173,7 @@ Partial Class Inventarios_EntregaAlmacen End Sub Private Sub CargaSerie(Optional CerrarCompletado As Boolean = False, Optional CargaMasivo As Boolean = False) - If Not CargaMasivo Then RegistraScript("$('#DivSerie').modal('show')", "show") + If Not CargaMasivo Then RegistraScript("$('#DivSerie').modal({backdrop: 'static', keyboard: false})", "show") Dim AplicaCaducidad = False Dim dttt As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie) @@ -1270,8 +1270,7 @@ Partial Class Inventarios_EntregaAlmacen Dim Series As String = Nothing Series = TxtSerie.Text.Trim - Series = Series.Remove(0, 1) - Series = Series.Remove(Series.Length - 1, 1) + Series = Series.Replace("*", "") ArraySeries = Series.Trim.Split(","c) For i As Integer = 0 To ArraySeries.Length - 1 @@ -1285,7 +1284,12 @@ Partial Class Inventarios_EntregaAlmacen Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional CargaMasivo As Boolean = False) If Serie.Trim = "" Then - Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Alert("El campo 'Serie' es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If Serie.Trim.Length < 6 Then + Alert("El campo 'Serie' debe tener minimo 6 caracteres. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Exit Sub End If @@ -1433,7 +1437,7 @@ Partial Class Inventarios_EntregaAlmacen End Sub Private Sub CargaLote(Optional CerrarCompletado As Boolean = False) - RegistraScript("$('#DivLote').modal('show')") + RegistraScript("$('#DivLote').modal({backdrop: 'static', keyboard: false})") GvLote.Columns(2).HeaderText = UsuarioActual.Empresa.Funcionalidad(147) GvLote.DataSource = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC") GvLote.DataBind() @@ -3353,6 +3357,11 @@ Partial Class Inventarios_EntregaAlmacen Dim CveSeccionAlmacen As Integer = -1 For Each Dr As DataRow In DtDatos.Rows + + If ErrorMovInv Then + Exit For + End If + FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha) Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1") CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1) @@ -3363,7 +3372,7 @@ Partial Class Inventarios_EntregaAlmacen For Each Dr1 As DataRow In DtDetalle.Rows If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then ErrorMovInv = True - TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar." + TextoError = $"Ocurrió un error al procesar los conceptos con serie '{Dr1("Serie").ToString()}'. Por favor vuelva a intentar." Exit For End If Next @@ -3990,7 +3999,7 @@ Partial Class Inventarios_EntregaAlmacen UpVerSugerencias.Update() - RegistraScript("$('#ModalVerSugerencias').modal()") + RegistraScript("$('#ModalVerSugerencias').modal({backdrop: 'static', keyboard: false});") End Sub Protected Sub BtnAplicarSugerencias_Click(sender As Object, e As EventArgs) @@ -4171,7 +4180,7 @@ Partial Class Inventarios_EntregaAlmacen HdnCveVenta.Value = CveVentaSurtir.ToString CargaModalCombosDirecciones(CveCliente, CveDireccionEnvio) - RegistraScript("$('#DivEditarEntrega').modal('show');") + RegistraScript("$('#DivEditarEntrega').modal({backdrop: 'static', keyboard: false});") End Sub