|
Lines 60-73
elsif (not($file) && not(length($message) > 20)) {
Link Here
|
| 60 |
exit 1; |
60 |
exit 1; |
| 61 |
} |
61 |
} |
| 62 |
|
62 |
|
| 63 |
my $badBorrowers = Koha::Patrons->search->search_patrons_with_unpaid_fines(); |
63 |
my $badBorrowers = Koha::Patrons->filter_by_amount_owed( { more_than => 0 } ); |
| 64 |
$message = getMessageContent(); |
64 |
$message = getMessageContent(); |
| 65 |
|
65 |
|
| 66 |
foreach my $bb (@$badBorrowers) { |
66 |
while (my $bb = $badBorrowers->next ) { |
| 67 |
#Don't crash, but keep debarring as long as you can! |
67 |
#Don't crash, but keep debarring as long as you can! |
| 68 |
eval { |
68 |
eval { |
| 69 |
my $success = Koha::Patron::Debarments::AddDebarment({ |
69 |
my $success = Koha::Patron::Debarments::AddDebarment({ |
| 70 |
borrowernumber => $bb->{borrowernumber}, |
70 |
borrowernumber => $bb->borrowernumber, |
| 71 |
expiration => $expiration, |
71 |
expiration => $expiration, |
| 72 |
type => 'MANUAL', |
72 |
type => 'MANUAL', |
| 73 |
comment => $message, |
73 |
comment => $message, |
|
Lines 88-91
sub getMessageContent {
Link Here
|
| 88 |
my @msg = <$FH>; |
88 |
my @msg = <$FH>; |
| 89 |
close $FH; |
89 |
close $FH; |
| 90 |
return join("",@msg); |
90 |
return join("",@msg); |
| 91 |
} |
91 |
} |
| 92 |
- |
|
|