Bugzilla – Attachment 58130 Details for
Bug 14146
Add option to add restriction period when checking-in several overdues for same patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14146: Add the ability to cumulate restriction periods
Bug-14146-Add-the-ability-to-cumulate-restriction-.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2016-12-12 15:33:27 UTC
(
hide
)
Description:
Bug 14146: Add the ability to cumulate restriction periods
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-12-12 15:33:27 UTC
Size:
2.10 KB
patch
obsolete
>From ccebfbe0a0d8faebfbb2c82969d65f4080752e50 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Nov 2016 19:33:44 +0000 >Subject: [PATCH] Bug 14146: Add the ability to cumulate restriction periods > >At the moment the default behaviour is not to cumulate the restriction >periods but to apply the longest one. >This patch set creates a new syspref CumulativeRestrictionPeriods. If >on, the behaviour changes and the restriction periods are cumulated: the >days of the second restriction are added to the actual restriction >period. > >We could add a new circulation rule instead of a syspref, but I am not >sure it's very useful to have such granularity for this behaviour (can >be changed if needed). > >How it works: >Let's take 2 items, A and B. >A is returned with Na days late, and B Nb days late >The grace period is Ng and there is 1 day of suspension charge per day >of overdue >The suspension period is until day D = Na - Ng + Nb - Ng > >I would have expected D = Na + Nb - Ng but it's how it worked before >this patch. > >Test plan: >Create several overdue for a given patron >Do the checkins and confirm that the period are added if the pref is on. >If the pref is off, you should not get any changes in the existing behaviour. > >Sponsored-by: Orex Digital >--- > C4/Circulation.pm | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index b505031..cc412d1 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2238,6 +2238,13 @@ sub _debar_user_on_return { > if DateTime::Duration->compare( $max_sd, $suspension_days ) < 0; > } > >+ if ( C4::Context->preference('CumulativeRestrictionPeriods') and $borrower->{debarred} ) { >+ my $debarment = @{ GetDebarments( { borrowernumber => $borrower->{borrowernumber}, type => 'SUSPENSION' } ) }[0]; >+ if ( $debarment ) { >+ $return_date = dt_from_string( $debarment->{expiration}, 'sql' ); >+ } >+ } >+ > my $new_debar_dt = > $dt_today->clone()->add_duration( $suspension_days ); > >-- >2.9.3
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 14146
:
58128
|
58129
|
58130
|
58131
|
58149
|
60406
|
60407
|
60408
|
60409
|
61535
|
61536
|
61537
|
61538