summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-22 18:57:50 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-06-22 18:57:50 +0000
commiteb21ae5da75a6d71afa8edc894b85701553f0751 (patch)
treeaa442ba0e6d6d8d564b08b4386d6230bb115b319
parent8866bc4dfb834f4bdbf2f78da8cd069451cce680 (diff)
Fixing error updating existing project
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1307 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/PE.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm
index a9c733c5..d49c1cc3 100644
--- a/LedgerSMB/PE.pm
+++ b/LedgerSMB/PE.pm
@@ -236,8 +236,10 @@ sub save_project {
$sth->execute( $form->{projectnumber},
$form->{description}, $startdate, $enddate, $form->{customer_id} )
|| $form->dberror($query);
- $query = "SELECT currval('id')";
- ($form->{id}) = $dbh->selectrow_array($query) || $form->dberror($query);
+ if (!$form->{id}){
+ $query = "SELECT currval('id')";
+ ($form->{id}) = $dbh->selectrow_array($query) || $form->dberror($query);
+ }
$form->run_custom_queries( 'project', 'UPDATE' );
$dbh->commit;