USP_DATAFORMTEMPLATE_ADD_PDACCOUNTCODEMAPFIXEDASSETS2
The save procedure used by the add dataform template "Map Fixed Assets Add Form 2".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@SYSTEMID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@PAYMENTMETHODS | xml | IN | Payment types |
@DEBITGLACCOUNTID | uniqueidentifier | IN | Account |
@DEBITPDACCOUNTSEGMENTVALUEID | uniqueidentifier | IN | Account code |
@CREDITGLACCOUNTID | uniqueidentifier | IN | Account |
@CREDITPDACCOUNTSEGMENTVALUEID | uniqueidentifier | IN | Account code |
@PDACCOUNTSYSTEMID | uniqueidentifier | IN | Account System |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_PDACCOUNTCODEMAPFIXEDASSETS2
(
@SYSTEMID uniqueidentifier,
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@PAYMENTMETHODS xml = null,
@DEBITGLACCOUNTID uniqueidentifier = null,
@DEBITPDACCOUNTSEGMENTVALUEID uniqueidentifier = null,
@CREDITGLACCOUNTID uniqueidentifier = null,
@CREDITPDACCOUNTSEGMENTVALUEID uniqueidentifier = null,
@PDACCOUNTSYSTEMID uniqueidentifier = null
)
as
set nocount on;
if @ID is null
set @ID = newid()
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
set @PDACCOUNTSYSTEMID = @SYSTEMID
declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
declare @PDACCOUNTCODEMAPOFFICEID uniqueidentifier
set @PDACCOUNTCODEMAPOFFICEID = '7FDFF48B-4A32-439F-805A-8981AF064A6E'
declare @OFFICEID int
set @OFFICEID = 9
begin try
-- for OFFICEID = 9
insert into dbo.PDACCOUNTCODEMAPPING
(ID, PDACCOUNTSYSTEMID, PAYMENTMETHOD, PDACCOUNTCODEMAPOFFICEID, OFFICEID, DEBITGLACCOUNTID, DEBITPDACCOUNTSEGMENTVALUEID, CREDITGLACCOUNTID, CREDITPDACCOUNTSEGMENTVALUEID, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED)
values
(@ID, @PDACCOUNTSYSTEMID, (select sum(NAMEID) from dbo.UFN_PDACCOUNTCODEMAPPING_PAYMENTMETHODS_FROMITEMLISTXML(@PAYMENTMETHODS)), @PDACCOUNTCODEMAPOFFICEID, @OFFICEID, @DEBITGLACCOUNTID, @DEBITPDACCOUNTSEGMENTVALUEID, @CREDITGLACCOUNTID, @CREDITPDACCOUNTSEGMENTVALUEID, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE)
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;