summaryrefslogtreecommitdiff
path: root/LedgerSMB/Form.pm
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-08 21:33:02 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-08 21:33:02 +0000
commit1d4533d30dc4c0fd63640a07625982e755dd4e11 (patch)
treea5b20c7aa223806919b0035deb8b1989bca9f23d /LedgerSMB/Form.pm
parent8639d83105801a2d231faa9ee103a17d8a748a19 (diff)
Scoping adjustment and fixing 1809384
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1722 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Form.pm')
-rw-r--r--LedgerSMB/Form.pm8
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 {
+