From bf6d813c145ecbae8928ed09920cc92ab5a64aae Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 19 Sep 2012 17:14:57 +0800 Subject: [PATCH] Bug 8788 - Viewing basket for acquisitions triggers error log entries Content-Type: text/plain; charset="utf-8" Some variables are not initialized in the case there is no GST. As such, four items were moved to a separate conditional template param call based on "if $gist;". --- acqui/basket.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 9b36c14..2ec40c6 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -393,10 +393,6 @@ my $total_est_gste; books_loop => \@books_loop, cancelledorders_loop => \@cancelledorders, gist_rate => sprintf( "%.2f", $gist * 100 ) . '%', - total_rrp_gste => sprintf( "%.2f", $total_rrp_gste ), - total_est_gste => sprintf( "%.2f", $total_est_gste ), - gist_est => sprintf( "%.2f", $gist_est ), - gist_rrp => sprintf( "%.2f", $gist_rrp ), total_rrp_gsti => sprintf( "%.2f", $total_rrp_gsti ), total_est_gsti => sprintf( "%.2f", $total_est_gsti ), # currency => $bookseller->{'listprice'}, @@ -408,6 +404,12 @@ my $total_est_gste; unclosable => @orders ? 0 : 1, has_budgets => $has_budgets, ); + $template->param( + total_rrp_gste => sprintf( "%.2f", $total_rrp_gste ), + total_est_gste => sprintf( "%.2f", $total_est_gste ), + gist_est => sprintf( "%.2f", $gist_est ), + gist_rrp => sprintf( "%.2f", $gist_rrp ), + ) if $gist; } output_html_with_http_headers $query, $cookie, $template->output; -- 1.7.9.5