USP_DATAFORMTEMPLATE_ADD_PDACCOUNTCODEMAPDEVELOPMENTPLANNEDGIFTS

The save procedure used by the add dataform template "Map Development Planned Gifts Add Form".

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.
@REVENUETYPES xml IN Transaction types
@PAYMENTMETHODS xml IN Planned gift vehicles
@DEBITGLACCOUNTID uniqueidentifier IN Account
@DEBITPDACCOUNTSEGMENTVALUEID uniqueidentifier IN Account code
@CREDITGLACCOUNTID uniqueidentifier IN Account
@CREDITPDACCOUNTSEGMENTVALUEID uniqueidentifier IN Account code

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_PDACCOUNTCODEMAPDEVELOPMENTPLANNEDGIFTS
(
    @ID uniqueidentifier = null output,
    @CHANGEAGENTID uniqueidentifier = null,
    @REVENUETYPES xml = null,
    @PAYMENTMETHODS xml = null,
    @DEBITGLACCOUNTID uniqueidentifier = null,
    @DEBITPDACCOUNTSEGMENTVALUEID uniqueidentifier = null,
    @CREDITGLACCOUNTID uniqueidentifier = null,
    @CREDITPDACCOUNTSEGMENTVALUEID uniqueidentifier = null
)
as

set nocount on;

if @ID is null
    set @ID = newid()

if @CHANGEAGENTID is null  
    exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
declare @PDACCOUNTCODEMAPOFFICEID uniqueidentifier
set @PDACCOUNTCODEMAPOFFICEID = '40797EBA-446F-4C83-9907-D65FC38410E0'
declare @OFFICEID int
set @OFFICEID = 6

begin try
    insert into dbo.PDACCOUNTCODEMAPPING
        (ID, PDACCOUNTSYSTEMID, REVENUETYPE,  PAYMENTMETHOD,PDACCOUNTCODEMAPOFFICEID, OFFICEID, DEBITGLACCOUNTID, DEBITPDACCOUNTSEGMENTVALUEID, CREDITGLACCOUNTID, CREDITPDACCOUNTSEGMENTVALUEID,ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED)
    values
        (@ID, '4B121C2C-CCE6-440D-894C-EA0DEF80D50B', (select sum(NAMEID) from dbo.UFN_PDACCOUNTCODEMAPPING_REVENUETYPES_FROMITEMLISTXML(@REVENUETYPES)), (select sum(NAMEID) from dbo.UFN_PDACCOUNTCODEMAPPING_PAYMENTMETHODS_FROMITEMLISTXML(@PAYMENTMETHODS)), @PDACCOUNTCODEMAPOFFICEID, @OFFICEID, @DEBITGLACCOUNTID, @DEBITPDACCOUNTSEGMENTVALUEID, @CREDITGLACCOUNTID, @CREDITPDACCOUNTSEGMENTVALUEID, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE)
end try

begin catch
    exec dbo.USP_RAISE_ERROR
    return 1
end catch

return 0