diff options
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 { } |