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

SF.net SVN: ledger-smb: [1510] branches/1.2/LedgerSMB/Form.pm



Revision: 1510
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1510&view=rev
Author:   einhverfr
Date:     2007-09-05 16:02:18 -0700 (Wed, 05 Sep 2007)

Log Message:
-----------
Fixing update_balance

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Form.pm

Modified: branches/1.2/LedgerSMB/Form.pm
===================================================================
--- branches/1.2/LedgerSMB/Form.pm	2007-09-05 22:02:24 UTC (rev 1509)
+++ branches/1.2/LedgerSMB/Form.pm	2007-09-05 23:02:18 UTC (rev 1510)
@@ -1672,11 +1672,13 @@
     # if we have a value, go do it
     if ($value) {
 
+        $table = $dbh->quote_identifier($table);
+        $field = $dbh->quote_identifier($field);
         # retrieve balance from table
         my $query = "SELECT $field FROM $table WHERE $where FOR UPDATE";
         my ($balance) = $dbh->selectrow_array($query);
 
-        $balance += $value;
+        $balance = $dbh->quote($balance + $value);
 
         # update balance
         $query = "UPDATE $table SET $field = $balance WHERE $where";


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