UFN_PLEDGE_GETNEXTINSTALLMENT
Returns the ID of the next installment due for the specified recurring gift.
Return
| Return Type |
|---|
| uniqueidentifier |
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @REVENUEID | uniqueidentifier | IN | |
| @ASOFDATE | date | IN |
Definition
Copy
create function dbo.UFN_PLEDGE_GETNEXTINSTALLMENT(
@REVENUEID uniqueidentifier,
@ASOFDATE date = null
)
returns uniqueidentifier
with execute as caller
as begin
return (
select top 1 ID
from dbo.INSTALLMENT
where REVENUEID= @REVENUEID
and dbo.UFN_INSTALLMENT_GETINSTALLMENTBALANCE(ID) > 0
and (@ASOFDATE is null or DATE>=@ASOFDATE)
order by DATE
)
end