diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 18:47:03 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 18:47:03 +0000 |
commit | db3e35002f922a80bf93ab5b5da09d2b352681d1 (patch) | |
tree | 87bb50fe590ac5b62ed69b610e0d02fd526bfeca /scripts | |
parent | c2f3e31ee16b527315a3c6ffde4f4001c431f9ee (diff) |
GL Vouchers are posting and saving correctly. Need to get listing and approving but that is conceptually a lot easier and involves a lot less legacy code
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1796 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vouchers.pl | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/scripts/vouchers.pl b/scripts/vouchers.pl index 7e131bc2..e264ed8a 100644 --- a/scripts/vouchers.pl +++ b/scripts/vouchers.pl @@ -37,6 +37,7 @@ sub create_vouchers { use LedgerSMB::Form; my $batch = LedgerSMB::Batch->new({base => $request}); + $batch->{batch_class} = $request->{batch_type}; $batch->create; my $vouchers_dispatch = @@ -49,29 +50,36 @@ sub create_vouchers { }; # Note that the line below is generally considered incredibly bad form. - # However, the code we are including is going to require it for now. - no strict; + # However, the code we are including is going to require it for now. -- CT our $form = new Form; our $locale = $request->{_locale}; + for (keys %$request){ $form->{$_} = $request->{$_}; } + $form->{batch_id} = $batch->{id}; $form->{approved} = 0; $form->{transdate} = $request->{batch_date}; - print STDERR "$request->{batch_type}\n"; - require $vouchers_dispatch->{$request->{batch_type}}{script}; + my $script = $vouchers_dispatch->{$request->{batch_type}}{script}; + { no strict; no warnings 'redefine'; do $script; } + $script =~ s|.*/||; $form->{script} = $script; + $vouchers_dispatch->{$request->{batch_type}}{function}(); +} -\ $vouchers_dispatch->{$request->{batch_type}}{function}(); +sub get_batch { } sub list_vouchers { } +sub add_vouchers { +} + sub approve_batch { } |