Validar al obtener registros

This commit is contained in:
2020-03-21 12:24:58 -07:00
parent 800b126d43
commit 4a698e279e

View File

@@ -1921,6 +1921,9 @@ Partial Class Inventarios_RecepcionEntrega
Exit For Exit For
End If End If
Next Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al obtener los registros"
End If End If
If ErrorMovInv Then Exit For If ErrorMovInv Then Exit For
Next Next
@@ -2001,7 +2004,7 @@ Partial Class Inventarios_RecepcionEntrega
TextoError = "No se pudo generar el movimiento de entrada correctamente" TextoError = "No se pudo generar el movimiento de entrada correctamente"
ErrorMovInv = True ErrorMovInv = True
Else Else
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, EsInterno:=EsInterno, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero()) Then
ErrorMovInv = True ErrorMovInv = True
@@ -2009,6 +2012,9 @@ Partial Class Inventarios_RecepcionEntrega
Exit For Exit For
End If End If
Next Next
Else
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
End If End If
End If End If