summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/CP.pm6
-rw-r--r--LedgerSMB/Form.pm4
2 files changed, 7 insertions, 3 deletions
diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm
index 683484fd..b901354b 100644
--- a/LedgerSMB/CP.pm
+++ b/LedgerSMB/CP.pm
@@ -665,7 +665,7 @@ sub post_payments {
# get exchangerate for original
$query = qq|
- SELECT $buysell
+ SELECT $buysell AS fx
FROM exchangerate e
JOIN $form->{arap} a
ON (a.transdate = e.transdate)
@@ -675,7 +675,9 @@ sub post_payments {
$sth = $dbh->prepare($query);
$sth->execute( $form->{currency}, $form->{"id_$i"} )
|| $form->dberror( $query, 'CP.pm', 671 );
- my ($exchangerate) = $sth->fetchrow_array;
+ my $ref = $sth->fetchrow_arrayref();
+ $form->db_parse_numeric(sth => $sth, arrayref => $ref);
+ my ($exchangerate) = @$ref;
$exchangerate ||= 1;
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 05a23165..a71d7dca 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1541,7 +1541,9 @@ sub check_exchangerate {
my $sth = $self->{dbh}->prepare($query);
$sth->execute( $currency, $transdate );
- my ($exchangerate) = $sth->fetchrow_array;
+ my @array = $sth->fetchrow_array;
+ $self->db_parse_numeric(sth => $sth, arrayref => \@array);
+ my ($exchangerate) = @array;
$sth->finish;