A new column issuingrules.no_auto_renewal_after_hard_limit will allow to restrict the auto renewals based on a specific date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday.
Created attachment 50676 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 50677 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Created attachment 50725 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Created attachment 53428 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 53429 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Created attachment 53430 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Applying: Bug 16344: Add a circ rule to limit the auto renewals given a specific fatal: sha1 information is lacking or useless (C4/Circulation.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 16344: Add a circ rule to limit the auto renewals given a specific :(
(In reply to Liz Rea from comment #7) > Applying: Bug 16344: Add a circ rule to limit the auto renewals given a > specific > fatal: sha1 information is lacking or useless (C4/Circulation.pm). > Repository lacks necessary blobs to fall back on 3-way merge. > Cannot fall back to three-way merge. > Patch failed at 0001 Bug 16344: Add a circ rule to limit the auto renewals > given a specific > > :( It applies cleanly on top of bug 15581. Please try again.
First I successfully applied bug 15581: vagrant@kohadevbox:kohaclone(003)$ git bz apply 15581 ... Applying: Bug 15581: Add a circ rule to limit the auto renewals given a delay Applying: Bug 15581: Display the latest auto renew date possible when renewing manually Applying: Bug 15581: Display the generic "schedule for auto renew" message on the checkouts table Applying: Bug 15581: [DO NOT PUSH] Schema changes Then I tried to apply bug 16344 but this failed with the same message as given by Liz Rea: vagrant@kohadevbox:kohaclone(003)$ git bz apply 16344 ... Applying: Bug 16344: Add a circ rule to limit the auto renewals given a specific fatal: sha1 information is lacking or useless (C4/Circulation.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 16344: Add a circ rule to limit the auto renewals given a specific ...
Created attachment 56616 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 56617 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Created attachment 56618 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Patches rebased.
According to the test plan I did the following. I successfully applied patches 15581 and 16344. 0) I executed the update DB entry vagrant@kohadevbox:kohaclone(003)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl installer/data/mysql/updatedatabase.pl DEV atomic update: bug_15581.sql DEV atomic update: bug_16344.sql 1) In Koha menu "Administration > Circulation and fine rules" I defined a rule for all categories and all item types: * Renewals allowed (count): 3 * No automatic renewal after (hard limit): 20/10/2016 Then I checked out the item with number 1 (otherwise it couldn't be updated with following statement). 2) I modified the table "issues" with issuedate two days before as followes: UPDATE issues SET issuedate = "2016-10-17 22:48:00" WHERE itemnumber=1; 3) I executed the renewals cronjob script as follows: vagrant@kohadevbox:kohaclone(003)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ misc/cronjobs/automatic_renewals.pl I cannot confirm that the issue has been renewed. Instead, nothing has changed.
Created attachment 56750 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 56751 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Created attachment 56752 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
According to the test plan I did the following. I successfully applied patches 15581 and 16344. 0) I executed the update DB entry vagrant@kohadevbox:kohaclone(002)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl installer/data/mysql/updatedatabase.pl DEV atomic update: bug_15581.sql DEV atomic update: bug_16344.sql 1) In Koha menu "Administration > Circulation and fine rules" I defined a rule for all categories and all item types: * Renewals allowed (count): 3 * No automatic renewal after (hard limit): 27/10/2016 Then I checked out the item with number 1 (otherwise it couldn't be updated with following statement). 2) I modified the table "issues" with issuedate two days before as followes: UPDATE issues SET issuedate = "2016-10-24 14:48:00" WHERE itemnumber=1; 3) I executed the renewals cronjob script as follows: vagrant@kohadevbox:kohaclone(002)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ misc/cronjobs/automatic_renewals.pl I still cannot confirm that the issue has been renewed. Instead, nothing has changed (the due date is still set to 25/10/2016).
(In reply to Michael Kuhn from comment #18) > I still cannot confirm that the issue has been renewed. Instead, nothing has > changed (the due date is still set to 25/10/2016). Check your issuing rules: SELECT issuelength, lengthunit, renewalperiod FROM issuingrules;
mysql> SELECT issuelength, lengthunit, renewalperiod FROM issuingrules; +-------------+------------+---------------+ | issuelength | lengthunit | renewalperiod | +-------------+------------+---------------+ | NULL | days | 0 | +-------------+------------+---------------+ These are the standard values in the kohadevbox. Should I set these to different values? Which are these?
(In reply to Michael Kuhn from comment #20) > mysql> SELECT issuelength, lengthunit, renewalperiod FROM issuingrules; > +-------------+------------+---------------+ > | issuelength | lengthunit | renewalperiod | > +-------------+------------+---------------+ > | NULL | days | 0 | > +-------------+------------+---------------+ > > These are the standard values in the kohadevbox. Should I set these to > different values? Which are these? Yes, the issuelength and renewalperiod should be defined and set to something > 0
According to the test plan I did the following. I successfully applied patches 15581 and 16344. 0) I executed the update DB entry vagrant@kohadevbox:kohaclone(002)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl installer/data/mysql/updatedatabase.pl DEV atomic update: bug_15581.sql DEV atomic update: bug_16344.sql 1) In Koha menu "Administration > Circulation and fine rules" I defined a rule for all categories and all item types: * Loan period: 3 * Unit: days * Renewals allowed (count): 3 * Renewal period: 5 * No automatic renewal after (hard limit): 27/10/2016 Then I checked out the item with number 1 (otherwise it couldn't be updated with following statement). It gets the due date of 29/10/2016. 2) I modified the table "issues" with issuedate two days before as followes: UPDATE issues SET issuedate = "2016-10-24 14:00:00" WHERE itemnumber=1; 3) I executed the renewals cronjob script as follows: vagrant@kohadevbox:kohaclone(002)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ misc/cronjobs/automatic_renewals.pl Still I cannot confirm that the issue has been renewed. Instead, nothing has changed and the due date is still set to 29/10/2016.
(In reply to Michael Kuhn from comment #22) > Still I cannot confirm that the issue has been renewed. Instead, nothing has > changed and the due date is still set to 29/10/2016. If the due date is in the future, why do you want the issue to be renewed automatically? :)
Well, the test plan didn't say it can not be in the future... However as I know from my library days it is usual that users lend a book and they renew it as soon as possible, so they can keep it longer. Usually this is possible.
OK, in the case I described the issue is usually not renewed automatically. I'll try again on 29/10/2016.
Today I executed the renewals cronjob script again as follows: vagrant@kohadevbox:kohaclone(002)$ sudo koha-shell kohadev kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ misc/cronjobs/automatic_renewals.pl Still I cannot confirm that the issue has been renewed. Instead, nothing has changed and the due date is still set to 29/10/2016. I will now definitely stop testing this case because it takes me far too much time for no result at all. I hope someone with better knowledge can successfully sign this off.
Created attachment 56977 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Hi, I've just signed this off using our Sandbox. My testing plan as follows: Test plan: 0) I executed the update DB entry 1) I defined a rule with no_auto_renewal_after_hard_limit set to tomorrow 01/11/2016 2) I modified issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "2016-10-29 23:59:00" WHERE itemnumber = '6'; For my test the due date = 2016-11-01 (ie. due tomorrow). With this example it is also necessary to set a No renewal before value - e.g. 1 day in the Circulation rule - to allow the item to be autorenewed 1 day before it is due. 3) I ran the misc/cronjobs/automatic_renewals.pl I confirmed that the issue is renewed until 22/11/2016 (following 21 days in the Circulation rule) 4) I modified the no_auto_renewal_after_hard_limit and set it to yesterday 30/10/2016 5) I ran the misc/cronjobs/automatic_renewals.pl This time the issue has not been renewed - in the staff client the Renew column displays: "Can no longer be auto-renewed - number of checkout days exceeded"
Created attachment 57735 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 57736 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Created attachment 57737 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Created attachment 61074 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed
Created attachment 61075 [details] [review] Bug 16344: Fix alignment between top and bottom columns
Created attachment 61076 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes
Created attachment 61511 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Created attachment 61512 [details] [review] Bug 16344: Fix alignment between top and bottom columns Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Created attachment 61513 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com>
Acting as git gopher for Jonathan Field and Janet McGowan again here, they did the actual testing and signoff.
Created attachment 62820 [details] [review] Bug 16344: Add a circ rule to limit the auto renewals given a specific This patch adds a new circulation rule (no_auto_renewal_after_hard_limit) to block/allow auto renewals after a given date. The idea is to stop renewals at a given date. That way the library will have time to send overdues and get the books back before the students do on holiday. Test plan: 0/ Execute the update DB entry 1/ Define a rule with no_auto_renewal_after_hard_limit set to tomorrow 2/ Modify the issues.issuedate, to simulate a checkout in the past: UPDATE issues SET issuedate = "yyyy-mm-dd hh:mm:ss" WHERE itemnumber = YOUR_ITEMNUMBER; with issuedate = 2 days before for instance 3/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has been renewed 4/ Modify the no_auto_renewal_after_hard_limit and set it to yesterday 5/ Execute the automatic renewals cronjob script (misc/cronjobs/automatic_renewals.pl) Confirm that the issue has not been renewed Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 62821 [details] [review] Bug 16344: Fix alignment between top and bottom columns Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 62822 [details] [review] Bug 16344: [DO NOT PUSH] Schema changes Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> Signed-off-by: Janet McGowan <janet.mcgowan@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 17.05, thanks Jonathan!
This won't get ported back to 16.11.x as it is an enhancement.
Created attachment 63707 [details] [review] Bug 16344: Fix test in GetHardDueDate.t
(In reply to Jonathan Druart from comment #44) > Created attachment 63707 [details] [review] [review] > Bug 16344: Fix test in GetHardDueDate.t Pushed to master