From 4eb84b0dd7a560fb67c0a30df232c94d0d944816 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 21 Jan 2022 16:21:29 +0000 Subject: [PATCH] Bug 15157: (follow-up) Add ability to set lower limit Signed-off-by: Lucas Gass Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- misc/cronjobs/debar_patrons_with_fines.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/debar_patrons_with_fines.pl b/misc/cronjobs/debar_patrons_with_fines.pl index b4906f6a9c..66d2d21eb3 100755 --- a/misc/cronjobs/debar_patrons_with_fines.pl +++ b/misc/cronjobs/debar_patrons_with_fines.pl @@ -41,6 +41,11 @@ debt to the library. Display the help message and exit +=item B<-a|--amount> + +Sets the minimum amount the patron owes before we debar them. +Defaults to 0, meaning anyone that owes anything will be debared. + =item B<-m|--message> Add the passed message in the debarment comment @@ -74,6 +79,7 @@ use C4::Log qw( cronlogaction ); my ( $help, $confirm, $message, $expiration, $file ); GetOptions( + 'a|amount' => \$amount, 'h|help' => \$help, 'c|confirm:s' => \$confirm, 'm|message:s' => \$message, @@ -84,7 +90,7 @@ pod2usage(1) if $help; pod2usage(1) unless ( $confirm && ( $message || $file ) ); cronlogaction(); -my $badBorrowers = Koha::Patrons->filter_by_amount_owed( { more_than => 0 } ); +my $badBorrowers = Koha::Patrons->filter_by_amount_owed( { more_than => $amount // 0 } ); $message = getMessageContent(); while ( my $bb = $badBorrowers->next ) { -- 2.39.5