Bug 12812 - Longoverdue.pl --mark-returned doesn't return items
Summary: Longoverdue.pl --mark-returned doesn't return items
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 13589
  Show dependency treegraph
 
Reported: 2014-08-24 20:19 UTC by Katrin Fischer
Modified: 2018-04-10 07:36 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 12812 - Longoverdue.pl --mark-returned doesn't return items (1.66 KB, patch)
2018-02-08 11:41 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12812: Longoverdue.pl --mark-returned doesn't return items (1.82 KB, patch)
2018-03-09 06:52 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 12812: (Follow-up) Fix use of C4::Circulation (863 bytes, patch)
2018-03-09 06:52 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 12812: Longoverdue.pl --mark-returned doesn't return items (1.88 KB, patch)
2018-03-09 12:14 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 12812: (Follow-up) Fix use of C4::Circulation (930 bytes, patch)
2018-03-09 12:14 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2014-08-24 20:19:32 UTC
When testing bug 12467 I foudn that the --mark-returned flag didn't return the items as it was supposed to. The items got marked lost, but remained on the patron's account.
Comment 1 Jonathan Druart 2015-07-15 11:26:19 UTC
How do you launch the cronjob?
It seems that the --charge option is required (or the pref) to mark the item as returned.

I don't understand the following code:
185    ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
186    LostItem($row->{'itemnumber'}, $mark_returned) if( $charge && $charge eq $lostvalue);

If the charge and the lostvalue don't match, the item won't be marked as returned, so if it needs to be marked as returned, we should move the MarkIssueReturned from the LostItem subroutine.
Comment 2 Kyle M Hall 2018-02-08 11:41:59 UTC
Created attachment 71336 [details] [review]
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!
Comment 3 Josef Moravec 2018-03-09 06:52:31 UTC
Created attachment 72544 [details] [review]
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 <josef.moravec@gmail.com>
Comment 4 Josef Moravec 2018-03-09 06:52:34 UTC
Created attachment 72545 [details] [review]
Bug 12812: (Follow-up) Fix use of C4::Circulation

Fixes this error:
Undefined subroutine &main::MarkIssueReturned called at
misc/cronjobs/longoverdue.pl line 316.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Julian Maurice 2018-03-09 12:14:36 UTC
Created attachment 72564 [details] [review]
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 <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 6 Julian Maurice 2018-03-09 12:14:40 UTC
Created attachment 72565 [details] [review]
Bug 12812: (Follow-up) Fix use of C4::Circulation

Fixes this error:
Undefined subroutine &main::MarkIssueReturned called at
misc/cronjobs/longoverdue.pl line 316.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 7 Nick Clemens 2018-03-15 09:20:51 UTC
Pushed to master for 18.05, thanks to all for your hard work.
Comment 8 Nick Clemens 2018-04-06 17:52:56 UTC
Awesome work all, backported to stable for 17.11.05
Comment 9 Fridolin SOMERS 2018-04-10 07:36:24 UTC
Pushed to 17.05.x for v17.05.11