[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1830] branches/1.2/LedgerSMB/Form.pm



Revision: 1830
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1830&view=rev
Author:   tetragon
Date:     2007-10-31 15:01:33 -0700 (Wed, 31 Oct 2007)

Log Message:
-----------
Get db_parse_numeric to recognise float4/real as a "numeric" type.
  Fixes problems with discount retreival on invoices.

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Form.pm

Modified: branches/1.2/LedgerSMB/Form.pm
===================================================================
--- branches/1.2/LedgerSMB/Form.pm	2007-10-31 05:30:57 UTC (rev 1829)
+++ branches/1.2/LedgerSMB/Form.pm	2007-10-31 22:01:33 UTC (rev 1830)
@@ -594,10 +594,11 @@
     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[$_]})


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.