summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-02-24 03:18:36 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-02-24 03:18:36 +0000
commit7fe1b078c4978aa1b76816458f6ed7baeb6786ec (patch)
treed68ac84f9ae685f338769db850a2b7159eb2dd16
parent239834db495d79c0e1d05ac0d9202dc76b1e6474 (diff)
Merging fix for 1895526
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2079 4979c152-3d1c-0410-bac9-87ea11338e46
-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;