From 1d4533d30dc4c0fd63640a07625982e755dd4e11 Mon Sep 17 00:00:00 2001 From: tetragon Date: Mon, 8 Oct 2007 21:33:02 +0000 Subject: Scoping adjustment and fixing 1809384 git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1722 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 46ffd2d2..c06c9391 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -762,6 +762,8 @@ formatted as $myconfig->{numberformat}. If $amount is '' or undefined, it is 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 @@ sub get_exchangerate { 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 @@ sub audittrail { + -- cgit v1.2.3