From e5f8255e73273411a2a8cd72c5a8697b8fa0c3ec Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 1 Sep 2007 21:50:10 +0000 Subject: Fixing tax selection for creating new customers in old code git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1491 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/CT.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/CT.pm b/LedgerSMB/CT.pm index e9497b57..b51f48bf 100644 --- a/LedgerSMB/CT.pm +++ b/LedgerSMB/CT.pm @@ -329,12 +329,13 @@ sub save_customer { if ( $form->{"tax_$item"} ) { $query = qq| INSERT INTO customertax (customer_id, chart_id) - VALUES (?, (SELECT id + VALUES (currval('entity_credit_account_id_seq'), + (SELECT id FROM chart WHERE accno = ?))|; $sth = $dbh->prepare($query); - $sth->execute( $form->{id}, $item ) + $sth->execute( $item ) || $form->dberror($query); } } -- cgit v1.2.3