diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-10 00:56:58 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-07-10 00:56:58 +0000 |
commit | 4a07e174e74e2b707ecf9bf308917ad689e9f317 (patch) | |
tree | ea33c7361684335cf804581738d22a7c7e5da6d4 /bin | |
parent | 87a7da4dcf11934fafdb8b6393694557182d6a8f (diff) |
Correcting the last errors for the draft approval on secondary test instance
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2203 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'bin')
-rw-r--r-- | bin/aa.pl | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -843,7 +843,6 @@ qq|<td align=center><input name="memo_$i" size=11 value="$form->{"memo_$i"}"></t } sub form_footer { - $form->hide_form(qw(callback path login sessionid)); $transdate = $form->datetonum( \%myconfig, $form->{transdate} ); @@ -888,6 +887,13 @@ sub form_footer { 'delete' => { ndx => 8, key => 'D', value => $locale->text('Delete') }, ); + if (!$form->{approved}){ + $button{approve} = { ndx => 3, key => 'O', value => $locale->text('Post') }; + delete $button{post_as_new}; + delete $button{print_and_post_as_new}; + delete $button{post}; + delete $button{print_and_post}; + } if ($form->{separate_duties}){ $button{post}->{value} = $locale->text('Save'); @@ -943,6 +949,18 @@ sub form_footer { } +sub approve { + use LedgerSMB::DBObject::Draft; + use LedgerSMB; + my $lsmb = LedgerSMB->new(); + $lsmb->merge($form); + + my $draft = LedgerSMB::DBObject::Draft->new({base => $lsmb}); + + $draft->approve(); + $form->info($locale->text('Draft Posted')); +} + sub update { my $display = shift; $is_update = 1; |