Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues
Summary: Add command line script to recalculate existing due dates based on current is...
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-26 16:48 UTC by Kyle M Hall
Modified: 2015-04-09 08:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues (5.54 KB, patch)
2013-02-26 17:11 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues (5.56 KB, patch)
2013-02-26 17:14 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues (5.62 KB, patch)
2013-02-26 17:19 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues (6.35 KB, patch)
2013-02-26 17:43 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-02-26 16:48:16 UTC

    
Comment 1 Kyle M Hall 2013-02-26 17:11:13 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2013-02-26 17:14:04 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2013-02-26 17:19:08 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2013-02-26 17:43:07 UTC
Created attachment 15709 [details] [review]
Bug 9712 - Add command line script to recalculate existing due dates based on current issuing rules and retroactively update the issues

This script can take existing issues and check to see of the due dates
match up with the current issuing rules. If can optionally update the
due dates based on the current issuing rules.

Test Plan:
1) Set an issuing rule
2) Check out an item to a patron where that issuing rules applies
3) Modify the issuing rule's issue length
4) Run migration_tools/recalculate_due_dates.pl -t
5) You should see it list your issue has having a changed due date
6) run migration_tools/recalculate_due_dates.pl -c
7) You should see the due date updated in the database for this issue
Comment 5 Galen Charlton 2013-05-31 03:28:15 UTC
What is the use case you see for this?  Particularly in a production situation, retroactively changing due dates on patrons seems a bit drastic (particularly if the loan period gets shortened).
Comment 6 Kyle M Hall 2013-05-31 14:56:06 UTC
I agree, it is a drastic measure. This action has become necessary where  bugs in Koha have caused loans to have an incorrect due date. Another good case is where a library has incorrectly set up circulation rules and needs to fix their due dates. Often in these cases, the correct due date has been stamped in the book, but the incorrect due date is set in Koha.

(In reply to comment #5)
> What is the use case you see for this?  Particularly in a production
> situation, retroactively changing due dates on patrons seems a bit drastic
> (particularly if the loan period gets shortened).
Comment 7 Galen Charlton 2013-05-31 14:58:51 UTC
(In reply to comment #6)
> I agree, it is a drastic measure. This action has become necessary where 
> bugs in Koha have caused loans to have an incorrect due date. Another good
> case is where a library has incorrectly set up circulation rules and needs
> to fix their due dates. Often in these cases, the correct due date has been
> stamped in the book, but the incorrect due date is set in Koha.

OK, that makes sense.
Comment 8 Marcel de Rooy 2013-09-23 11:14:58 UTC
misc/migration_tools/recalculate_due_dates.pl

DUE DATE ALTERED
ITEM NUMBER:       199709
BORROWER:          1
ITEM TYPE:         EXH
BORROWER CATEGORY: ST
ISSUE DATE:        2013-09-23 12:25:00
OLD DATE DUE:      2013-09-30 23:59:00
NEW DATE DUE:      2013-09-30 23:59:36
*** TEST MODE, DATE DUE NOT UPDATED IN DATABASE ***

UPDATED 1 OF 1 ISSUES


Hey, I did not want to update (so it should not say it updated 1 issue).
And what about the 36 seconds difference in due date?
(I did not change any rule yet.)