USP_DATAFORMTEMPLATE_EDITLOAD_REVENUE_SPLIT
The load procedure used by the edit dataform template "Revenue Split Edit 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. |
@REVENUEAMOUNT | money | INOUT | Total amount |
@SPLITS | xml | INOUT | |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@APPEALID | uniqueidentifier | INOUT | Appeal |
@CONSTITUENTISINDIVIDUAL | bit | INOUT | Constituent is individual |
@TRANSACTIONCURRENCYID | uniqueidentifier | INOUT | Transaction currency ID |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_REVENUE_SPLIT
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@REVENUEAMOUNT money = null output,
@SPLITS xml = null output,
@TSLONG bigint = 0 output,
@APPEALID uniqueidentifier = null output,
@CONSTITUENTISINDIVIDUAL bit = null output,
@TRANSACTIONCURRENCYID uniqueidentifier = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
exec dbo.USP_REVENUE_SPLIT_EDIT_LOAD_2 @ID, @DATALOADED output, @REVENUEAMOUNT output, @SPLITS output, @TSLONG output, @APPEALID output, @TRANSACTIONCURRENCYID output;
declare @ISORGANIZATION bit;
declare @ISGROUP bit;
declare @ISHOUSEHOLD bit;
select
@ISORGANIZATION = CONSTITUENT.ISORGANIZATION,
@ISGROUP = CONSTITUENT.ISGROUP,
@ISHOUSEHOLD = case when GROUPDATA.GROUPTYPECODE = 0 and CONSTITUENT.ISGROUP = 1 then 1 else 0 end
from
dbo.CONSTITUENT
left outer join dbo.REVENUE on CONSTITUENT.ID = REVENUE.CONSTITUENTID
left outer join dbo.GROUPDATA on CONSTITUENT.ID = GROUPDATA.ID
where REVENUE.ID = @ID;
if @ISORGANIZATION = 1 or @ISGROUP = 1 or @ISHOUSEHOLD = 1
set @CONSTITUENTISINDIVIDUAL = 0
else
set @CONSTITUENTISINDIVIDUAL = 1
return 0;