Bug 30331 - Allow RenewalPeriodBase behavior to differ between manual and automatic renewals
Summary: Allow RenewalPeriodBase behavior to differ between manual and automatic renewals
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on: 40969
Blocks:
  Show dependency treegraph
 
Reported: 2022-03-22 12:33 UTC by Andrew Fuerste-Henry
Modified: 2025-10-10 18:08 UTC (History)
7 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Crowdfunding goal: 0
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref (8.99 KB, patch)
2025-10-07 15:54 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Implement manual and automatic renewal base period (2.34 KB, patch)
2025-10-07 18:07 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Unit tests (6.74 KB, patch)
2025-10-07 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Update system preference descriptions (3.18 KB, patch)
2025-10-07 21:06 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref (8.99 KB, patch)
2025-10-10 18:05 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Implement manual and automatic renewal base period (2.34 KB, patch)
2025-10-10 18:05 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Unit tests (6.39 KB, patch)
2025-10-10 18:05 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Update system preference descriptions (3.18 KB, patch)
2025-10-10 18:05 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref (9.05 KB, patch)
2025-10-10 18:08 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 30331: Implement manual and automatic renewal base period (2.39 KB, patch)
2025-10-10 18:08 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 30331: Unit tests (6.45 KB, patch)
2025-10-10 18:08 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 30331: Update system preference descriptions (3.24 KB, patch)
2025-10-10 18:08 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2022-03-22 12:33:29 UTC
We should have a way to make auto-renewals and manual renewals follow different RenewalPeriodBase behavior.

I'm working with a library that uses a mix of manual and automatic renewals. For items that auto-renew, the renewal happens two days before the item is due, so they want RenewalPeriodBase set to add time on to the existing due date so the patron gets their full renewal period. But for items renewed manually, they want RenewalPeriodBase set to calculate from the renewal date, though, so patrons can't renew early and lock in extra time with the item.
Comment 1 Lucas Gass (lukeg) 2025-10-07 15:54:04 UTC
Created attachment 187537 [details] [review]
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref
Comment 2 Lucas Gass (lukeg) 2025-10-07 18:07:37 UTC
Created attachment 187543 [details] [review]
Bug 30331: Implement manual and automatic renewal base period

To test:

1. APPLY PATCH, updatedatabase, restart_all
2. Go to your circulation rules and do the following:
    -Automatic renewal: Yes
    -No renewal before: 5
    -No automatic renewal before: 5
    -Renewal period: 5

3. Set ManualRenewalPeriodBase to "the old due date of the checkout".
4. Set  AutomaticRenewalPeriodBase to "current date".

5. Check out an item and set the due date to 2 days from today
6. Attempt to manually renewal the item.
7. Notice the new date is calculated based on the old checkout date.
8. Check out an item another item and set the due date to 2 days from today.
9. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
10. Notice the new date is calculated based on the current date.

11. Set ManualRenewalPeriodBase to "current date".
12. Set  AutomaticRenewalPeriodBase to "the old due date of the checkout".

13. Check out an item and set the due date to 2 days from today
14. Attempt to manually renewal the item.
15. Notice the new date is calculated based on the current date.
16. Check out an item another item and set the due date to 2 days from today.
17. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
18. Notice the new date is calculated based on the old checkout date.
Comment 3 Lucas Gass (lukeg) 2025-10-07 20:53:20 UTC
Created attachment 187552 [details] [review]
Bug 30331: Unit tests
Comment 4 Lucas Gass (lukeg) 2025-10-07 21:06:44 UTC
Created attachment 187553 [details] [review]
Bug 30331: Update system preference descriptions
Comment 5 Lucas Gass (lukeg) 2025-10-10 18:05:37 UTC
Created attachment 187757 [details] [review]
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref
Comment 6 Lucas Gass (lukeg) 2025-10-10 18:05:40 UTC
Created attachment 187758 [details] [review]
Bug 30331: Implement manual and automatic renewal base period

To test:

1. APPLY PATCH, updatedatabase, restart_all
2. Go to your circulation rules and do the following:
    -Automatic renewal: Yes
    -No renewal before: 5
    -No automatic renewal before: 5
    -Renewal period: 5

3. Set ManualRenewalPeriodBase to "the old due date of the checkout".
4. Set  AutomaticRenewalPeriodBase to "current date".

5. Check out an item and set the due date to 2 days from today
6. Attempt to manually renewal the item.
7. Notice the new date is calculated based on the old checkout date.
8. Check out an item another item and set the due date to 2 days from today.
9. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
10. Notice the new date is calculated based on the current date.

11. Set ManualRenewalPeriodBase to "current date".
12. Set  AutomaticRenewalPeriodBase to "the old due date of the checkout".

13. Check out an item and set the due date to 2 days from today
14. Attempt to manually renewal the item.
15. Notice the new date is calculated based on the current date.
16. Check out an item another item and set the due date to 2 days from today.
17. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
18. Notice the new date is calculated based on the old checkout date.
Comment 7 Lucas Gass (lukeg) 2025-10-10 18:05:44 UTC
Created attachment 187759 [details] [review]
Bug 30331: Unit tests
Comment 8 Lucas Gass (lukeg) 2025-10-10 18:05:48 UTC
Created attachment 187760 [details] [review]
Bug 30331: Update system preference descriptions
Comment 9 Andrew Fuerste-Henry 2025-10-10 18:08:42 UTC
Created attachment 187761 [details] [review]
Bug 30331: Rename RenewalPeriodBase as ManualRenewalPeriodBase and add AutomaticRenewalPeriodBase sys pref

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Comment 10 Andrew Fuerste-Henry 2025-10-10 18:08:45 UTC
Created attachment 187762 [details] [review]
Bug 30331: Implement manual and automatic renewal base period

To test:

1. APPLY PATCH, updatedatabase, restart_all
2. Go to your circulation rules and do the following:
    -Automatic renewal: Yes
    -No renewal before: 5
    -No automatic renewal before: 5
    -Renewal period: 5

3. Set ManualRenewalPeriodBase to "the old due date of the checkout".
4. Set  AutomaticRenewalPeriodBase to "current date".

5. Check out an item and set the due date to 2 days from today
6. Attempt to manually renewal the item.
7. Notice the new date is calculated based on the old checkout date.
8. Check out an item another item and set the due date to 2 days from today.
9. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
10. Notice the new date is calculated based on the current date.

11. Set ManualRenewalPeriodBase to "current date".
12. Set  AutomaticRenewalPeriodBase to "the old due date of the checkout".

13. Check out an item and set the due date to 2 days from today
14. Attempt to manually renewal the item.
15. Notice the new date is calculated based on the current date.
16. Check out an item another item and set the due date to 2 days from today.
17. Run `perl /kohadevbox/koha/misc/cronjobs/automatic_renewals.pl -c -v`
18. Notice the new date is calculated based on the old checkout date.

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Comment 11 Andrew Fuerste-Henry 2025-10-10 18:08:48 UTC
Created attachment 187763 [details] [review]
Bug 30331: Unit tests

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Comment 12 Andrew Fuerste-Henry 2025-10-10 18:08:51 UTC
Created attachment 187764 [details] [review]
Bug 30331: Update system preference descriptions

Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>