USP_DATAFORMTEMPLATE_VIEW_RESERVATIONRATESCALEAPPLICATIONSTOTAL
The load procedure used by the view dataform template "Reservation Rate Scale Applications Total 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. |
@FLATRATEAMOUNT | money | INOUT | Flat rate |
@APPLIEDAMOUNT | money | INOUT | Currently applied |
@ISAPPLIED | bit | INOUT | ISAPPLIED |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_RESERVATIONRATESCALEAPPLICATIONSTOTAL
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@FLATRATEAMOUNT money = null output,
@APPLIEDAMOUNT money = null output,
@ISAPPLIED bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
select
@DATALOADED = 1,
@FLATRATEAMOUNT = AMOUNT
from dbo.RESERVATIONRATESCALEPRICE
where
RESERVATIONRATESCALEID = @ID and
INUSE = 1
if @DATALOADED = 1
begin
select
@APPLIEDAMOUNT = sum(TOTAL)
from dbo.SALESORDERITEM
where
SALESORDERID = @ID and
PRICINGSTRUCTURECODE = 1
set @ISAPPLIED = dbo.UFN_RESERVATIONRATESCALE_ISAPPLIED(@ID)
end
return 0;