USP_DATAFORMTEMPLATE_EDITLOAD_PROPERTYDETAILGLDISTRIBUTIONBYTRANSACTION
The load procedure used by the edit dataform template "Sold Property GL Distribution By Transaction 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. |
@GLDISTRIBUTION | xml | INOUT | Revenue GL distribution |
@CAPTION | nvarchar(10) | INOUT | Stock Or Property |
@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. |
@TRANSACTIONCURRENCYID | uniqueidentifier | INOUT | Transaction currency ID |
@DEFAULTGLPAYMENTMETHODREVENUETYPEMAPPINGID | uniqueidentifier | INOUT | Default mapping type |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_PROPERTYDETAILGLDISTRIBUTIONBYTRANSACTION
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@GLDISTRIBUTION xml = null output,
@CAPTION nvarchar(10) = null output,
@TSLONG bigint = 0 output,
@TRANSACTIONCURRENCYID uniqueidentifier = null output,
@DEFAULTGLPAYMENTMETHODREVENUETYPEMAPPINGID uniqueidentifier = null output
)
as
begin
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
set @GLDISTRIBUTION = (
select
ACCOUNT,
TRANSACTIONAMOUNT AMOUNT,
GLPAYMENTMETHODREVENUETYPEMAPPINGID,
ID,
PROJECT,
REFERENCE,
TRANSACTIONCURRENCYID,
TRANSACTIONTYPECODE
from dbo.UFN_REVENUE_GETPROPERTYDETAILGLDISTRIBUTION(@ID)
order by REFERENCE asc
for xml raw('ITEM'),type,elements,root('GLDISTRIBUTION'),BINARY BASE64
);
set @CAPTION = 'property';
if @GLDISTRIBUTION is not null
begin
set @DATALOADED = 1;
select
@TSLONG = max(PROPERTYDETAILGLDISTRIBUTION.TSLONG),
@TRANSACTIONCURRENCYID = PROPERTYDETAILGLDISTRIBUTION.TRANSACTIONCURRENCYID,
@DEFAULTGLPAYMENTMETHODREVENUETYPEMAPPINGID = PROPERTYDETAILGLDISTRIBUTION.GLPAYMENTMETHODREVENUETYPEMAPPINGID
from dbo.PROPERTYDETAILGLDISTRIBUTION
inner join dbo.REVENUEPAYMENTMETHOD on REVENUEPAYMENTMETHOD.ID = PROPERTYDETAILGLDISTRIBUTION.PROPERTYDETAILID
where REVENUEPAYMENTMETHOD.ID = @ID
group by PROPERTYDETAILGLDISTRIBUTION.TRANSACTIONCURRENCYID, PROPERTYDETAILGLDISTRIBUTION.GLPAYMENTMETHODREVENUETYPEMAPPINGID;
end
return 0;
end