start_agent_info
AgentName = "AU_ACCCONF_COORDINATOR"
AgentDescr = "Accounting Configuration Coordinator"
PR_FNAME = "AU_ORGAN_UNIT_E.FM"
PR_TNAME = "AU_ORGAN_UNIT"
AgentLanguage = ""
__timer_interval = {....define
(in seconds
) the timer interval
for the wake up}
__delete_on_termination = 0 {....1=the agent frees itself
when terminates its task}
end_agent_info
start_bpm_activity "Accounting Configuration"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Chart of Accounts Setup"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
start_bpm_subactivity "Chart of Accounts"
call OpenFormTop
("ptBrowse";"
AU_ACCOUNT_B.FM";"QRY.DATA"
)
end_bpm_subactivity
start_bpm_subactivity "Prototype XLS
for Importing"
id = SelectFrom
("
SELECT AU_DOC
FROM AU_DOC
WHERE (FILE_NAME='AU_IMPACC_PROT.XLS'
)"
)
fname1 = "AU_IMPACC_PROT.XLS"
fname2 = GetResourceDir
()
fname2 = strcat
(fname2
,"\"
,fname1
)
call CopyFileFromServer
("Resource"
,"Path"
,fname1
,fname2
,id
)
call ShellExecute
("open"
,fname2
)
end_bpm_subactivity
start_bpm_subactivity "Import COA form XLS"
filepath = SelectFile
("C:\"
)
call ImportDataFromXLS
(filepath
,"Accounts"
)
call message
("Accounts Imported"
)
call OpenFormTop
("ptBrowse";"
AU_ACCOUNT_B.FM";"QRY.DATA"
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Journals Setup"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
start_bpm_subactivity "Journals"
call OpenFormTop
("ptBrowse";"
AU_REC_BOOK_B.FM";"QRY.DATA"
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Accounting Period Setup"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
start_bpm_subactivity "Accounting Year"
call OpenFormTop
("ptBrowse";"
AU_ACCOUNT_YEAR_B.FM";"QRY.DATA"
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Transaction Types Setup"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
start_bpm_subactivity "Transaction Types"
call OpenFormTop
("ptBrowse";"
AU_T_EVENT_B.FM";"QRY.DATA"
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Opening Balance Setup"
start_bpm_subactivity "Process Form"
rec = __params[1]
expr = strcat
(rec
,"=AU_ORGAN_UNIT"
)
call OpenFormTop
("ptEdit";"
AU_ORGAN_UNIT_E.FM";"WORK.AU_ORGAN_UNIT";1;expr
)
end_bpm_subactivity
start_bpm_subactivity "Process Form"
rec = __params[2]
expr = strcat
(rec
,"=AU_EVENT"
)
call OpenFormTop
("ptEdit";"
AU_EVENT_ACCREC_E.FM";"WORK.AU_EVENT";1;expr
)
end_bpm_subactivity
end_bpm_activity
start_action
rec_id = __params[1]
comm = LookUpId
("AU_ORGAN_UNIT"
,rec_id
,"TITLE"
)
call bpm_setprocedurecomment
(comm
) {.....set the procedures comment}
call bpm_setprocedureowner
(__activation_user
) {.....set the procedure owner}
call bpm_openatonce
()
callwait bpm_assign_job
( "Accounting Configuration"
, __activation_user
, "ACCOUNTING SUPERVISOR"
, 0
, rec_id
)
opbal_id = InsertInto
("AU_EVENT"
,"EDATE"
,crDate
,""
)
callwait bpm_assign_job
( "Chart of Accounts Setup"
, __activation_user
, "ACCOUNTING MANAGER"
, 0
, rec_id
, opbal_id
)
callwait bpm_assign_job
( "Journals Setup"
, __activation_user
, "ACCOUNTING MANAGER"
, 0
, rec_id
)
callwait bpm_assign_job
( "Accounting Period Setup"
, __activation_user
, "ACCOUNTING MANAGER"
, 0
, rec_id
)
callwait bpm_assign_job
( "Transaction Types Setup"
, __activation_user
, "ACCOUNTING MANAGER"
, 0
, rec_id
)
callwait bpm_assign_job
( "Opening Balance Setup"
, __activation_user
, "ACCOUNTING MANAGER"
, 0
, rec_id
, opbal_id
)
end_action