[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2970] trunk/scripts/vouchers.pl
- Subject: SF.net SVN: ledger-smb:[2970] trunk/scripts/vouchers.pl
- From: ..hidden..
- Date: Wed, 17 Mar 2010 15:57:05 +0000
Revision: 2970
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2970&view=rev
Author: einhverfr
Date: 2010-03-17 15:57:05 +0000 (Wed, 17 Mar 2010)
Log Message:
-----------
Alexey's voucher fixes
Modified Paths:
--------------
trunk/scripts/vouchers.pl
Modified: trunk/scripts/vouchers.pl
===================================================================
--- trunk/scripts/vouchers.pl 2010-03-16 16:47:20 UTC (rev 2969)
+++ trunk/scripts/vouchers.pl 2010-03-17 15:57:05 UTC (rev 2970)
@@ -34,10 +34,12 @@
sub create_batch {
my ($request) = @_;
- $request->{hidden} = [
+ $request->open_form;
+ $request->{hidden} = [
{name => "batch_type", value => $request->{batch_type}},
+ {name => "form_id", value => $request->{form_id}},
];
-
+
my $batch = LedgerSMB::Batch->new({base => $request});
$batch->{class_id} = $batch->get_class_id($batch->{batch_type});
$batch->get_new_info;
@@ -57,7 +59,7 @@
my ($request) = shift @_;
my $batch = LedgerSMB::Batch->new({base => $request});
$batch->{batch_class} = $request->{batch_type};
- if ($request->form_close){
+ if ($request->close_form){
$batch->create;
add_vouchers($batch);
} else {
@@ -281,6 +283,9 @@
class => 'submit',
}];
}
+ # save form_id into the DB before sending the form.
+ # TODO: need to find a better place for this.
+ $batch->{dbh}->commit();
$template->render({
form => $batch,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.