From 9abe034a2012fcd6c69c468c7c6b65d88e01e0fe Mon Sep 17 00:00:00 2001 From: tetragon Date: Wed, 31 Oct 2007 22:01:33 +0000 Subject: 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 --- LedgerSMB/Form.pm | 9 +++++---- 1 file 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[$_]}) -- cgit v1.2.3