When dropbox mode is enabled, if you check in a document with a duedate planned on previous opening day, the patron is restricted nevertheless. Seems that the reason why is that the comparison of dates is made fom current date instead of last opening date. Circulation.pm/AddReturn, ligne 1793 : $issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $today ) == -1 ? 1 : 0;
Created attachment 34137 [details] [review] Bug 12895 repair dropbox mode Dropbox mode as it is will be modified (cf bug 13044) but the problem will have nevertheless to be corrected. This patch can be applied to last version and previous ones. One thing important to be aware of about restriction is that the last restriction day IS NOT included. A patron restricted until such day will be able to borrow again FROM that day. Test plan : 1) choose a borrower and an item and checkout the item selecting the previous opening date in the Specify-due-date box. 2) click on Circulation in the upper manu, then on Checkin and check the Book drop mode. The Book drop date showed should be the previous opening date. 3) Check in the item : you can see that the patron is restricted 4) apply the patch 5) redo 1 to 3 : Now, you can see that the patron is not restricted. 6) If you redo the test with two day late, you will see that the patron is not restricted : that's ok because his restriction of one day is already finished. 7) If you redo the test with more than two day late, you see that the patron restriction is, as expected, one day shorter than it were if the item had been returned without dropbox mode.
I put the importance level to P1 because I thing this problem may be source of litigation with patrons
Is the patch intended for 3.12 or is it also intended for master/3.18?
Yes it's also for 3.18
Test failed. The borrower is never restricted when checking the item with dropbox mode on, whatever the duedate is. We tried with one day late, two days late, 5 days late. It should be useful to precise that the circulation rules must be the same and to check these rules before testing. Kohateam Rennes 2
Very sorry. my fault. My test plan was missing some most important thing. Here's the reason why that doesn't work : you must affect suspension days parameter in the circulation rules (Administration/Circulation and fine rules) matching both borrower and document type you choose for the test. Test plan : 1) choose a borrower and an item 2) Set suspension in the suspension days parameter in the circulation rules (Administration/Circulation and fine rules) matching both borrower and document type 3) Checkout the item selecting the previous opening date in the Specify-due-date box. 4) click on Circulation in the upper menu, then on Checkin and check the Book drop mode. The Book drop date showed should be the previous opening date. 5) Check in the item : you can see that the patron is restricted 6) apply the patch 7) redo 1 to 5 : Now, you can see that the patron is not restricted. 8) If you redo the test with two day late, you will see that the patron is not restricted : that's ok because his restriction of one day is already finished. 9) If you redo the test with more than two day late, you see that the patron restriction is, as expected, one day shorter than it were if the item had been returned without dropbox mode.
(In reply to Koha Team Rennes 2 from comment #5) > Test failed. The borrower is never restricted when checking the item with > dropbox mode on, whatever the duedate is. We tried with one day late, two > days late, 5 days late. > > It should be useful to specify that the circulation rules must be the same > and to check these rules before testing. > > Kohateam Rennes 2
NEW TEST PLAN again (hope that will be the good one) : 1)Check in the calendar (Tools/Calendar), that the previous days you are about to use as date due are realy entered as opening day (never know). 2) Add a suspension in the suspension days parameter of the circulation rules (Administration/Circulation and fine rules) to the MOST specific category of borrower and MOST specific type of document among the existing rules of the LOGGED IN Site(cf explications in the circ-rules page). 3) Choose a borrower using the search by category and an item through the advanced search using the limit by type. 4) Checkout the item selecting the previous opening date in the Specify-due-date box. 5) Click on Circulation in the upper menu, then on Checkin and check the Book drop mode. The Book drop date showed should be the previous opening date. 6) Check in the item : you can see that the patron is restricted 7) apply the patch 8) Redo 1 to 5 : Now, you can see that the patron is not restricted. 9) If you redo the test with two day late, you will see that the patron is not restricted : that's ok because his restriction of one day is already finished. 10) If you redo the test with more than two day late, you see that the patron restriction is, as expected, one day shorter than it were if the item had been returned without dropbox mode. Olivier Crouzet
Created attachment 34693 [details] [review] [SIGNED OFF]Bug 12895 repair dropbox mode One day late patrons were restricted even with dropbox mode activated Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
I understand this is a bad bug for libraries using fine days, so I am going to pass QA. But I also feel we need more unit tests for AddReturns - it would be great to see a regression test for this added on a separate bug report. I tried t/db_dependent/Circulation/Returns.t, but it currently fails on master for me. t/db_dependent/Circulation_issue.t (see bug 13494)
Created attachment 34716 [details] [review] [PASSED QA] Bug 12895 repair dropbox mode One day late patrons were restricted even with dropbox mode activated 1) Check in the calendar (Tools/Calendar), that the previous days you are about to use as date due are really entered as opening day (never know). 2) Add a suspension in the suspension days parameter of the circulation rules (Administration/Circulation and fine rules) to the MOST specific category of borrower and MOST specific type of document among the existing rules of the LOGGED IN Site(cf explications in the circ-rules page). 3) Choose a borrower using the search by category and an item through the advanced search using the limit by type. 4) Checkout the item selecting the previous opening date in the Specify-due-date box. 5) Click on Circulation in the upper menu, then on Checkin and check the Book drop mode. The Book drop date showed should be the previous opening date. 6) Check in the item : you can see that the patron is restricted 7) apply the patch 8) Redo 1 to 5 : Now, you can see that the patron is not restricted. 9) If you redo the test with two day late, you will see that the patron is not restricted : that's ok because his restriction of one day is already finished. 10) If you redo the test with more than two day late, you see that the patron restriction is, as expected, one day shorter than it were if the item had been returned without dropbox mode. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patch pushed to master. Thanks Koha Team Lyon 3!
Pushed to 3.18.x will be in 3.18.3
Pushed to 3.16.x, will be in 3.16.7