Bugzilla – Attachment 38815 Details for
Bug 14137
Allow ExpireReservesMaxPickUpDelayCharge to be used without ExpireReservesMaxPickUpDelay
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14137 - Allow ExpireReservesMaxPickUpDelayCharge to be used without ExpireReservesMaxPickUpDelay
Bug-14137---Allow-ExpireReservesMaxPickUpDelayChar.patch (text/plain), 4.05 KB, created by
Kyle M Hall
on 2015-05-04 13:34:42 UTC
(
hide
)
Description:
Bug 14137 - Allow ExpireReservesMaxPickUpDelayCharge to be used without ExpireReservesMaxPickUpDelay
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2015-05-04 13:34:42 UTC
Size:
4.05 KB
patch
obsolete
>From 7b5fda67d28b2271990e45dd7fefba4fd1b28df4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 4 May 2015 09:33:31 -0400 >Subject: [PATCH] Bug 14137 - Allow ExpireReservesMaxPickUpDelayCharge to be used without ExpireReservesMaxPickUpDelay > >Some libraries would like to be able to use >ExpireReservesMaxPickUpDelayCharge without ExpireReservesMaxPickUpDelay. > >ExpireReservesMaxPickUpDelay automatically cancels the holds but some >librarians would prefer to cancel the holds manually but still have the >patron's charged the fee for allowing a waiting hold to become expired >and canceled. > >Test Plan: >1) Apply this patch >2) Set a fee amount in ExpireReservesMaxPickUpDelayCharge >3) Cancel a hold from the "holds over" tab >4) View the patron record, note the fee has been added >--- > C4/Reserves.pm | 29 ++++++++++++++++--- > .../en/modules/admin/preferences/circulation.pref | 2 +- > 2 files changed, 25 insertions(+), 6 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 15a3d22..161c570 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1060,7 +1060,6 @@ sub CancelExpiredReserves { > # Cancel reserves that have been waiting too long > if ( C4::Context->preference("ExpireReservesMaxPickUpDelay") ) { > my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); >- my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); > my $cancel_on_holidays = C4::Context->preference('ExpireReservesOnHolidays'); > > my $today = dt_from_string(); >@@ -1081,10 +1080,6 @@ sub CancelExpiredReserves { > } > > if ( $do_cancel ) { >- if ( $charge ) { >- manualinvoice($res->{'borrowernumber'}, $res->{'itemnumber'}, 'Hold waiting too long', 'F', $charge); >- } >- > CancelReserve({ reserve_id => $res->{'reserve_id'} }); > } > } >@@ -1130,6 +1125,30 @@ sub CancelReserve { > > my $reserve = GetReserve( $reserve_id ); > if ($reserve) { >+ # Charge for canceled reserves that have been waiting too long >+ if ( $reserve->{found} eq 'W' >+ && $reserve->{priority} == 0 >+ && C4::Context->preference("ExpireReservesMaxPickUpDelay") ) >+ { >+ my $max_pickup_delay = C4::Context->preference("ReservesMaxPickUpDelay"); >+ >+ my $now = dt_from_string(); >+ my $waitingdate = dt_from_string( $reserve->{waitingdate} ); >+ my $duration = $waitingdate->delta_days($now); >+ my $days_waiting = $duration->in_units('days'); >+ if ( $days_waiting > $max_pickup_delay ) { >+ my $charge = C4::Context->preference("ExpireReservesMaxPickUpDelayCharge"); >+ if ($charge) { >+ manualinvoice( >+ $reserve->{'borrowernumber'}, >+ $reserve->{'itemnumber'}, >+ 'Hold waiting too long', >+ 'F', $charge >+ ); >+ } >+ } >+ } >+ > my $query = " > UPDATE reserves > SET cancellationdate = now(), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index a296bf6..0f36001 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -480,7 +480,7 @@ Circulation: > no: "Don't allow" > - "holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay" > - >- - If using ExpireReservesMaxPickUpDelay, charge a borrower who allows his or her waiting hold to expire a fee of >+ - Charge a borrower who allows his or her waiting hold to expire be canceled a fee of > - pref: ExpireReservesMaxPickUpDelayCharge > class: currency > - >-- >1.7.2.5
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 14137
:
38815
|
45421