From 78ea633d03239903f534c4f0c98ee90aefad5f34 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 14 May 2007 18:02:56 +0000 Subject: Fixing more number double parsing bugs git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1188 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/CA.pm | 15 +++++++++++---- LedgerSMB/RP.pm | 1 - 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/LedgerSMB/CA.pm b/LedgerSMB/CA.pm index b182e6d0..61df47fd 100755 --- a/LedgerSMB/CA.pm +++ b/LedgerSMB/CA.pm @@ -53,6 +53,7 @@ sub all_accounts { $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); $amount{ $ref->{accno} } = $ref->{amount}; } @@ -317,7 +318,9 @@ sub all_transactions { $sth = $dbh->prepare($query); $sth->execute(@queryargs); - ( $form->{balance} ) = $sth->fetchrow_array; + my @balance = $sth->fetchrow_array; + $form->db_parse_numeric(sth=>$sth, arrayref=>\@balance); + ( $form->{balance} ) = @balance; $sth->finish; @queryargs = (); } @@ -455,7 +458,7 @@ sub all_transactions { my %accno; while ( my $ca = $sth->fetchrow_hashref(NAME_lc) ) { - + $form->db_parse_numeric(sth=>$sth, hashref=>$ca); # gl if ( $ca->{module} eq "gl" ) { $ca->{module} = "gl"; @@ -482,7 +485,9 @@ sub all_transactions { $dr->execute( $ca->{id} ); $ca->{accno} = (); - while ( ( $chart_id, $accno ) = $dr->fetchrow_array ) { + while ( my @dr_results = $dr->fetchrow_array ) { + $form->db_parse_numeric(sth=>$dr, arrayref=>\@dr_results); + ($chart_id, $accno) = @dr_results; $accno{$accno} = 1 if $chart_id ne $ca->{chart_id}; } @@ -499,7 +504,9 @@ sub all_transactions { $cr->execute( $ca->{id} ); $ca->{accno} = (); - while ( ( $chart_id, $accno ) = $cr->fetchrow_array ) { + while ( my @cr_results = $cr->fetchrow_array ) { + $form->db_parse_numeric(sth=>$cr, arrayref=>\@cr_results); + ($chart_id, $accno) = @cr_results; $accno{$accno} = 1 if $chart_id ne $ca->{chart_id}; } diff --git a/LedgerSMB/RP.pm b/LedgerSMB/RP.pm index e4e13f7a..861ec859 100755 --- a/LedgerSMB/RP.pm +++ b/LedgerSMB/RP.pm @@ -1222,7 +1222,6 @@ sub get_accounts { my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); - while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { $form->db_parse_numeric(sth=>$sth, hashref=>$ref); -- cgit v1.2.3