summaryrefslogtreecommitdiff
path: root/LedgerSMB/AA.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-19 06:47:55 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-19 06:47:55 +0000
commit5c6cd055b1b83d8309332ab3ce1001137d0e8f42 (patch)
tree146f9d75f61823c8c15093f3940960a564bf4896 /LedgerSMB/AA.pm
parent6e13bacefd8e71242dec64a3185215980e749bcf (diff)
More voucher-related commits
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1285 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/AA.pm')
-rw-r--r--LedgerSMB/AA.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm
index 4f14fda8..8c4c4ad9 100644
--- a/LedgerSMB/AA.pm
+++ b/LedgerSMB/AA.pm
@@ -326,6 +326,16 @@ sub post_transaction {
$query = qq| UPDATE $table SET approved = ? WHERE id = ?|;
$dbh->prepare($query)->execute($form->{approved}, $form->{id}) ||
$form->dberror($query);
+ if (!$form->{approved}){
+ if (not defined $form->{batch_id}){
+ $form->error($locale->text('Batch ID Missing'));
+ }
+ $query = qq|
+ INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+ $dbh->prepare($query)->execute($form->{batch_id}, $form->{id}) ||
+ $form->dberror($query);
+ }
+
}
@queries = $form->run_custom_queries( $table, 'INSERT' );