Bugzilla – Attachment 187762 Details for
Bug 30331
Allow RenewalPeriodBase behavior to differ between manual and automatic renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30331: Implement manual and automatic renewal base period
Bug-30331-Implement-manual-and-automatic-renewal-b.patch (text/plain), 2.39 KB, created by
Andrew Fuerste-Henry
on 2025-10-10 18:08:45 UTC
(
hide
)
Description:
Bug 30331: Implement manual and automatic renewal base period
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-10-10 18:08:45 UTC
Size:
2.39 KB
patch
obsolete
>From 61f3924d904bb4f5f96363aa76098c85c282ce0a Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 7 Oct 2025 18:06:27 +0000 >Subject: [PATCH] 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> >--- > C4/Circulation.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d96fd7c0e12..884d0b15bfd 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3471,8 +3471,10 @@ sub AddRenewal { > my $itemtype = $item_object->effective_itemtype; > unless ($datedue) { > >+ my $renewal_base_pref = $automatic ? 'AutomaticRenewalPeriodBase' : 'ManualRenewalPeriodBase'; >+ > $datedue = >- ( C4::Context->preference('ManualRenewalPeriodBase') eq 'date_due' ) >+ ( C4::Context->preference($renewal_base_pref) eq 'date_due' ) > ? dt_from_string( $issue->date_due, 'sql' ) > : dt_from_string(); > $datedue = CalcDateDue( $datedue, $itemtype, $circ_library->branchcode, $patron, 'is a renewal' ); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30331
:
187537
|
187543
|
187552
|
187553
|
187757
|
187758
|
187759
|
187760
|
187761
| 187762 |
187763
|
187764