Bug 37189

Summary: Renewals: Koha prioritizes hard due date from circulation rules over manual due date, although the manual due date is earlier
Product: Koha Reporter: Isabel Pineda <isabel.pineda>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: RESOLVED WORKSFORME QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: david, emily.lamancusa, gmcharlt, kyle.m.hall
Version: 24.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 37332    
Bug Blocks:    

Description Isabel Pineda 2024-06-25 21:15:20 UTC
I wrote this comment last week in Bug 36393, but I am not sure if this bug is still being attended, so I decided to file a new bug. Please delete it if it is duplicated: 

After updating from version 23.11 to 24.05, the renewal for a specific date is not working anymore. Although I give a specific date for a specific renewal, the system takes automatically the hard due date from the circulation rules. 

e.g.
In "Administration > Circulation rules" I save "15.08.2024" as hard due date for a specific item type and patron category.
Then I go to one patron of the above category to renew his borrowed items, and manually select "30.07.2024" as due date.
-> The system renews the items until 15.08.24. It ought to prioritize the manual due date for this specific patron.
Comment 1 Emily Lamancusa (emlam) 2024-07-30 15:36:32 UTC
Hi Isabel, can you double-check if you're on version 24.05.00, 24.05.01, or 24.05.02? The version number should be displayed in the bottom-right of Koha's home screen.
Comment 2 Isabel Pineda 2024-07-30 16:25:04 UTC
I'm on 24.05.02. I filed the bug when I was still on 24.05.01. Today I updated to 24.05.02, but it is still not working.
Comment 3 Emily Lamancusa (emlam) 2024-07-30 20:54:03 UTC
I can't seem to reproduce the problem on 24.05.02. Are you renewing the item by scanning it into the checkout field with the "Specify due date" option, or by using the Renew buttons and Renewal due date field below the patron's Checkouts table? Can you give us an example of what values you have set in the Circulation rules for:
Hard due date
Decreased loan period for high holds (day)
Renewals allowed (count)
Renewal period
No renewal before
Comment 4 Isabel Pineda 2024-07-30 21:10:51 UTC
Ok, there seems to be a new error since the update to 24.05.02: When I try to go to the page Administration > Circulation Rules, I get a 500 error. The log file says: 
[Tue Jul 30 15:01:44.055849 2024] [cgi:error] [pid 1353630] [client 190.5.137.178:39567] AH01215: Template process failed: undef error - Can't call method "description" on an undefined value at /usr/share/koha/lib/Koha/Template/Plugin/Categories.pm line 39.: /usr/share/koha/intranet/cgi-bin/admin/smart-rules.pl, referer: https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/admin/admin-home.pl
I will file a new bug for this error.

The setting was like this: For the patron category "Teacher" I have a hard due date as of 06.06.2025 (this is the end of the new school year). When I go to the register of a specific teacher and check one of his books for Renewal and choose, for example, August 15 2025 as the renewal date, when I press "Renew selected items", this item gets renewed until 06.06.2025.

I am using Koha in Spanish, maybe this has something to do with it?
Comment 5 Isabel Pineda 2024-08-12 14:10:42 UTC
(In reply to Isabel Pineda from comment #4)
> Ok, there seems to be a new error since the update to 24.05.02: When I try
> to go to the page Administration > Circulation Rules, I get a 500 error. The
> log file says: 
> [Tue Jul 30 15:01:44.055849 2024] [cgi:error] [pid 1353630] [client
> 190.5.137.178:39567] AH01215: Template process failed: undef error - Can't
> call method "description" on an undefined value at
> /usr/share/koha/lib/Koha/Template/Plugin/Categories.pm line 39.:
> /usr/share/koha/intranet/cgi-bin/admin/smart-rules.pl, referer:
> https://biblioteca-intra.ds.edu.sv/cgi-bin/koha/admin/admin-home.pl
> I will file a new bug for this error.
> 
> The setting was like this: For the patron category "Teacher" I have a hard
> due date as of 06.06.2025 (this is the end of the new school year). When I
> go to the register of a specific teacher and check one of his books for
> Renewal and choose, for example, August 15 2025 as the renewal date, when I
> press "Renew selected items", this item gets renewed until 06.06.2025.
> 
> I am using Koha in Spanish, maybe this has something to do with it?


Ok, after resolving the 500 error, the renewals seem to be working normally again. Thank you.
Comment 6 Emily Lamancusa (emlam) 2024-08-12 17:53:50 UTC
(In reply to Isabel Pineda from comment #5)
> Ok, after resolving the 500 error, the renewals seem to be working normally
> again. Thank you.

Glad to hear it!