diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index c6c92e476..fb992b66b 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -4581,6 +4581,7 @@ Partial Class Inventarios_EntradasSalidas NumRow = 0 Dim RowNoEncontrados As String = "" Dim NumAgregados As Integer = 0 + Dim PSTemp As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa) For Each Row As DataRow In dt.Rows Dim Cantidad As Decimal = Row("Cantidad").ToString.ToDecimal @@ -4596,6 +4597,7 @@ Partial Class Inventarios_EntradasSalidas Dim CvePS As Integer = 0 Dim CveUM As Integer = 0 + Dim DataTemp As DataTable NumRow = NumRow + 1 @@ -4607,36 +4609,48 @@ Partial Class Inventarios_EntradasSalidas If Codigo <> "" Then - Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c) - If StrArray.Length > 0 Then - If CBool(StrArray(0)) = True Then - CvePS = StrArray(1).ToEntero - Else - RowNoEncontrados &= StrArray(1) & "<\BR>" - End If - End If - 'ElseIf CodigoBarras <> "" Then - ' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c) - ' If StrArray.Length > 0 Then - ' If CBool(StrArray(0)) = True Then - ' CvePS = StrArray(1).ToEntero - ' Else - ' RowNoEncontrados &= StrArray(1) & "<\BR>" - ' End If - ' End If - ElseIf ProductoServicio <> "" Then - Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c) - If StrArray.Length > 0 Then - If CBool(StrArray(0)) = True Then - CvePS = StrArray(1).ToEntero - Else - RowNoEncontrados &= StrArray(1) & "<\BR>" - End If + DataTemp = PSTemp.FiltraParametros(String.Format("Codigo = '{0}'", Codigo)) + CvePS = DataTemp.FiltroPrimeroValor("CvePS", "").ToEntero + DataTemp.Dispose() + If CvePS = 0 Then + RowNoEncontrados &= Codigo & "<\BR>" End If Else RowNoEncontrados &= "<\BR>    - En la fila " & NumRow & " no se especificó código, código de barras ó descripción." End If + + 'If Codigo <> "" Then + ' Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c) + ' If StrArray.Length > 0 Then + ' If CBool(StrArray(0)) = True Then + ' CvePS = StrArray(1).ToEntero + ' Else + ' RowNoEncontrados &= StrArray(1) & "<\BR>" + ' End If + ' End If + ' 'ElseIf CodigoBarras <> "" Then + ' ' Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c) + ' ' If StrArray.Length > 0 Then + ' ' If CBool(StrArray(0)) = True Then + ' ' CvePS = StrArray(1).ToEntero + ' ' Else + ' ' RowNoEncontrados &= StrArray(1) & "<\BR>" + ' ' End If + ' ' End If + 'ElseIf ProductoServicio <> "" Then + ' Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c) + ' If StrArray.Length > 0 Then + ' If CBool(StrArray(0)) = True Then + ' CvePS = StrArray(1).ToEntero + ' Else + ' RowNoEncontrados &= StrArray(1) & "<\BR>" + ' End If + ' End If + 'Else + ' RowNoEncontrados &= "<\BR>    - En la fila " & NumRow & " no se especificó código, código de barras ó descripción." + 'End If + If CvePS > 0 Then Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) @@ -4644,7 +4658,6 @@ Partial Class Inventarios_EntradasSalidas CveUM = DrPS("CveUnidadMedida").ToString().ToEntero() UM = GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa).FiltroPrimeroValor("UnidadMedida", $"CveUnidadMedida={CveUM}") End If - AddNew(CvePS, ProductoServicio, CveUM, UM, Cantidad, PrecioUnitario, Serie.Replace(" ", String.Empty), "", "-1", "-1", "", Lote, Caducidad.ToDate, CveSeccionAlmacen, SeccionAlmacen, CargarGV:=False)