Bugzilla – Attachment 86960 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]
[Alternate patch] Bug 19014: Do not try to autorenew an item too early
Bug-19014-Do-not-try-to-autorenew-an-item-too-earl.patch (text/plain), 2.83 KB, created by
David Cook
on 2019-03-25 03:48:49 UTC
(
hide
)
Description:
[Alternate patch] Bug 19014: Do not try to autorenew an item too early
Filename:
MIME Type:
Creator:
David Cook
Created:
2019-03-25 03:48:49 UTC
Size:
2.83 KB
patch
obsolete
>From 7d558e55893820df1176eb9b5ec813632518fa14 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Mon, 25 Mar 2019 13:38:21 +1100 >Subject: [PATCH] Bug 19014: Do not try to autorenew an item too early > >There are a number of conditions which can cause autorenewals >to send out confusing notifications to patrons far before the >due date of an item. These may be exceeding the max number of >renewals or checkouts, a hold on the item, etc. > >If an item has a hold, we don't want to tell the patron they >can't autorenew the item until the earliest renewal date or the >due date of the item. > >Test plan: > >1) Check out an item with a due date 2 business days in the future >2) Place a hold on this item >3) Execute the cronjob >- Without the patch, an email notification is generated for the patron >- With the patch, no email notification is generated >4) Set norenewalbefore in the Circulation and Fines rules to 2 >5) Execute the cronjob >- Without the patch, an email notification is generated for the person >- With the patch, an email notification is generated for the person >6) Set norenewalbefore in the Circulation and Fines rules to 3 >7) Execute the cronjob >- Without the patch, an email notification is generated for the patron >- With the patch, no email notification is generated >8) Clear norenewalbefore in the Circulation and Fines rules >9) Change item due date (in database) to a date/time prior to now >10) Execute the cronjob >- Without the patch, an email notification is generated for the person >- With the patch, an email notification is generated for the person >--- > misc/cronjobs/automatic_renewals.pl | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index b50a6d565a..9000d64961 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -75,6 +75,21 @@ 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 ){ >+ if ( $NoRenewalBeforeThisDate > $now ){ >+ next; >+ } >+ else { >+ #Fallback: if norenewalbefore is undef, don't renew before due date >+ if ( Koha::DateUtils::dt_from_string( $auto_renew->date_due, 'sql' ) > $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.16.4
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