From e1509855d3aa2729127ac352525be62505d752f9 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 4 Aug 2020 18:28:42 +0000 Subject: [PATCH] Bug 25683: (follow-up) Use COALESCE instead of IFNULL Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- Koha/Patrons.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm index c20a6599bf..3b3b4b1cb6 100644 --- a/Koha/Patrons.pm +++ b/Koha/Patrons.pm @@ -399,8 +399,8 @@ sub search_patrons_to_update_category { $query{join} = ["accountlines"]; $query{columns} = ["borrowernumber"]; $query{group_by} = ["borrowernumber"]; - $query{having} = \['IFNULL(sum(accountlines.amountoutstanding),0) <= ?',$params->{fine_max}] if defined $params->{fine_max}; - $query{having} = \['IFNULL(sum(accountlines.amountoutstanding),0) >= ?',$params->{fine_min}] if defined $params->{fine_min}; + $query{having} = \['COALESCE(sum(accountlines.amountoutstanding),0) <= ?',$params->{fine_max}] if defined $params->{fine_max}; + $query{having} = \['COALESCE(sum(accountlines.amountoutstanding),0) >= ?',$params->{fine_min}] if defined $params->{fine_min}; } return $self->search($search_params,\%query); } -- 2.39.5