From e60243815b8bb78b15aa0c99b6da1ff1fe68f143 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 27 Jun 2018 10:42:56 -0400 Subject: [PATCH] Bug 20946: Avoid summing the list twice --- Koha/Account.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Account.pm b/Koha/Account.pm index 518e3c3014..4be50d346f 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -306,7 +306,8 @@ sub outstanding_debits { ); # sum returns undef it list is empty - my $total = sum( $lines->get_column('amountoutstanding') ) ? sum( $lines->get_column('amountoutstanding') ) + 0 : 0; + my $sum = sum( $lines->get_column('amountoutstanding') ); + my $total = $sum ? $sum : 0; return ( $total, $lines ); } -- 2.15.2 (Apple Git-101.1)