Circulation renewals near the due date should be extended

Bug #1891369 reported by Jason Boyer
52
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

Currently if a circ is renewed (for example) during day 13 of a 14 day checkout the new due date will be 14 days from *now* rather than 14 days from the due date, thus "losing" 1 day of the patron's renewal. There should be a threshold after which the new circulation period is added to the previous circ's due date rather than the current time. (Similar to the threshold proposed in bug 1516101.)

In addition to letting patrons renew items slightly earlier in the opac without losing days, this would allow autorenewals to be run 1-2 days before items are due rather than the morning of (the current default). Then users would have more time to react to the success / failure notices.

Revision history for this message
Terran McCanna (tmccanna) wrote :

We get this request a lot

tags: added: circulation
Revision history for this message
Bill Erickson (berick) wrote :

Preference for Org Unit Settings vs. changes to config.circ_matrix_matchpoint?

Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Terran McCanna (tmccanna) wrote :

Would adding it to config.circ_matrix_matchpoint allow it to have different settings depending on the circulation modifier?

We'd love to have this work for types of items that have normal (2 week for us) circulation periods, but probably not for items that have very short circulation periods. In addition, it would ideally prevent them from renewing immediately after checking an item out to prevent them from gaming the system to get 6-week checkout periods.

Revision history for this message
Jason Boyer (jboyer) wrote :

I'm thinking ccmm may be where this needs to go.

What brings me there are things like combinations of 3-day (or hourly, etc.) circ durations, "normal" 2-3 week durations, and things like classroom collections that might be out for multiple months. The short ones likely wouldn't be allowed to extend their circ periods, the normal may be best served at 2-3 days, and for multiple month circs libraries may allow 1-2 weeks or not at all, because they've been out for so long. That's a lot to try to wedge into an OUS.

Revision history for this message
Bill Erickson (berick) wrote :
tags: added: pullrequest
Revision history for this message
Bill Erickson (berick) wrote :

Agreed the matchpoint option gives us a lot more flexibility. I'll rework my patch to do that instead.

Thanks for the feedback!

Revision history for this message
Bill Erickson (berick) wrote :
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Jason Boyer (jboyer) wrote :

That looks great Bill. One piece of feedback I'd give before even testing it is that if it's applied to ccmm it will likely be easier for staff to just set an explicit duration rather than a percentage. Otherwise they'll have to figure out things like "what percentage of 2 weeks is 2 days" which the backend will then have to turn back into a duration anyway for comparison. :)

Revision history for this message
Bill Erickson (berick) wrote :

Thanks, Jason. Agreed that would simplify the logic and the code. I'll make that change.

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Commit pushed to same branch to use interval-based logic instead of duration percentage.

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

I've done some testing on this using both daily and hourly due dates, and the mechanics of it are working well.

I did run into this situation, though:

With the following circulation policy:

Duration Rule 1_hour_2_renew
Early Renewal Extends Due Date = TRUE
Early Renewal Minimum Duration Interval = 30 minutes

I did the following actions for an item:

Checkout at 11:13am, due date 12:13pm
Renew at 11:17am, due date 12:17pm
Renew at 11:57am, due date 1:17pm
Renew at 11:58am, due date 12:58pm

So the final renewal resulted in an earlier due date. This also translates to daily circs. For example, with a circ policy:

Duration Rule 7_days_2_renew
Early Renewal Extends Due Date = TRUE
Early Renewal Minimum Duration Interval = 5 days

Checkout on 8/11, due 8/18
Renew on 8/14, due 8/25
Renew on 8/14, due 8/21

I know related bug 1516101 proposes preventing "too early" renewals, but it would still make more practical sense if the renewal due date was never allowed to be earlier than the current due date.

Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Revision history for this message
Jason Boyer (jboyer) wrote :

Hi Michele. That is a reasonable fix to request but I'm not sure if this is the bug to handle that in. The same situation can pop up now if staff set a specific due date beyond the normal duration that would be returned for that user/item and the circ is renewed right after.

Following your example:
Checkout on 8/11, staff set due date to 8/30 for whatever reason
Renew on 8/14, due on 8/21

Since changing this would affect all circs I think it's worth a new bug to make sure the goal and scope are clear.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Thanks for the feedback, Jason!

We used to have a library that had a renewal duration shorter than the initial checkout duration, so we have seen occasional cases where a patron would renew early, intentionally or accidentally, and would be surprised by a due date earlier than the initial one.

Though I think it's appropriate to ensure that no renewal should ever get a due date earlier than the parent circ, and I'm willing to open another bug, I was thinking that the current due date could be a factor in the calculation of the new due date for circs where renew_extends_due_date is True.

Early renewals happen frequently, and I don't think we would implement this feature until we could be sure that patrons couldn't inadvertently chop off the ends of their loan periods when renewing early.

Revision history for this message
Galen Charlton (gmc) wrote :

I agree with Michele - it might be too time-consuming to handle all possible cases of due date regression upon renewal now, but it seems like it would be straightforward to avoid that in the renew_extends_due_date case.

That said, I would also lobby for attention to be paid sooner rather than later on the general issue - that just strikes me as really counterintuitive for patrons for a renewal to every regress the due date.

Revision history for this message
Joan Kranich (jkranich) wrote :

With the proper values set in the Early Renewal Extends Due Date and Early Renewal Minimum Duration Interval, do we expect a renewal done on the same day as the checkout for a daily loan period to extend the due date? I'm not finding that it does and I want to confirm the expected behavior.

Revision history for this message
Tiffany Little (tslittle) wrote :

The branch in comment #7 currently does not merge cleanly onto master.

Revision history for this message
Bill Erickson (berick) wrote :

I'll rebase the branch and add the logic to prevent a due date getting set that's earlier than the existing due date.

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
milestone: none → 3.9-beta
Revision history for this message
Blake GH (bmagic) wrote :

Noting that there is a merge conflict for e787ca0a58fe3e018053c848f6f2cf73a6d36b00

Revision history for this message
Bill Erickson (berick) wrote :
Changed in evergreen:
milestone: 3.9-beta → 3.next
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

We have been using this in production for a few weeks with success.

Changed in evergreen:
milestone: 3.next → 3.10-beta
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Gina Monti (gmonti90) wrote :

Bug Squash 7/2022

I tried to renew on Terran's test server of copies checked out and due only a couple days in advance, but the due date never changes.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Gina, I'm testing in BR1, so if you are logged into a BR1 workstation, there is currently a 1 hour circulation policy set.

Revision history for this message
Michele Morgan (mmorgan) wrote :

Tested this for Bug Squashing Week in terran-master.gapines.org.

With the latest patch, early renewals can no longer regress a due date. In the previous test cases where the due date regressed, the current due date for the checkout is retained.

Tested using daily loan durations and hourly loan durations and results were as expected.

Also tested the situation in Joan's comment #15 and found that with Early Renewal Extends Due Date enabled and Early Renewal Minimum Duration Interval UNset, a renewal done on the same day as the checkout DOES extend the due date as I would expect.

I'm adding my signoff, but just want to note that administrators need to be mindful when setting up or altering policies since the single Early Renewal Minimum Duration Interval applies to all three durations (which could be different) in the duration rule linked to the policy.

Here's my signoff:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1891369-renewal-extend-due-date-signoff

user/mmorgan/lp1891369-renewal-extend-due-date-signoff

tags: added: signedoff
Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed for inclusion in 3.10. Thanks, Bill and Michele!

Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.