summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-05 23:02:18 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-05 23:02:18 +0000
commit9dd72130f253426df35db305d6b6234ce5831fa8 (patch)
tree10da14cd55efd443679b3fe798588095fa632c14 /LedgerSMB
parentcc0d03441c59c21a3d1f397f35d8743e1ab4f643 (diff)
Fixing update_balance
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1510 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Form.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 8af13b55..6f504894 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1672,11 +1672,13 @@ sub update_balance {
# 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";