From e91eb17b9c7e49d14f1548a494b4b9ebcfc7f852 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 7 Jul 2025 11:31:20 -0700 Subject: [PATCH] =?UTF-8?q?--=20activaci=C3=B3n=20de=20combo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntregaAlmacen.aspx.vb | 46 +++++++++++++++++++----------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index e28995f1c..898abf2db 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -128,7 +128,17 @@ Partial Class Inventarios_EntregaAlmacen End Set End Property - + Private Property SeleccionLoteCaducidadCombo As Boolean + Get + If ViewState("SeleccionLoteCaducidadCombo") Is Nothing Then + ViewState("SeleccionLoteCaducidadCombo") = False + End If + Return CType(ViewState("SeleccionLoteCaducidadCombo"), Boolean) + End Get + Set(value As Boolean) + ViewState("SeleccionLoteCaducidadCombo") = value + End Set + End Property Private Property TipoEstatus As Integer Get @@ -631,18 +641,13 @@ Partial Class Inventarios_EntregaAlmacen TipoEntrega = 1 BtnGuardar.Visible = True - Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,26)" - If UsuarioActual.CveSubProyecto = 8804 Then - StrAlmacenes = "CveTipoAlmacen IN (1,2,12)" - End If - + Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,4, 26)" Dim ObjInventario As New ClsInventarios If ObjInventario.EntregaAlmacenGet(CveVenta, UsuarioActual.CveEmpresa, CveAlmacen) Then If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then Dim CveVentaPadre As Integer = -1 - ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) ArchivoBitacoraDetalle = String.Format("{0}Temp\EntregaDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta) If ArchivoBitacora <> "" Then @@ -902,6 +907,11 @@ Partial Class Inventarios_EntregaAlmacen Case Else Filtro = "CveConcepto = 9" End Select + 'condicion especial cuando es tipo uso de material + 'CveTipoVenta + If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso CveTipoVenta.Contiene(5, 6) AndAlso TipoDocto = "Ped" Then + Filtro = "CveConcepto = 8" 'salida del almacen de consigna + End If If ObjInventario.GetInv_Mov(CveVentaPadre, UsuarioActual.CveEmpresa) Then DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro} " & FiltroPS) @@ -1064,8 +1074,6 @@ Partial Class Inventarios_EntregaAlmacen Private Sub CargaGvDatos(Optional RecargaVenta As Boolean = True) If DtDatos IsNot Nothing Then - - Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean If DtDatos IsNot Nothing AndAlso DtDatos.Rows.Count > 0 Then AplicaSerie = CBool(DtDatos.MAX("AplicaSerie")) @@ -1079,6 +1087,7 @@ Partial Class Inventarios_EntregaAlmacen If AplicaCaducidad Then GvDatos.Columns(10).Visible = True If UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then + SeleccionLoteCaducidadCombo = True GvDatos.Columns(8).Visible = True GvDatos.Columns(9).Visible = False GvDatos.Columns(10).Visible = False @@ -1285,7 +1294,7 @@ Partial Class Inventarios_EntregaAlmacen If Boolean.Parse(e.Row.DataKey("AplicaLote")) Or Boolean.Parse(e.Row.DataKey("AplicaCaducidad")) Then Dim ValorAsignado As String = "" Dim DtDatosDevolucion As DataTable = Nothing - If GvDatos.Columns(8).Visible AndAlso EsDevolucionVenta = 1 Then + If SeleccionLoteCaducidadCombo AndAlso EsDevolucionVenta = 1 Then ValorAsignado = $"{e.Row.DBCampo("Lote").ToString}|{e.Row.DBCampo("FechaCaducidad").ToDate.ToString("dd/MM/yyyy")}" DtDatosDevolucion = DtDatos.Copy() End If @@ -1308,8 +1317,6 @@ Partial Class Inventarios_EntregaAlmacen Dim Lote As String = ArrayCaducidad(0) Dim FechaCaducidad As String = ArrayCaducidad(1) - - If AplicaLote Then GvRow.FCTextBox("TxtLote").Text = Lote End If @@ -1317,7 +1324,6 @@ Partial Class Inventarios_EntregaAlmacen If AplicaCaducidad Then GvRow.FCTextBox("TxtCaducidad").Text = FechaCaducidad End If - UpDatos.Update() End Sub @@ -1347,7 +1353,6 @@ Partial Class Inventarios_EntregaAlmacen ObjInventarios.Dispose() End If - If Not String.IsNullOrEmpty(ValorAsignado) Then DdlLoteFechaCaducidad.SelectedValueExist(ValorAsignado) End If @@ -1867,6 +1872,15 @@ Partial Class Inventarios_EntregaAlmacen TdSeriePS.Visible = False Dim Existe As Boolean = False Dim PSTemp As String = "" + 'validación de impresión con CódigoQR, ej. ?CvePS=711820&Lote=220078&Fecha=04/07/2027 + If TxtCodigoPS.Text.Trim.Contains("?CvePS") Then + Dim query As String = TxtCodigoPS.Text.Trim '"?CvePS=711820&Lote=220078&Fecha=04/07/2027" + Dim parsedQuery = HttpUtility.ParseQueryString(Query) + + Dim tCvePS As String = parsedQuery("CvePS") + Dim tLote As String = parsedQuery("Lote") + Dim tFecha As String = parsedQuery("Fecha") + End If For Each Gvr As GridViewRow In GvDatos.Rows If Gvr.DataKey("CodigoBarras") = TxtCodigoPS.Text.Trim Then @@ -2053,7 +2067,7 @@ Partial Class Inventarios_EntregaAlmacen End If If CBool(Gvr.DataKey("AplicaCaducidad")) Then - If GvDatos.Columns(8).Visible Then + If SeleccionLoteCaducidadCombo Then If String.IsNullOrEmpty(Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim()) OrElse Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim() = "|" Then ValidaCaducidad = True End If @@ -2065,7 +2079,7 @@ Partial Class Inventarios_EntregaAlmacen End If If CBool(Gvr.DataKey("AplicaLote")) Then - If GvDatos.Columns(8).Visible Then + If SeleccionLoteCaducidadCombo Then If String.IsNullOrEmpty(Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim()) OrElse Gvr.FCDropDownList("DdlCaducidadProducto").SelectedValue.Trim() = "|" Then ValidaLote = True End If