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

SF.net SVN: ledger-smb: [1722] trunk/LedgerSMB/Form.pm



Revision: 1722
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1722&view=rev
Author:   tetragon
Date:     2007-10-08 14:33:02 -0700 (Mon, 08 Oct 2007)

Log Message:
-----------
Scoping adjustment and fixing 1809384

Modified Paths:
--------------
    trunk/LedgerSMB/Form.pm

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2007-10-08 21:31:51 UTC (rev 1721)
+++ trunk/LedgerSMB/Form.pm	2007-10-08 21:33:02 UTC (rev 1722)
@@ -762,6 +762,8 @@
 treated as zero.  DRCR and parenthesis notation is accepted in addition to
 negative sign notation.
 
+Calls $form->error if the value is NaN.
+
 =cut
 
 sub parse_amount {
@@ -1496,20 +1498,19 @@
     my ( $self, $dbh, $curr, $transdate, $fld ) = @_;
 
     my $exchangerate = 1;
-    my $sth;
 
     if ($transdate) {
         my $query = qq|
 			SELECT $fld FROM exchangerate
 			WHERE curr = ? AND transdate = ?|;
-        $sth = $self->{dbh}->prepare($query);
+        my $sth = $self->{dbh}->prepare($query);
         $sth->execute( $curr, $transdate );
 
         ($exchangerate) = $sth->fetchrow_array;
 	$exchangerate = Math::BigFloat->new($exchangerate);
+        $sth->finish;
     }
 
-    $sth->finish;
     $exchangerate;
 }
 
@@ -3526,3 +3527,4 @@
 
 
 
+


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