summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-31 22:01:33 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-31 22:01:33 +0000
commit9abe034a2012fcd6c69c468c7c6b65d88e01e0fe (patch)
treeed264971e3ba9a0f5cb1eeb395fd3b4510564ee1
parenta5cca7eafe505579b1d69a8782f4c0d69f9a8199 (diff)
Get db_parse_numeric to recognise float4/real as a "numeric" type.
Fixes problems with discount retreival on invoices. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1830 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 3422e2ac..26dbd40b 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -594,10 +594,11 @@ sub db_parse_numeric {
my %args = @_;
my ($sth, $arrayref, $hashref) = ($args{sth}, $args{arrayref},
$args{hashref});
- my @types = @{$sth->{TYPE}};
- my @names = @{$sth->{NAME_lc}};
- for (0 .. $#names){
- if ($types[$_] == 3){
+ my @types = @{$sth->{'TYPE'}};
+ my @names = @{$sth->{'NAME_lc'}};
+ for (0 .. $#names) {
+ # numeric real/float4
+ if ($types[$_] == 3 or $types[$_] == 2){
$arrayref[$_] = Math::BigFloat->new($arrayref[$_])
if defined $arrayref;
$hashref->{$names[$_]} = Math::BigFloat->new($hashref->{$names[$_]})