USP_BANKACCOUNT_CLOSE
Executes the "Close Bank Account" record operation.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | Input parameter indicating the ID of the record being updated. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the update. |
Definition
Copy
CREATE procedure dbo.USP_BANKACCOUNT_CLOSE
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier
)
as begin
set nocount on;
declare @CURRENTDATE datetime;
if @CHANGEAGENTID is null exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
set @CURRENTDATE = getdate();
--UPDATE dbo.BANKACCOUNT SET STATUSCODE=0, GLACCOUNTID = null, PDACCOUNTSEGMENTVALUEID = null, CHANGEDBYID=@CHANGEAGENTID, DATECHANGED=@CURRENTDATE WHERE ID=@ID AND STATUSCODE<>0
UPDATE dbo.BANKACCOUNT SET STATUSCODE=0, CHANGEDBYID=@CHANGEAGENTID, DATECHANGED=@CURRENTDATE WHERE ID=@ID AND STATUSCODE<>0
return 0;
end