From 4165c00e30c1cdc0a834d236553bfc99b36fa554 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 22 Jan 2016 02:02:16 +0000 Subject: [PATCH] Bug 15642 - Batch patron deletion should not delete patrons with issues This patch changes _skip_borrowers_with_nonzero_balance to _skip_borrowers_with_nonzero_balance_or_issues and excludes borrowrs with issues from the batch deletion tool (this change brings tools/cleanborrowers.pl into line with misc/cronjobs/delete_patrons.pl with uses C4::Members GetBorrowersToExpunge which excludes patrons with current issues) --- tools/cleanborrowers.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl index 7888b99..ae51e9c 100755 --- a/tools/cleanborrowers.pl +++ b/tools/cleanborrowers.pl @@ -159,12 +159,13 @@ $template->param( #writing the template output_html_with_http_headers $cgi, $cookie, $template->output; -sub _skip_borrowers_with_nonzero_balance { +sub _skip_borrowers_with_nonzero_balance_or_issues { my $borrowers = shift; my $balance; + mu $issues; @$borrowers = map { - (undef, undef, $balance) = GetMemberIssuesAndFines( $_->{borrowernumber} ); - ($balance != 0) ? (): ($_); + (undef, $issues, $balance) = GetMemberIssuesAndFines( $_->{borrowernumber} ); + ($balance != 0i || $issues!= 0) ? (): ($_); } @$borrowers; } -- 2.1.4