Bugzilla – Attachment 52906 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), 7.45 KB, created by
Kyle M Hall
on 2016-06-27 17:28:06 UTC
(
hide
)
Description:
Bug 15561 - Add ability to charge cancelation fee from "Holds over" tab
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2016-06-27 17:28:06 UTC
Size:
7.45 KB
patch
obsolete
>From 98324dab2644c80d2a4bca1f4f49c4f825ce4700 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 27 Jun 2016 16:12:29 +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 > >Signed-off-by: Jason Burds <JBurds@dubuque.lib.ia.us> >--- > C4/Reserves.pm | 4 ++-- > circ/waitingreserves.pl | 23 +++++++++++----------- > .../prog/en/modules/circ/waitingreserves.tt | 11 ++++++++++- > 3 files changed, 24 insertions(+), 14 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index b83f8e1..87e3f1c 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1368,10 +1368,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 0050ce3..306f6b1 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; > } > >@@ -140,7 +141,7 @@ foreach my $num (@getreserves) { > > if ($today > $calcDate) { > if ($cancelall) { >- my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); >+ my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all, $charge_cancel_fee ); > push @cancel_result, $res if $res; > next; > } else { >@@ -175,13 +176,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 3183442..ed6a583 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' %] >@@ -113,7 +114,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 %] >@@ -137,6 +138,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) >@@ -174,6 +178,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