USP_DATAFORMTEMPLATE_VIEW_PLEDGEPAYMENTDUE
The load procedure used by the view dataform template "Pledge Payment Due View Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@BALANCE | money | INOUT | Amount due |
@AMOUNTDUE | money | INOUT | Amount due |
@DATEDUE | datetime | INOUT | Date due |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_PLEDGEPAYMENTDUE
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@BALANCE money = null output,
@AMOUNTDUE money = null output,
@DATEDUE datetime = null output
)
as
set nocount on;
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 0;
declare @CURRENTDATE datetime = getdate();
-- populate the output parameters, which correspond to fields on the form. Note that
-- we set @DATALOADED = 1 to indicate that the load was successful. Otherwise, the system
-- will display a "no data loaded" message.
select @DATALOADED = 1,
@BALANCE = V_QUERY_REVENUE_PLEDGEBALANCE.BALANCE,
@AMOUNTDUE = dbo.UFN_INSTALLMENT_GETINSTALLMENTBALANCE(dbo.UFN_REVENUE_GETNEXTINSTALLMENT(REVENUE.ID)),
@DATEDUE = INSTALLMENT.DATE
from dbo.REVENUE
inner join dbo.INSTALLMENT on INSTALLMENT.ID = dbo.UFN_REVENUE_GETNEXTINSTALLMENT(REVENUE.ID)
left join dbo.V_QUERY_REVENUE_PLEDGEBALANCE on V_QUERY_REVENUE_PLEDGEBALANCE.ID = REVENUE.ID
where REVENUE.ID = @ID
return 0;