Commit 7c3397be authored by bensinober's avatar bensinober Committed by Benjamin
Browse files

DEICH-4196 koha overdue job, improve logging

parent 7d88d0d2
......@@ -72,8 +72,8 @@ sub Run {
my $ct = scalar @{$overdues};
$totalOverdues += $ct;
# Check if we have an overdue that matches this delay trigger, otherwise move to next
my $trigger = grep { $_->{days_overdue} == $rule->{"letter$i"}->{delay} } @{$overdues};
my ($trigger) = grep { $_->{days_overdue} == $rule->{"letter$i"}->{delay} } @{$overdues};
use Data::Dumper; warn Dumper($trigger);
if ($trigger) {
++$triggeredOverdues;
# Send message
......@@ -113,7 +113,8 @@ sub Run {
# Add debarrment
if ($rule->{"letter$i"}->{debar}) {
$self->{writer}->write("Debarring patron " . $patron->{cardnumber} . " for " . $trigger->{days_overdue} . "\n");
$self->{writer}->write(sprintf("Debarring patron %s for barcode %s (%s days overdue)\n", $patron->{cardnumber},
$trigger->{barcode}, $trigger->{days_overdue}));
Koha::Patron::Debarments::AddUniqueDebarment({
borrowernumber => $patron->{borrowernumber},
type => "OVERDUES",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment