Bugzilla – Attachment 154666 Details for
Bug 25393
Create separate 'no automatic renewal before' rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25393: Auto renewals logic reimplementation:
Bug-25393-Auto-renewals-logic-reimplementation.patch (text/plain), 1.83 KB, created by
Andrew Fuerste-Henry
on 2023-08-18 15:50:20 UTC
(
hide
)
Description:
Bug 25393: Auto renewals logic reimplementation:
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2023-08-18 15:50:20 UTC
Size:
1.83 KB
patch
obsolete
>From 3933b2f883d17a643b21aa8edf023b6e0db68e69 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 11 Aug 2023 14:20:48 +0000 >Subject: [PATCH] Bug 25393: Auto renewals logic reimplementation: > >Check if it's too soon for a manual renewal even if 'Automatic renewals' is enabled >Allow for a manual renewal even if it's too soon for an automatic renewal > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > C4/Circulation.pm | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 6f11e3f541a..d321f42b7c6 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3080,13 +3080,24 @@ sub CanBookBeRenewed { > } > } > >- return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $auto_renew =~ 'too_soon';#$auto_renew ne "no" && $auto_renew ne "ok"; >+ if($auto_renew =~ 'too_soon'){ >+ >+ # If its cron, tell it it's too soon for a an auto renewal >+ return ( 0, $auto_renew, { soonest_renew_date => $soonest } ) if $cron; >+ >+ # Check if it's too soon for a manual renewal >+ my $soonestManual = GetSoonestRenewDate( $patron, $issue ); >+ if($soonestManual > dt_from_string()){ >+ return (0, "too_soon", { soonest_renew_date => $soonestManual } ) unless $override_limit; >+ } >+ } >+ > $soonest = GetSoonestRenewDate($patron, $issue); > if ( $soonest > dt_from_string() ){ > return (0, "too_soon", { soonest_renew_date => $soonest } ) unless $override_limit; > } > >- return ( 0, "auto_renew" ) if $auto_renew eq "ok" && !$override_limit; # 0 if auto-renewal should not succeed >+ return ( 1, "auto_renew" ) if $auto_renew eq "ok" || $auto_renew eq "auto_too_soon" && !$override_limit; # 0 if auto-renewal should not succeed > > return ( 1, undef ); > } >-- >2.30.2
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 25393
:
154533
|
154534
|
154535
|
154536
|
154537
|
154538
|
154539
|
154540
|
154541
|
154661
|
154662
|
154663
|
154664
|
154665
|
154666
|
154667
|
154668
|
154669
|
155307
|
155308
|
155309
|
155310
|
155311
|
155312
|
155313
|
155314
|
155315
|
156829
|
156830
|
156831
|
156832
|
156833
|
156834
|
156835
|
156836
|
156837
|
156838
|
156839
|
156840