UFN_REVENUE_GETNEXTINSTALLMENTIGNOREPAYMENT
Returns the installment ID of the next installment that is due for a revenue detail, ignoring the given payment.
Return
Return Type |
---|
uniqueidentifier |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@REVENUEID | uniqueidentifier | IN | |
@PAYMENTID | uniqueidentifier | IN |
Definition
Copy
create function dbo.UFN_REVENUE_GETNEXTINSTALLMENTIGNOREPAYMENT
(
@REVENUEID uniqueidentifier,
@PAYMENTID uniqueidentifier
)
returns uniqueidentifier
as
begin
return
(
select top 1 ID
from dbo.INSTALLMENT
where REVENUEID = @REVENUEID
and dbo.UFN_INSTALLMENT_GETINSTALLMENTBALANCEIGNOREPAYMENT(INSTALLMENT.ID, @PAYMENTID) <> 0
order by DATE asc
);
end