From 54a294571ffc2c9fc0edccba448cf67133205658 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 Signed-off-by: Julian Maurice Signed-off-by: Nick Clemens (cherry picked from commit 93c5c8e4c85ed3330184de2c6ea06ab73803656b) Signed-off-by: Fridolin Somers --- 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 a0907a2f2b..23fe27a6b6 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -308,7 +308,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.39.5