USP_DATAFORMTEMPLATE_EDITLOAD_BANKACCOUNTADJUSTMENTCATEGORY
The load procedure used by the edit dataform template "Bank Account Adjustment Category Edit Data 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. |
@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. |
@CATEGORY | nvarchar(60) | INOUT | Category |
@ADJUSTMENTFUZZYDATEID | uniqueidentifier | INOUT | Adjustment date |
@AMOUNT | decimal(19, 4) | INOUT | Amount |
@ADJUSTMENTTYPECODE | smallint | INOUT | Type |
@DEFAULTREFERENCE | nvarchar(100) | INOUT | Reference |
@POSTSTATUSCODE | smallint | INOUT | Post status |
@POSTDATECODE | smallint | INOUT | Post date |
@TRANSFERBANKACCOUNTID | uniqueidentifier | INOUT | Transfer account |
@BANKACCOUNTID | uniqueidentifier | INOUT | |
@PDACCOUNTSYSTEMID | uniqueidentifier | INOUT | Account System |
@TRANSACTIONCURRENCYID | uniqueidentifier | INOUT | Transaction currency |
@ALLOWGLDISTRIBUTIONS | bit | INOUT | Allow GL distributions |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_BANKACCOUNTADJUSTMENTCATEGORY(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@CATEGORY nvarchar(60) = null output,
@ADJUSTMENTFUZZYDATEID uniqueidentifier = null output,
@AMOUNT decimal(19,4) = null output,
@ADJUSTMENTTYPECODE smallint = null output,
@DEFAULTREFERENCE nvarchar(100) = null output,
@POSTSTATUSCODE smallint = null output,
@POSTDATECODE smallint = null output,
--@NOTES nvarchar(4000) = null output,
--@EFTSTATUSCODE smallint = null output,
--@BANKACCOUNTNAME nvarchar(100) = null output,
--@IMPORTID nvarchar(100) = null output,
@TRANSFERBANKACCOUNTID uniqueidentifier = null output,
@BANKACCOUNTID uniqueidentifier = null output,
@PDACCOUNTSYSTEMID uniqueidentifier = null output,
@TRANSACTIONCURRENCYID uniqueidentifier = null output,
@ALLOWGLDISTRIBUTIONS bit = null output
)
as
set nocount on;
-- be sure to set these, in case the select returns no rows
set @DATALOADED = 0
set @TSLONG = 0
-- 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. Also note that we fetch the TSLONG so that concurrency
-- can be considered.
select
@DATALOADED = 1,
@TSLONG = BAAC.TSLONG,
@CATEGORY = CATEGORY,
@ADJUSTMENTFUZZYDATEID = ADJUSTMENTFUZZYDATEID,
@AMOUNT = AMOUNT,
@ADJUSTMENTTYPECODE = ADJUSTMENTTYPECODE,
@DEFAULTREFERENCE = DEFAULTREFERENCE,
@POSTSTATUSCODE = POSTSTATUSCODE,
@POSTDATECODE = POSTDATECODE,
--@NOTES = NOTES,
--@EFTSTATUSCODE = EFTSTATUSCODE,
--@BANKACCOUNTNAME = (SELECT ACCOUNTNAME FROM DBO.BANKACCOUNT WHERE ID = @BANKACCOUNTID) BANKACCOUNTNAME,
--@IMPORTID = IMPORTID,
@TRANSFERBANKACCOUNTID = TRANSFERBANKACCOUNTID,
@BANKACCOUNTID = BANKACCOUNTID,
@TRANSACTIONCURRENCYID = TRANSACTIONCURRENCYID,
@PDACCOUNTSYSTEMID=BA.PDACCOUNTSYSTEMID
from dbo.BANKACCOUNTADJUSTMENTCATEGORY as BAAC
inner join dbo.BANKACCOUNT as BA on BAAC.BANKACCOUNTID = BA.ID
where BAAC.ID = @ID;
set @ALLOWGLDISTRIBUTIONS = dbo.UFN_PDACCOUNTSYSTEM_ALLOWGLDISTRIBUTIONS(@PDACCOUNTSYSTEMID);
return 0;