[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1307] trunk/LedgerSMB/PE.pm



Revision: 1307
          http://svn.sourceforge.net/ledger-smb/?rev=1307&view=rev
Author:   einhverfr
Date:     2007-06-22 11:57:50 -0700 (Fri, 22 Jun 2007)

Log Message:
-----------
Fixing error updating existing project

Modified Paths:
--------------
    trunk/LedgerSMB/PE.pm

Modified: trunk/LedgerSMB/PE.pm
===================================================================
--- trunk/LedgerSMB/PE.pm	2007-06-22 18:54:57 UTC (rev 1306)
+++ trunk/LedgerSMB/PE.pm	2007-06-22 18:57:50 UTC (rev 1307)
@@ -236,8 +236,10 @@
     $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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.