Desvinculacion de OC al cancelar la compra
This commit is contained in:
@@ -2117,6 +2117,26 @@ Public Class ClsCompras
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function CancelarCompraOC(CveCompra As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Comp_CancelarCompraOC")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al desvincular la oc de la compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -13899,6 +13899,12 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjCompras.CancelarCompraOC(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'CANCELA COMPRA
|
||||
If Not ErrorCancelar Then
|
||||
|
||||
Reference in New Issue
Block a user