diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 21:26:14 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-19 21:26:14 +0000 |
commit | 56bad0026c65026b9088be15e6d1956b8e9dd01e (patch) | |
tree | 257d611c221e257a98a024d7d0b57d5395b8eb80 | |
parent | db3e35002f922a80bf93ab5b5da09d2b352681d1 (diff) |
AR/AP Vouchers now posting properly.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1797 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | LedgerSMB/AA.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm index 449819d5..649856a1 100644 --- a/LedgerSMB/AA.pm +++ b/LedgerSMB/AA.pm @@ -372,10 +372,16 @@ sub post_transaction { if (not defined $form->{batch_id}){ $form->error($locale->text('Batch ID Missing')); } + if ($form->{arap} eq 'ar'){ + $batch_class = 'receivable'; + } else { + $batch_class = 'payable'; + } $query = qq| - INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|; - $dbh->prepare($query)->execute($form->{batch_id}, $form->{id}) || - $form->dberror($query); + INSERT INTO voucher (batch_id, trans_id, batch_class) + VALUES (?, ?, (select id from batch_class where class = ?))|; + $dbh->prepare($query)->execute($form->{batch_id}, $form->{id}, + $batch_class) || $form->dberror($query); } } |