UFN_REVENUE_GETPAYMENTFROMPLEDGE
Returns the REVENUEID of a pledge payment for a REVENUEID of a pledge and the REVENUEID used to make the payment
Return
Return Type |
---|
uniqueidentifier |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PLEDGEID | uniqueidentifier | IN | |
@TRANSACTIONID | uniqueidentifier | IN |
Definition
Copy
CREATE function dbo.UFN_REVENUE_GETPAYMENTFROMPLEDGE
(
@PLEDGEID uniqueidentifier,
@TRANSACTIONID uniqueidentifier
)
returns uniqueidentifier
as
begin
declare @r uniqueidentifier;
select top 1 @r = INSTALLMENTPAYMENT.PAYMENTID
from dbo.INSTALLMENTPAYMENT
inner join dbo.REVENUE on REVENUE.ID = INSTALLMENTPAYMENT.PAYMENTID
where INSTALLMENTPAYMENT.PLEDGEID = @PLEDGEID
and REVENUE.ID = @TRANSACTIONID;
return @r;
end