aplica lote/caducidad ajuste en pantalla

This commit is contained in:
2021-03-11 12:21:11 -07:00
parent dac2a8e9aa
commit 1e90bf2c9f

View File

@@ -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()