]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttInvoiceHelper.class.php
Refactoring, finished with last insert ids.
[timetracker.git] / WEB-INF / lib / ttInvoiceHelper.class.php
index 41dace01bfb86f17b0368105c53950f4e4ae954e..0867ee1ebc0ebbc5d186bf9efb72961570159c3f 100644 (file)
@@ -332,11 +332,7 @@ class ttInvoiceHelper {
     if (is_a($affected, 'PEAR_Error')) return false;
 
     // Mark associated invoice items with invoice id.
-    $last_id = 0;
-    $sql = "select last_insert_id() as last_insert_id";
-    $res = $mdb2->query($sql);
-    $val = $res->fetchRow();
-    $last_id = $val['last_insert_id'];
+    $last_id = $mdb2->lastInsertID('tt_invoices', 'id');
 
     // Our update sql is different depending on tracking mode.
     if (MODE_TIME == $user->getTrackingMode()) {