Created attachment 15706 [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
Created attachment 15707 [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
Created attachment 15708 [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
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
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).
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).
(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.
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.)