Bugzilla – Attachment 95851 Details for
Bug 19014
Patrons should not get an 'on_reserve' notification if the due date is far into the future
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19014: Only process issues for autorenewal if on or after soonest renewal date
Bug-19014-Only-process-issues-for-autorenewal-if-o.patch (text/plain), 2.43 KB, created by
ByWater Sandboxes
on 2019-11-27 16:08:55 UTC
(
hide
)
Description:
Bug 19014: Only process issues for autorenewal if on or after soonest renewal date
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2019-11-27 16:08:55 UTC
Size:
2.43 KB
patch
obsolete
>From aafff599d39ca0ef7822c2eaf00d0af9de7994da Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 11 Jun 2019 16:10:06 +0000 >Subject: [PATCH] Bug 19014: Only process issues for autorenewal if on or after > soonest renewal date > >This patch check the soonest renewal date and skips processing auto renewals if before this date >This ensures patrons won't get notifications far in advance if an item is on hold or has other issues > >To test: > 1 - Checkout an item to a patron with a due date 2 days in the future and 'No renewal before' unset > 2 - Place a hold on that item > 3 - Define an AUTO_RENEWALS circulation notice with below at a minimum > [% checkout.auto_renew_error %] > 4 - perl misc/cronjobs/automatic_renewals.pl --send-notices > 5 - Patron is not notified > 6 - Set 'No renewal before' to 1 > 7 - run cronjob > 8 - Patron is notified with error 'on_reserve' > 9 - Set 'No renewal before' to 3 >10 - UPDATE issues SET auto_renew_error = NULL; >11 - run cronjob >12 - Patron is notified with error 'on_reserve' >13 - APPLY PATCH >14 - Unset 'No renewal before' >15 - UPDATE issues SET auto_renew_error = NULL; >16 - run cronjob >17 - Patron is not notified >18 - UPDATE issues SET auto_renew_error = NULL; >19 - Set 'No renewal before' to 1 >20 - run cronjob >21 - Patron is notified with error 'on_reserve' >22 - Set 'No renewal before' to 3 >23 - UPDATE issues SET auto_renew_error = NULL; >24 - run cronjob >25 - Patron is not notified > >Signed-off-by: > >Signed-off-by: >--- > misc/cronjobs/automatic_renewals.pl | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index fb1cf03ba9..a442ff5716 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -75,6 +75,12 @@ my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 }); > my %report; > while ( my $auto_renew = $auto_renews->next ) { > >+#If norenewalbefore is undef, $NoRenewalBeforeThisDate will equal $now. >+ my $NoRenewalBeforeThisDate = C4::Circulation::GetSoonestRenewDate($auto_renew->borrowernumber, $auto_renew->itemnumber); >+ my $now = Koha::DateUtils::dt_from_string; >+ if ( $NoRenewalBeforeThisDate > $now ){ >+ next; >+ } > # CanBookBeRenewed returns 'auto_renew' when the renewal should be done by this script > my ( $ok, $error ) = CanBookBeRenewed( $auto_renew->borrowernumber, $auto_renew->itemnumber ); > if ( $error eq 'auto_renew' ) { >-- >2.11.0
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 19014
:
65590
|
86960
|
90509
|
95348
|
95851
|
95852
|
96688
|
96689
|
97374
|
97395
|
97396
|
97397
|
98704
|
98705
|
98706
|
98717
|
98718
|
98719
|
98720
|
100180