From d10e9bbba3ea5ccca8e58caa8b920489bb9c4788 Mon Sep 17 00:00:00 2001 From: rmolina Date: Thu, 12 Dec 2019 20:08:24 -0700 Subject: [PATCH] virutal --- Inventarios/RecepcionEntrega.aspx.vb | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Inventarios/RecepcionEntrega.aspx.vb b/Inventarios/RecepcionEntrega.aspx.vb index 1ef659d96..4d3cf4f62 100644 --- a/Inventarios/RecepcionEntrega.aspx.vb +++ b/Inventarios/RecepcionEntrega.aspx.vb @@ -1886,14 +1886,18 @@ Partial Class Inventarios_RecepcionEntrega Dim CveConceptoMovimientoVirtual As Integer = -1 Dim CveAlmacenVirtual As Integer = -1 Dim CveMovimientoRelacionadoVirtual As Integer = -1 + Dim ValidaVirtual As Boolean = False If TipoMovimiento = 1 Then For Each GvRow As GridViewRow In GvDatos.Rows If GvRow.RowType = DataControlRowType.DataRow Then - For Each Tam As DataRow In DtTamanios.Rows - If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then - Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero() + If GvRow.datakey("CveTamaño").tostring.toentero > 0 Then + ValidaVirtual = True ' si tiene tamaño, debe de tener virtual + Dim drr As DataRow = DtTamanios.FiltroPrimero(String.Format("CveTamaño={0}", GvRow.DataKey("CveTamaño"))) + If drr IsNot Nothing Then + + Dim CvePSCargo = drr("CvePSCargo").ToString().ToEntero() Dim Row As DataRow = DtPSVirtual.NewRow() Row("CvePS") = CvePSCargo Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal() @@ -1901,9 +1905,9 @@ Partial Class Inventarios_RecepcionEntrega Row("CveUM") = GvRow.DataKey("CveUM").ToEntero() DtPSVirtual.Rows.Add(Row) - End If - Next + + End If End If Next @@ -1911,6 +1915,7 @@ Partial Class Inventarios_RecepcionEntrega CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero() ElseIf TipoMovimiento = 2 Then + ValidaVirtual = True Dim CveMovimientoSalidaDev As Integer = -1 If ObjInventario.GetInv_Mov(CveVentaSurtir, UsuarioActual.CveEmpresa) Then Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 3 AND CveVenta > 0") @@ -1955,11 +1960,14 @@ Partial Class Inventarios_RecepcionEntrega End If Else - ErrorMovInv = True - TextoError = "Ocurrió un error al procesar el movimiento en almacen virtual. Por favor vuelva a intentar." + If ValidaVirtual Then + ErrorMovInv = True + TextoError = "Ocurrió un error al procesar el movimiento en almacen virtual. Por favor vuelva a intentar." + + End If End If - If DtPSVirtual.Rows.Count = 0 Then + If DtPSVirtual.Rows.Count = 0 AndAlso ValidaVirtual = True Then ErrorMovInv = True TextoError = "No se tienen productos para el almacen virtual." End If