Bug 19935: Replace GetPendingIssues - deletemem.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 8 Jan 2018 14:16:09 +0000 (11:16 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 3 Apr 2018 14:43:37 +0000 (11:43 -0300)
Same as previously, we just want Koha::Patron->checkouts->count to know
if a patron has checkouts.

Test plan:
Confirm that you cannot delete a patron's card if they have pending checkouts

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
members/deletemem.pl

index 96f6251..8e89acd 100755 (executable)
@@ -74,10 +74,8 @@ if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen
     }
 }
 
-my $issues = GetPendingIssues($member);     # FIXME: wasteful call when really, we only want the count
-my $countissues = scalar(@$issues);
-
 my $charges = $patron->account->non_issues_charges;
+my $countissues = $patron->pending_checkouts->count;
 my $userenv = C4::Context->userenv;
 
 if ($patron->category->category_type eq "S") {