Closed taskula closed 2 years ago
The renew screen looks fine and the comment is saved as expected. But in my testing, the illrequestattributes due_date_guar and due_date_max are not updated. And I do not see a mention of the date_due_period in the new code. Am I missing something because I'm not testing on top of #112?
But in my testing, the illrequestattributes due_date_guar and due_date_max are not updated
Fixed by 77b06bb
And I do not see a mention of the date_due_period in the new code. Am I missing something because I'm not testing on top of https://github.com/Libriotech/koha-illbackend-libris/pull/112?
No, you are not missing anything. I forgot to use the new configuration variable. Fixed by 205e1b9.
Sorry, one more thing... It looks like only one of due_date_guar and due_date_max is updated in the illrequestattributes table? Both of them should be updated from the respective fields in the "renew" screen. Then illrequests.date_due should be updated with the value from either due_date_guar or due_date_max, depending on the due_date_period config variable.
Adding the datepicker to the date fields is a very nice touch, but it looks like it is missing some conversion between the date format in Koha and the internal YYYY-MM-DD format. I see "02/24/2022" in the form, and that is also stored in the database:
> select * from illrequestattributes where illrequest_id = 789 and type in ( 'due_date_guar','due_date_max' );
+---------------+---------------+------------+----------+
| illrequest_id | type | value | readonly |
+---------------+---------------+------------+----------+
| 789 | due_date_guar | 02/24/2022 | 1 |
| 789 | due_date_max | 2022-12-24 | 1 |
+---------------+---------------+------------+----------+
Sorry, one more thing... It looks like only one of due_date_guar and due_date_max is updated in the illrequestattributes table? Both of them should be updated from the respective fields in the "renew" screen. Then illrequests.date_due should be updated with the value from either due_date_guar or due_date_max, depending on the due_date_period config variable.
Thanks for noticing this. I can reproduce it. I've created a new subroutine Base::_save_due_date() that now centralizes saving and formatting due dates for both receive() and renew() steps. So for a complete test, please also test receival. It now updates both fields in illrequestattributes.
Format "yyyy-mm-dd" (DateTime->ymd()) is now used for both illrequestattributes due_date_guar and max as well as illrequests.date_due.
One small thing missing when I test receiving now: It looks like illrequests.date_due is not set?
It looks like store() was missing.
All good now! Thanks for all your fixes!
When you click on "Manage request" and go to e.g. cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=782 a new button "Renew" should be shown, if the illrequest has a status of "Inåln Utlånad" (on loan, IN_UTL).
Clicking on "Renew" should take the user to a new screen, showing -- basic details about the ill (title, author, order ID) -- fields for guaranteed and max loan time (similar to the receive screen) -- a text field for comments -- a button called "Save"
Clicking on "Save" should do the following: -- the issue/loan should be renewed, and the loan time extended to the date given for guaranteed or max loan time in the form, based on the same config variable we discussed earlier, in connection with (a) -- the values for guaranteed and max loan time (due_date_guar and due_date_max inm the illrequestattributes table) should be updated with the new values from the form -- the comment should be saved in the illcomments table, connected to the borrowernumber of the librarian who did the update