-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert buttons on journal screen to workflow
- Loading branch information
1 parent
f842830
commit c6a3517
Showing
9 changed files
with
355 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
create temporary table workflow_transactions as | ||
select gl.id as gl, | ||
nextval('workflow_seq') as wf, | ||
CASE WHEN approved THEN 'POSTED' | ||
ELSE 'SAVED' END as state, | ||
from gl | ||
where not exists (select from yearend y where y.trans_id = gl.id) | ||
and not exists (select from payment p where p.gl_id = gl.id) | ||
and not exists (select from inventory_report r where r.trans_id = gl.id) | ||
and not exists (select from asset_report a where a.gl_id = gl.id); | ||
|
||
insert into workflow (workflow_id, type, state, last_update) | ||
select wf, 'GL', state, now() | ||
from workflow_transactions; | ||
|
||
update trn | ||
set workflow_id = wf | ||
from transactions trn | ||
join workflow_transactions wt | ||
on trn.id = wt.id; | ||
|
||
insert into workflow_history | ||
(workflow_hist_id, workflow_id, action, | ||
description, state, workflow_user, history_date) | ||
select nextval('workflow_history_seq'), wf, 'MIGRATE', | ||
'Workflow created during migration', state, | ||
CURRENT_USER, now() | ||
from workflow_transactions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.