UFN_GIFTAIDREVENUESPLIT_ISRECURRINGGIFTSPLIT
Determines if this Gift Aid split is for a recurring gift.
Return
Return Type |
---|
bit |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_GIFTAIDREVENUESPLIT_ISRECURRINGGIFTSPLIT
(
@ID uniqueidentifier
)
returns bit
with execute as caller
as
begin
declare @TRANSACTIONTYPECODE tinyint;
select @TRANSACTIONTYPECODE = REVENUE.TYPECODE
from dbo.FINANCIALTRANSACTION REVENUE
inner join dbo.FINANCIALTRANSACTIONLINEITEM RS on REVENUE.ID = RS.FINANCIALTRANSACTIONID
inner join dbo.REVENUESPLITGIFTAID RSGA on RSGA.ID = RS.ID
where RSGA.ID = @ID
and REVENUE.TYPECODE in (0,1,2,3,4,5,6,7,8,9,15) and RS.DELETEDON is null and RS.TYPECODE != 1;
if @TRANSACTIONTYPECODE = 2
return 1;
return 0;
end