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

SF.net SVN: ledger-smb: [1831] trunk



Revision: 1831
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1831&view=rev
Author:   tetragon
Date:     2007-10-31 15:07:32 -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:
--------------
    trunk/LedgerSMB/Form.pm
    trunk/LedgerSMB.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-10-31 22:01:33 UTC (rev 1830)
+++ trunk/LedgerSMB/Form.pm	2007-10-31 22:07:32 UTC (rev 1831)
@@ -856,7 +856,8 @@
     my @types = @{$sth->{TYPE}};
     my @names = @{$sth->{NAME_lc}};
     for (0 .. $#names){
-        if ($types[$_] == 3){
+        #   numeric            float4/real
+        if ($types[$_] == 3 or $types[$_] ==2) {
             $arrayref->[$_] = Math::BigFloat->new($arrayref->[$_]) 
               if defined $arrayref;
             $hashref->{$names[$_]} = Math::BigFloat->new($hashref->{$names[$_]})

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2007-10-31 22:01:33 UTC (rev 1830)
+++ trunk/LedgerSMB.pm	2007-10-31 22:07:32 UTC (rev 1831)
@@ -555,7 +555,8 @@
     my @names = @{$sth->{NAME_lc}};
     while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) {
 	for (0 .. $#names){
-            if ($types[$_] == 3){
+            #   numeric            float4/real
+            if ($types[$_] == 3 or $types[$_] == 2) {
                 $ref->{$names[$_]} = Math::BigFloat->new($ref->{$names[$_]});
             }
         }


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