From 1e90bf2c9fab22de9ae67e4f81fb726208d5fdfd Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 11 Mar 2021 12:21:11 -0700 Subject: [PATCH] aplica lote/caducidad ajuste en pantalla --- Inventarios/AjustesSeccionAlmacen.aspx.vb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Inventarios/AjustesSeccionAlmacen.aspx.vb b/Inventarios/AjustesSeccionAlmacen.aspx.vb index 3293c0fa6..1f26f44b1 100644 --- a/Inventarios/AjustesSeccionAlmacen.aspx.vb +++ b/Inventarios/AjustesSeccionAlmacen.aspx.vb @@ -125,11 +125,22 @@ Partial Class Inventarios_AjustesSeccionAlmacen If gvr.FCCheckBox("ChkEditCaducidad").Checked And FechaCaducidadNueva.Length > 0 And FechaCaducidadNueva <> FechaCaducidadOriginal Then If Not ListaCaducidad.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaCaducidad.Add(gvr.DataKey("CvePS").ToEntero, FechaCaducidadNueva) 'guardo que dato le corresponde Modificar = True + If FechaCaducidadOriginal = "" Then + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False, False) + Else + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True, True) + End If End If If gvr.FCCheckBox("ChkLote").Checked And LoteNuevo.Length > 0 And LoteNuevo <> LoteOriginal Then If Not ListaLote.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaLote.Add(gvr.DataKey("CvePS").ToEntero, LoteNuevo) 'guardo que dato le corresponde Modificar = True + If LoteOriginal = "" Then + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False, False) + Else + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True, True) + End If + End If If Modificar Then @@ -187,6 +198,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen End If + If Lote = "" Then + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, False, False) + Else + ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True, True) + End If + If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then ErrorMovInv = True Exit For @@ -420,7 +437,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen Dim Lote As String = RowExcel("Lote").ToString() Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate - Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'") + Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'", Orderby:="Serie,Lote,FechaCaducidad") If RowExistencia IsNot Nothing Then Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()