diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/Form.pm | 8 |
1 files changed, 5 insertions, 3 deletions
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 { + |