USP_DATAFORMTEMPLATE_EDIT_CONTROLACCOUNTDISCOUNT
The save procedure used by the edit dataform template "Subsidiary Ledger Discount Account Edit Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@SUBSIDIARYID | uniqueidentifier | IN | |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@DATAELEMENTS | xml | IN | Data elements |
@ALLOWEDIT | bit | IN | Allow accounts to be edited on transactions. |
@ALLOWOTHERSUBSIDIARY | bit | IN | Allow accounts to be used as the control accounts on other subsidiary ledgers. |
@ALLOWJOURNALENTRY | bit | IN | Allow accounts to be used in Journal Entry. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_CONTROLACCOUNTDISCOUNT (
@ID uniqueidentifier,
@SUBSIDIARYID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@DATAELEMENTS xml,
@ALLOWEDIT bit,
@ALLOWOTHERSUBSIDIARY bit,
@ALLOWJOURNALENTRY bit
)
as
set nocount on;
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
begin try
exec dbo.USP_CONTROLACCOUNT_VALIDATE @ID, @DATAELEMENTS, @ALLOWJOURNALENTRY, 2, null
exec dbo.USP_CONTROLACCOUNT_SAVE @SUBSIDIARYID, @ID, @CHANGEAGENTID, @CURRENTDATE, @DATAELEMENTS, @ALLOWEDIT, @ALLOWOTHERSUBSIDIARY, @ALLOWJOURNALENTRY, 2
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;