Bug 15157: (follow-up) Add ability to set lower limit

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-01-21 16:21:29 +00:00 committed by Tomas Cohen Arazi
parent 9e3f47d6b2
commit 4eb84b0dd7
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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 ) {