USP_DATAFORMTEMPLATE_ADD_GENERATEEFTFILEPROCESS_3
The save procedure used by the add dataform template "Generate Direct Debit File Process Add Form 3".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@NAME | nvarchar(100) | IN | Name |
@DESCRIPTION | nvarchar(255) | IN | Description |
@DATETYPECODE | tinyint | IN | Financial processing date |
@DATE | datetime | IN | Specific date |
@SPONSORINGINSTITUTIONID | uniqueidentifier | IN | Sponsoring institution |
@IMMEDIATEDESTINATIONNAME | nvarchar(23) | IN | Immediate destination |
@CREATECREDITOFFSETTRANSACTION | bit | IN | Create credit offset transaction |
@BATCHID | uniqueidentifier | IN | Batch number |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@IDSETREGISTERID | uniqueidentifier | IN | Selection |
@CUTOFFDATE | datetime | IN | Specific date |
@BATCHTEMPLATEID | uniqueidentifier | IN | Payment batch template |
@TRANSACTIONTYPECODE | tinyint | IN | Transaction types |
@OWNERID | uniqueidentifier | IN | Payment batch owner |
@DUEDATETYPECODE | tinyint | IN | Payments due on or before |
@DAYSAFTER | int | IN | Days after |
@FINDAYSAFTER | int | IN | Days after |
@BANKACCOUNTID | uniqueidentifier | IN | Bank account |
@CONSOLIDATEPAYMENTS | bit | IN | Consolidate multiple commitments to a single payment by constituent |
@SITEID | uniqueidentifier | IN | Site |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_GENERATEEFTFILEPROCESS_3
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@NAME nvarchar(100),
@DESCRIPTION nvarchar(255)='',
@DATETYPECODE tinyint = 0,
@DATE datetime = null,
@SPONSORINGINSTITUTIONID uniqueidentifier = '',
@IMMEDIATEDESTINATIONNAME nvarchar(23) = '',
@CREATECREDITOFFSETTRANSACTION bit = 0,
@BATCHID uniqueidentifier = null,
@CURRENTAPPUSERID uniqueidentifier,
@IDSETREGISTERID uniqueidentifier = null,
@CUTOFFDATE datetime = null,
@BATCHTEMPLATEID uniqueidentifier = null,
@TRANSACTIONTYPECODE tinyint = 0,
@OWNERID uniqueidentifier = null,
@DUEDATETYPECODE tinyint = 0,
@DAYSAFTER integer = 1,
@FINDAYSAFTER integer = 1,
@BANKACCOUNTID uniqueidentifier = null,
@CONSOLIDATEPAYMENTS bit = null,
@SITEID uniqueidentifier = null
)
as
set nocount on;
declare @CURRENTDATE datetime;
if @ID is null
set @ID = NewID();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
set @CURRENTDATE = GetDate();
begin try
if (@SITEID is not null)
begin
if dbo.UFN_SITEALLOWEDFORUSER(@CURRENTAPPUSERID, @SITEID) = 0
begin
raiserror ('ERR_SITE_NOACCESS',13,1);
return 1;
end
end
insert into dbo.GENERATEEFTFILEPROCESS
(ID,NAME,DESCRIPTION,DATETYPECODE,DATE,SPONSORINGINSTITUTIONID,BANKACCOUNTID,IMMEDIATEDESTINATIONNAME,CREATECREDITOFFSETTRANSACTION,BATCHID,ADDEDBYID,CHANGEDBYID,DATEADDED,DATECHANGED, IDSETREGISTERID,CUTOFFDATE,BATCHTEMPLATEID,TRANSACTIONTYPECODE,OWNERID,DUEDATETYPECODE,DAYSAFTER,FINDAYSAFTER,CONSOLIDATEPAYMENTS)
values
(@ID,@NAME,@DESCRIPTION,@DATETYPECODE,@DATE,@SPONSORINGINSTITUTIONID,@BANKACCOUNTID,@IMMEDIATEDESTINATIONNAME,@CREATECREDITOFFSETTRANSACTION,@BATCHID,@CHANGEAGENTID,@CHANGEAGENTID,@CURRENTDATE,@CURRENTDATE,@IDSETREGISTERID,@CUTOFFDATE,@BATCHTEMPLATEID,@TRANSACTIONTYPECODE,@OWNERID,@DUEDATETYPECODE,@DAYSAFTER,@FINDAYSAFTER,@CONSOLIDATEPAYMENTS);
exec dbo.USP_BUSINESSPROCESSINSTANCE_ADD @CHANGEAGENTID =
@CHANGEAGENTID,
@BUSINESSPROCESSCATALOGID = 'B7974F4F-60D8-4DF5-AD5B-7B1839ABE16A',
@BUSINESSPROCESSPARAMETERSETID = @ID,
@OWNERID = @CURRENTAPPUSERID,
@SITEID = @SITEID;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;