USP_DATAFORMTEMPLATE_ADD_SPONSORSHIPRECURRINGADDITIONALGIFT_PRELOAD

The load procedure used by the edit dataform template "Sponsorship Recurring Additional Gift Add Data Form"

Parameters

Parameter Parameter Type Mode Description
@SPONSORSHIPID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@CONSTITUENTID uniqueidentifier INOUT Constituent
@HOUSEHOLDSCANBEDONORS bit INOUT Households can be donors
@BASECURRENCYID uniqueidentifier INOUT Base currency ID
@BASECURRENCYDECIMALDIGITS tinyint INOUT Base currency decimal digits
@BASECURRENCYROUNDINGTYPECODE tinyint INOUT Base currency rounding type code
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@SPLITS xml INOUT Designations
@SINGLEDESIGNATIONID uniqueidentifier INOUT Designation

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_SPONSORSHIPRECURRINGADDITIONALGIFT_PRELOAD
(
    @SPONSORSHIPID uniqueidentifier,
    @CONSTITUENTID uniqueidentifier = null output,
    @HOUSEHOLDSCANBEDONORS bit = null output,
    @BASECURRENCYID uniqueidentifier = null output,
    @BASECURRENCYDECIMALDIGITS tinyint = null output,
    @BASECURRENCYROUNDINGTYPECODE tinyint = null output,
    @CURRENTAPPUSERID uniqueidentifier = null,
    @SPLITS xml = null output,
    @SINGLEDESIGNATIONID uniqueidentifier = null output
)
as
/*
declare @TEMP nvarchar(2000)
set @TEMP = convert(nvarchar(2000),@CURRENTAPPUSERID)
raiserror(@TEMP,13,1)
*/
    set nocount on;
    declare @DESIGNATIONID uniqueidentifier;

    set @HOUSEHOLDSCANBEDONORS = dbo.UFN_INSTALLATIONINFO_GETHOUSEHOLDSCANBEDONORS();
    set @BASECURRENCYID = dbo.UFN_APPUSER_GETBASECURRENCY(@CURRENTAPPUSERID);

    select     
        @BASECURRENCYDECIMALDIGITS = DECIMALDIGITS,
        @BASECURRENCYROUNDINGTYPECODE = ROUNDINGTYPECODE
    from 
        dbo.CURRENCY
    where 
        ID = @BASECURRENCYID;

    select 
    @CONSTITUENTID = REVENUE.CONSTITUENTID,
    @DESIGNATIONID = REVENUESPLIT.DESIGNATIONID
    from dbo.SPONSORSHIP
    left outer join dbo.REVENUESPLIT on REVENUESPLIT.ID = SPONSORSHIP.REVENUESPLITID
    left outer join dbo.REVENUE on REVENUESPLIT.REVENUEID = REVENUE.ID
    where SPONSORSHIP.ID = @SPONSORSHIPID;

    set @SPLITS = (
            select @DESIGNATIONID DESIGNATIONID,
                   0 AMOUNT
            for xml raw('ITEM'),type,elements,root('SPLITS'),BINARY BASE64
            )

    return 0;