summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-05 22:02:24 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-05 22:02:24 +0000
commit311db34c7abbc4c78fe28994b13f21c4eb7f1e8d (patch)
tree2dd5170df640f78386faa5c7cad3490eb2e77ab2
parent72438a0b8961434978cbcea2008c450a58eabf50 (diff)
Removing one obsolete test, and correcting number handling logic in LedgerSMB.pm so tests are passed.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1509 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB.pm1
-rw-r--r--LedgerSMB/Form.pm5
-rw-r--r--t/01-load.t3
3 files changed, 6 insertions, 3 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index 083ecb8a..6f32167d 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -528,6 +528,7 @@ sub round_amount {
else {
$amount = Math::BigFloat->new($amount)->ffround( -( $places - 1 ) );
}
+ $amount->precision(undef);
return $amount;
}
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 723e86bf..6566b80a 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1350,6 +1350,9 @@ sub update_balance {
my ( $self, $dbh, $table, $field, $where, $value ) = @_;
+
+ $table = $dbh->quote_identifier($table);
+ $field = $dbh->quote_identifier($field);
# if we have a value, go do it
if ($value) {
@@ -1357,7 +1360,7 @@ sub update_balance {
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";
diff --git a/t/01-load.t b/t/01-load.t
index 7a0aaf62..eca72e87 100644
--- a/t/01-load.t
+++ b/t/01-load.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 35;
+use Test::More tests => 34;
use_ok('LedgerSMB');
use_ok('LedgerSMB::AA');
@@ -17,7 +17,6 @@ use_ok('LedgerSMB::HR');
use_ok('LedgerSMB::IC');
use_ok('LedgerSMB::IR');
use_ok('LedgerSMB::IS');
-use_ok('LedgerSMB::Menufile');
use_ok('LedgerSMB::JC');
use_ok('LedgerSMB::Locale');
use_ok('LedgerSMB::Log');