USP_DATAFORMTEMPLATE_EDITLOAD_BANKACCOUNT
The load procedure used by the edit dataform template "Bank Account 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. |
@ACCOUNTNAME | nvarchar(100) | INOUT | Account name |
@ACCOUNTNUMBER | nvarchar(50) | INOUT | Account number |
@ROUTINGNUMBER | nvarchar(9) | INOUT | Routing number |
@ACCOUNTTYPECODE | tinyint | INOUT | Account type |
@MINIMUMBALANCE | decimal(19, 4) | INOUT | Minimum balance |
@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. |
@BANKDEFAULTROUTINGNUMBER | nvarchar(9) | INOUT | Default routing number |
@BANKID | uniqueidentifier | INOUT | Bank ID |
@DEFAULTCASHACCOUNTTYPECODE | tinyint | INOUT | Default cash account type |
@GLACCOUNTID | uniqueidentifier | INOUT | Account |
@PDACCOUNTSEGMENTVALUEID | uniqueidentifier | INOUT | Account code |
@USERNUMBER | nvarchar(24) | INOUT | User number |
@CLIENTNAME | nvarchar(100) | INOUT | Client name |
@SORTCODE | nvarchar(6) | INOUT | Sort code |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@PDACCOUNTSYSTEMID | uniqueidentifier | INOUT | Account system |
@UKINSTALLED | bit | INOUT | UK Installed |
@SHOWACCOUNTSYSTEM | bit | INOUT | Show Account System |
@TRANSACTIONCURRENCYID | uniqueidentifier | INOUT | Currency |
@HASTRANSACTIONS | bit | INOUT | Has transactions |
@ALLOWGLDISTRIBUTIONS | bit | INOUT | Allow GL distributions |
@BANKINGSYSTEMID | uniqueidentifier | INOUT | |
@BIC | nvarchar(11) | INOUT | |
@BANKCODE | nvarchar(25) | INOUT | |
@BANKACCOUNTINUSE | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_BANKACCOUNT(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@ACCOUNTNAME nvarchar(100) = null output,
@ACCOUNTNUMBER nvarchar(50) = null output,
@ROUTINGNUMBER nvarchar(9) = null output,
@ACCOUNTTYPECODE tinyint = null output,
@MINIMUMBALANCE decimal(19, 4) = null output,
@TSLONG bigint = 0 output,
@BANKDEFAULTROUTINGNUMBER nvarchar(9) = null output,
@BANKID uniqueidentifier = null output,
@DEFAULTCASHACCOUNTTYPECODE tinyint = null output,
@GLACCOUNTID uniqueidentifier = null output,
@PDACCOUNTSEGMENTVALUEID uniqueidentifier = null output,
@USERNUMBER nvarchar(24) = null output,
@CLIENTNAME nvarchar(100) = null output,
@SORTCODE nvarchar(6) = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@PDACCOUNTSYSTEMID uniqueidentifier = null output,
@UKINSTALLED bit = null output,
@SHOWACCOUNTSYSTEM bit = null output,
@TRANSACTIONCURRENCYID uniqueidentifier = null output,
@HASTRANSACTIONS bit = null output,
@ALLOWGLDISTRIBUTIONS bit = null output,
@BANKINGSYSTEMID uniqueidentifier = null output,
@BIC nvarchar(11) = null output,
@BANKCODE nvarchar(25) = null output,
@BANKACCOUNTINUSE bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
exec dbo.USP_GET_KEY_ACCESS;
select
@DATALOADED = 1,
@TSLONG = BANKACCOUNT.TSLONG,
@ACCOUNTNAME = BANKACCOUNT.ACCOUNTNAME,
@ACCOUNTNUMBER = convert(nvarchar(50), DecryptByKey(BANKACCOUNT.ACCOUNTNUMBER)),
@ROUTINGNUMBER = BANKACCOUNT.ROUTINGNUMBER,
@ACCOUNTTYPECODE = BANKACCOUNT.ACCOUNTTYPECODE,
@MINIMUMBALANCE = BANKACCOUNT.MINIMUMBALANCE,
@BANKDEFAULTROUTINGNUMBER = dbo.UFN_BANKACCOUNT_GETROUTINGNUMBER(BANKACCOUNT.BANKID),
@BANKID = BANKACCOUNT.BANKID,
@DEFAULTCASHACCOUNTTYPECODE = BANKACCOUNT.DEFAULTCASHACCOUNTTYPECODE,
@GLACCOUNTID = BANKACCOUNT.GLACCOUNTID,
@PDACCOUNTSEGMENTVALUEID = BANKACCOUNT.PDACCOUNTSEGMENTVALUEID,
@USERNUMBER = BANKACCOUNT.USERNUMBER,
@CLIENTNAME = BANKACCOUNT.CLIENTNAME,
@SORTCODE = BANKACCOUNT.SORTCODE,
@PDACCOUNTSYSTEMID = BANKACCOUNT.PDACCOUNTSYSTEMID,
@TRANSACTIONCURRENCYID = BANKACCOUNT.TRANSACTIONCURRENCYID,
@BANKINGSYSTEMID = BANKACCOUNT.BANKINGSYSTEMID,
@BIC = BANKACCOUNT.BIC,
@BANKCODE = BANKACCOUNT.BANKCODE
from
dbo.BANKACCOUNT
where
ID = @ID;
if dbo.UFN_INSTALLEDPRODUCTS_PRODUCTIS('9568A6C2-F7AA-45FD-8F54-21FE9654EE2D') = 1
set @UKINSTALLED = 1;
if dbo.UFN_PDACCOUNTSYSTEM_GETNUMBEROFSYSTEMSFORUSER(@CURRENTAPPUSERID) > 1
set @SHOWACCOUNTSYSTEM = 1;
else
set @SHOWACCOUNTSYSTEM = 0;
if exists(select top 1 ID from dbo.BANKACCOUNTTRANSACTION where BANKACCOUNTID = @ID)
set @HASTRANSACTIONS = 1;
else
set @HASTRANSACTIONS = 0;
set @ALLOWGLDISTRIBUTIONS = dbo.UFN_PDACCOUNTSYSTEM_ALLOWGLDISTRIBUTIONS(@PDACCOUNTSYSTEMID);
if @BANKINGSYSTEMID is null
exec dbo.USP_BANKINGSYSTEM_GETDEFAULT @DEFAULTBANKINGSYSTEMID = @BANKINGSYSTEMID output;
if exists(select 1 from dbo.BANKACCOUNTTRANSACTION where BANKACCOUNTTRANSACTION.BANKACCOUNTID = @ID)
set @BANKACCOUNTINUSE = 1;
exec USP_CLOSE_KEY_ACCESS;
return 0;