[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [1509] trunk
- Subject: SF.net SVN: ledger-smb: [1509] trunk
- From: ..hidden..
- Date: Wed, 05 Sep 2007 15:02:25 -0700
Revision: 1509
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1509&view=rev
Author: einhverfr
Date: 2007-09-05 15:02:24 -0700 (Wed, 05 Sep 2007)
Log Message:
-----------
Removing one obsolete test, and correcting number handling logic in LedgerSMB.pm so tests are passed.
Modified Paths:
--------------
trunk/LedgerSMB/Form.pm
trunk/LedgerSMB.pm
trunk/t/01-load.t
Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm 2007-09-05 18:46:40 UTC (rev 1508)
+++ trunk/LedgerSMB/Form.pm 2007-09-05 22:02:24 UTC (rev 1509)
@@ -1350,6 +1350,9 @@
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 @@
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";
Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm 2007-09-05 18:46:40 UTC (rev 1508)
+++ trunk/LedgerSMB.pm 2007-09-05 22:02:24 UTC (rev 1509)
@@ -528,6 +528,7 @@
else {
$amount = Math::BigFloat->new($amount)->ffround( -( $places - 1 ) );
}
+ $amount->precision(undef);
return $amount;
}
Modified: trunk/t/01-load.t
===================================================================
--- trunk/t/01-load.t 2007-09-05 18:46:40 UTC (rev 1508)
+++ trunk/t/01-load.t 2007-09-05 22:02:24 UTC (rev 1509)
@@ -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::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');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.