diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index 35d8638ea..85ebc6d5d 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -1735,13 +1735,14 @@ Public Class ClsCompras Return OnError End Function - Public Function UpdateEstatus(pFueValidado As Integer, pCveFactura As Integer) As Boolean + Public Function UpdateEstatus(pFueValidado As Integer, pCveFactura As Integer, CveEmpresa As Integer) As Boolean Dim OnError As Boolean = False - DataAdapter("UPDATE Comp_Facturas SET FueValidado = @pFueValidado WHERE CveFactura = @pCveFactura ", CommandType.Text) + DataAdapter("UPDATE Comp_Facturas SET FueValidado = @pFueValidado WHERE CveFactura = @pCveFactura AND CveEmpresa = @CveEmpresa ", CommandType.Text) With SqlAdapter.SelectCommand.Parameters .Add("@pFueValidado", SqlDbType.SmallInt).Value = pFueValidado .Add("@pCveFactura", SqlDbType.Int).Value = pCveFactura + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa End With Try @@ -1754,12 +1755,14 @@ Public Class ClsCompras Return OnError End Function - Public Function DeleteFactura(pCveFactura As Integer) As Boolean + Public Function DeleteFactura(pCveFactura As Integer, CveEmpresa As Integer) As Boolean Dim OnError As Boolean = False - DataAdapter(" DELETE Comp_Facturas WHERE CveFactura = @pCveFactura AND CveCompra IS NULL ", CommandType.Text) - - SqlAdapter.SelectCommand.Parameters.Add("@pCveFactura", SqlDbType.Int).Value = pCveFactura + DataAdapter(" DELETE Comp_Facturas WHERE CveFactura = @pCveFactura AND CveEmpresa = @CveEmpresa AND CveCompra IS NULL ", CommandType.Text) + With SqlAdapter.SelectCommand.Parameters + .Add("@pCveFactura", SqlDbType.Int).Value = pCveFactura + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With Try SqlAdapter.Fill(Data)