From e244e094c63bfa8692af64b2db6edfa65640c12b Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Thu, 11 Feb 2010 14:40:44 +0000 Subject: [PATCH] bugfix suppress warnings coming from acquisitions homepage Before formatting and doing arithmetic with them we should ensure undefined numeric elements are numbers (This should be enforced in the db) Signed-off-by: Galen Charlton --- acqui/acqui-home.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 01934928a8..8ce7d001fe 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -149,6 +149,16 @@ foreach my $result (@results) { my $member = GetMember( borrowernumber => $result->{budget_owner_id} ); my $member_full = $member->{'firstname'} . ' ' . $member->{'surname'} if $member; + # as we are going to treat these as numbers let's ensure they are not NULL + if (!defined $result->{budget_amount} ) { + $result->{budget_amount} = 0; + } + if (!defined $result->{budget_spent} ) { + $result->{budget_spent} = 0; + } + if (!defined $result->{budget_ordered} ) { + $result->{budget_ordered} = 0; + } $result->{'budget_owner'} = $member_full; $result->{'budget_ordered'} = GetBudgetOrdered( $result->{'budget_id'} ); -- 2.39.5