summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/PE.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/LedgerSMB/PE.pm b/LedgerSMB/PE.pm
index 4e17360c..377a1c52 100755
--- 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;