Bugzilla – Attachment 46558 Details for
Bug 15561
Add ability to charge cancellation fee from "Holds over" tab
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15561 - Add ability to charge cancelation fee from "Holds over" tab
Bug-15561---Add-ability-to-charge-cancelation-fee-.patch (text/plain), 6.96 KB, created by
Kyle M Hall
on 2016-01-12 17:41:49 UTC
(
hide
)
Description:
Bug 15561 - Add ability to charge cancelation fee from "Holds over" tab
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2016-01-12 17:41:49 UTC
Size:
6.96 KB
patch
obsolete
>From b2b7983b9940ebd838ab991a30069551b7aa77a2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 12 Jan 2016 17:27:23 +0000 >Subject: [PATCH] Bug 15561 - Add ability to charge cancelation fee from "Holds > over" tab > >The fee set in ExpireReservesMaxPickUpDelayCharge can only be charged by >the automatic expiration cron script. Some libraries would prefer to >manually cancel holds via the "Holds over" tab of the "Holds awaiting >pickup" page but still be able to charge the cancellation fee. > >Test Plan: >1) Apply this patch >2) Set ExpireReservesMaxPickUpDelayCharge to some number >3) Go to the Holds awaiting pickup page >4) Go to the Holds over tab >5) Note the new checkbox for charging the fee >6) Test canceling a single hold with the checkbox checked >7) Note a fee is charged >8) Test canceling a single hold with the checkbox unchecked >9) Note a fee is not charged >10) Test canceling all holds with the checkbox checked >11) Note the patrons are charged fees >12) Test canceling all holds without the checkbox checked >13) Note the patrons are not charged fees >--- > C4/Reserves.pm | 4 ++-- > circ/waitingreserves.pl | 21 +++++++++++---------- > .../prog/en/modules/circ/waitingreserves.tt | 11 ++++++++++- > 3 files changed, 23 insertions(+), 13 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 7bb5d69..c47cc7a 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1356,10 +1356,10 @@ function to cancel reserv,check other reserves, and transfer document if it's ne > sub ModReserveCancelAll { > my $messages; > my $nextreservinfo; >- my ( $itemnumber, $borrowernumber ) = @_; >+ my ( $itemnumber, $borrowernumber, $charge_cancel_fee ) = @_; > > #step 1 : cancel the reservation >- my $CancelReserve = CancelReserve({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); >+ my $CancelReserve = CancelReserve({ itemnumber => $itemnumber, borrowernumber => $borrowernumber, charge_cancel_fee => $charge_cancel_fee }); > > #step 2 launch the subroutine of the others reserves > ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 268213a..67e9f29 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -40,13 +40,14 @@ use C4::Koha; > > my $input = new CGI; > >-my $item = $input->param('itemnumber'); >-my $borrowernumber = $input->param('borrowernumber'); >-my $fbr = $input->param('fbr') || ''; >-my $tbr = $input->param('tbr') || ''; >-my $all_branches = $input->param('allbranches') || ''; >-my $cancelall = $input->param('cancelall'); >-my $tab = $input->param('tab'); >+my $item = $input->param('itemnumber'); >+my $borrowernumber = $input->param('borrowernumber'); >+my $fbr = $input->param('fbr') || ''; >+my $tbr = $input->param('tbr') || ''; >+my $all_branches = $input->param('allbranches') || ''; >+my $cancelall = $input->param('cancelall'); >+my $tab = $input->param('tab'); >+my $charge_cancel_fee = $input->param('charge_cancel_fee'); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -67,7 +68,7 @@ $template->param( TransferWhenCancelAllWaitingHolds => 1 ) if $transfer_when_can > my @cancel_result; > # if we have a return from the form we launch the subroutine CancelReserve > if ($item) { >- my $res = cancel( $item, $borrowernumber, $fbr, $tbr ); >+ my $res = cancel( $item, $borrowernumber, $fbr, $tbr, undef, $charge_cancel_fee ); > push @cancel_result, $res if $res; > } > >@@ -171,13 +172,13 @@ if ($item && $tab eq 'holdsover') { > exit; > > sub cancel { >- my ($item, $borrowernumber, $fbr, $tbr, $skip_transfers ) = @_; >+ my ($item, $borrowernumber, $fbr, $tbr, $skip_transfers, $charge_cancel_fee ) = @_; > > my $transfer = $fbr ne $tbr; # XXX && !$nextreservinfo; > > return if $transfer && $skip_transfers; > >- my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $item, $borrowernumber ); >+ my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $item, $borrowernumber, $charge_cancel_fee ); > > # if the document is not in his homebranch location and there is not reservation after, we transfer it > if ($transfer && !$nextreservinfo) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 1028033..30bc149 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -109,7 +110,7 @@ > <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" /> > <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch %]" /> > <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" /> >- <input type="hidden" name="tab" value="holdswaiting"> >+ <input type="hidden" name="tab" value="holdswaiting" /> > [% IF ( reserveloo.dotransfer ) %] > <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> > [% ELSE %] >@@ -133,6 +134,9 @@ > <input type="hidden" name="allbranches" value="[% allbranches %]" /> > <input type="hidden" name="tab" value="holdsover"> > <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" /> >+ [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %] >+ <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p> >+ [% END %] > </form> > [% UNLESS TransferWhenCancelAllWaitingHolds %] > Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref) >@@ -170,6 +174,11 @@ > <input type="hidden" name="fbr" value="[% overloo.holdingbranch %]" /> > <input type="hidden" name="tbr" value="[% overloo.homebranch %]" /> > <input type="hidden" name="tab" value="holdsover"> >+ >+ [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %] >+ <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p> >+ [% END %] >+ > [% IF ( overloo.dotransfer ) %] > <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" /> > [% ELSE %] >-- >2.1.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 15561
:
46558
|
50325
|
51742
|
52906
|
52907
|
52908
|
53724
|
63358
|
63359
|
63360
|
63361
|
81904
|
81905
|
81906
|
81907