From 7fe1b078c4978aa1b76816458f6ed7baeb6786ec Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sun, 24 Feb 2008 03:18:36 +0000 Subject: Merging fix for 1895526 git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2079 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/CP.pm | 6 ++++-- LedgerSMB/Form.pm | 4 +++- 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; -- cgit v1.2.3