From 6521cd866755078ffac26a4cd0e9c2be59acd912 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 8 Feb 2018 06:39:39 -0500 Subject: [PATCH] Bug 12812: Longoverdue.pl --mark-returned doesn't return items The longoverdue.pl option --mark-returned doesn't work unless the --charge option is used as well. Test Plan: 1) Run long overdue with --mark-returned and not --charge, note your items are marked lost but not returned 2) Apply this patch 3) Repeat step 1, the items should now get returned! Tested with (for example): misc/cronjobs/longoverdue.pl --lost 10=1 --mark-returned --verbose --confirm Signed-off-by: Josef Moravec --- misc/cronjobs/longoverdue.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index 7ff8826..4fecb3b 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -309,7 +309,12 @@ foreach my $startrange (sort keys %$lost) { printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose); if($confirm) { ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'}); - LostItem($row->{'itemnumber'}, $mark_returned) if( $charge && $charge eq $lostvalue); + if ( $charge && $charge eq $lostvalue ) { + LostItem( $row->{'itemnumber'}, $mark_returned ); + } elsif ( $mark_returned ) { + my $patron = Koha::Patrons->find( $row->{borrowernumber} ); + MarkIssueReturned($row->{borrowernumber},$row->{itemnumber},undef,undef,$patron->privacy) + } } $count++; } -- 2.1.4