Bugzilla – Attachment 65590 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: Do not sent on_reserve notification if the checkout is due in the future
Bug-19014-Do-not-sent-onreserve-notification-if-th.patch (text/plain), 2.31 KB, created by
Jonathan Druart
on 2017-08-07 17:14:57 UTC
(
hide
)
Description:
Bug 19014: Do not sent on_reserve notification if the checkout is due in the future
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-08-07 17:14:57 UTC
Size:
2.31 KB
patch
obsolete
>From ece10e6a2ed1d95338b78ddbb03538fb6fb58f9e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Aug 2017 13:55:11 -0300 >Subject: [PATCH] Bug 19014: Do not sent on_reserve notification if the > checkout is due in the future > >If holds exist on an item that have been checked out and marked as auto >renewal, we do not want to notify patrons with a on_reserve notification >if the checkout is due in the future. >These on_reserve notifications must only be sent if the checkout is due >today or in the past. > >Test plan: >- Check an item in and mark it as auto renewal, use a due date in the >past to ease the testing >- Place a hold in this item >- Execute the cronjob >=> Without this patch, the patron will get notified even if the checkout >is due in the future >=> With this patch applied the patron will only get notified the day the >checkout is due or if the due date is passed >--- > 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 190630149f..3f5d480c12 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -56,6 +56,7 @@ use C4::Circulation; > use C4::Context; > use C4::Log; > use C4::Letters; >+use Koha::DateUtils qw( dt_from_string ); > use Koha::Checkouts; > use Koha::Libraries; > use Koha::Patrons; >@@ -71,6 +72,7 @@ pod2usage(0) if $help; > cronlogaction(); > > my $auto_renews = Koha::Checkouts->search({ auto_renew => 1 }); >+my $today = dt_from_string; > > my %report; > while ( my $auto_renew = $auto_renews->next ) { >@@ -89,6 +91,10 @@ while ( my $auto_renew = $auto_renews->next ) { > or $error eq 'auto_too_much_oweing' > or $error eq 'auto_too_soon' ) { > if ( not $auto_renew->auto_renew_error or $error ne $auto_renew->auto_renew_error ) { >+ next # Do not notify 'on_reserve' if the due date is later than today >+ if $error eq 'on_reserve' >+ and $today->truncate( to => 'day' ) < dt_from_string( $auto_renew->date_due, 'sql' )->truncate( to => 'day' ); >+ > $auto_renew->auto_renew_error($error)->store; > push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew > if $error ne 'auto_too_soon'; # Do not notify if it's too soon >-- >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