Bugzilla – Attachment 124896 Details for
Bug 15157
Cronjob to automatically restrict patrons with pending/unpaid charges
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15157: Update for reworked bug 15156
Bug-15157-Update-for-reworked-bug-15156.patch (text/plain), 1.59 KB, created by
Martin Renvoize
on 2021-09-15 14:29:07 UTC
(
hide
)
Description:
Bug 15157: Update for reworked bug 15156
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-09-15 14:29:07 UTC
Size:
1.59 KB
patch
obsolete
>From ff1b3bd12f846bcabf21a9e91965e5c384f2c8af Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 15 Sep 2021 15:27:45 +0100 >Subject: [PATCH] Bug 15157: Update for reworked bug 15156 > >This patch updates the script to use filter_by_amount_owed. > >We could add a series of options to the script to allow more fine >grained control. >--- > misc/debarrBorrowersWithFines.pl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > mode change 100644 => 100755 misc/debarrBorrowersWithFines.pl > >diff --git a/misc/debarrBorrowersWithFines.pl b/misc/debarrBorrowersWithFines.pl >old mode 100644 >new mode 100755 >index fb46a6f351..1cf12d44c4 >--- a/misc/debarrBorrowersWithFines.pl >+++ b/misc/debarrBorrowersWithFines.pl >@@ -60,14 +60,14 @@ elsif (not($file) && not(length($message) > 20)) { > exit 1; > } > >-my $badBorrowers = Koha::Patrons->search->search_patrons_with_unpaid_fines(); >+my $badBorrowers = Koha::Patrons->filter_by_amount_owed( { more_than => 0 } ); > $message = getMessageContent(); > >-foreach my $bb (@$badBorrowers) { >+while (my $bb = $badBorrowers->next ) { > #Don't crash, but keep debarring as long as you can! > eval { > my $success = Koha::Patron::Debarments::AddDebarment({ >- borrowernumber => $bb->{borrowernumber}, >+ borrowernumber => $bb->borrowernumber, > expiration => $expiration, > type => 'MANUAL', > comment => $message, >@@ -88,4 +88,4 @@ sub getMessageContent { > my @msg = <$FH>; > close $FH; > return join("",@msg); >-} >\ No newline at end of file >+} >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15157
:
44643
|
44645
|
44646
|
109220
|
124894
|
124895
|
124896
|
129701
|
129702
|
129703
|
129704
|
130103
|
158288
|
158289
|
158290
|
158291
|
158292
|
158315
|
158316
|
158317
|
158318