From 49f329413dec11e89d1363e70d80a4cbbf870601 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 27 Aug 2020 13:03:16 +0300 Subject: [PATCH] Bug 15157: Update script This patch updates debarrBorrowersWithFines.pl script to match changes made in bug 15156. To test: 1. Have patron(s) with unpaid fines 2. Run e.g debarrBorrowersWithFines.pl --confirm -m "This is a description of you bad deeds" (test other options too) 3. Confirm patron(s) with fines has been debarred with the explanation Sponsored-by: Koha-Suomi Oy Signed-off-by: Lucas Gass --- misc/debarrBorrowersWithFines.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/debarrBorrowersWithFines.pl b/misc/debarrBorrowersWithFines.pl index 5192bc06b7c..fb46a6f3517 100644 --- a/misc/debarrBorrowersWithFines.pl +++ b/misc/debarrBorrowersWithFines.pl @@ -4,7 +4,8 @@ use Modern::Perl; use Getopt::Long; use C4::Accounts; -use Koha::Borrower::Debarments; +use Koha::Patrons; +use Koha::Patron::Debarments; my ($help, $confirm, $message, $expiration, $file); GetOptions( @@ -59,13 +60,13 @@ elsif (not($file) && not(length($message) > 20)) { exit 1; } -my $badBorrowers = C4::Accounts::GetAllBorrowersWithUnpaidFines(); +my $badBorrowers = Koha::Patrons->search->search_patrons_with_unpaid_fines(); $message = getMessageContent(); foreach my $bb (@$badBorrowers) { #Don't crash, but keep debarring as long as you can! eval { - my $success = Koha::Borrower::Debarments::AddDebarment({ + my $success = Koha::Patron::Debarments::AddDebarment({ borrowernumber => $bb->{borrowernumber}, expiration => $expiration, type => 'MANUAL', -- 2.30.2