Skip to content

Commit

Permalink
Merge pull request #8490 from ehuelsmann/fix/master/unposted-recurrin…
Browse files Browse the repository at this point in the history
…g-transactions

Make sure the in-memory workflow context
  • Loading branch information
ehuelsmann authored Nov 9, 2024
2 parents 3e9380c + 547a3c6 commit f7a6509
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions old/bin/am.pl
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,15 @@ sub process_transactions {
}
$form->info( " ..... " . $locale->text('done') );

# posting the transaction above changed the workflow
# as stored on disk; update the workflow stored in
# memory. Also, we can't use the "post_and_approve"
# action because that's only available when
# "separate_duties" *isn't* enabled, so execute 2 actions
# which are guaranteed to exist, separately
$wf = $form->{_wire}->get('workflows')->fetch_workflow(
'AR/AP',
$form->{workflow_id} );
# Make sure the transaction isn't posted as a draft
$wf->execute_action( 'post' )
if $wf->state eq 'INITIAL';
Expand Down Expand Up @@ -852,6 +861,16 @@ sub process_transactions {
)
);
$ok = GL->post_transaction( \%myconfig, \%$form, $locale );

# posting the transaction above changed the workflow
# as stored on disk; update the workflow stored in
# memory. Also, we can't use the "post_and_approve"
# action because that's only available when
# "separate_duties" *isn't* enabled, so execute 2 actions
# which are guaranteed to exist, separately
$wf = $form->{_wire}->get('workflows')->fetch_workflow(
'GL',
$form->{workflow_id} );
# Make sure the transaction isn't posted as a draft
$wf->execute_action( 'post' )
if $wf->state eq 'INITIAL';
Expand Down

0 comments on commit f7a6509

Please sign in to comment.