Bugzilla – Attachment 81904 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.98 KB, created by
Kyle M Hall
on 2018-11-02 15:17:07 UTC
(
hide
)
Description:
Bug 15561 - Add ability to charge cancelation fee from "Holds over" tab
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2018-11-02 15:17:07 UTC
Size:
6.98 KB
patch
obsolete
>From 26781312d0e56a126c5dac3a34f893bc83c355c7 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 | 10 ++++++++ > 3 files changed, 24 insertions(+), 13 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 78e8f6a360..5ca50bf3b2 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1089,12 +1089,12 @@ 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 $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); > return unless $holds->count; >- $holds->next->cancel; >+ $holds->next->cancel( { 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 aae9cbe7d0..44cc64d2c4 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -42,13 +42,14 @@ use Koha::Patrons; > > 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, $flags ) = get_template_and_user( > { >@@ -69,7 +70,7 @@ $template->param( TransferWhenCancelAllWaitingHolds => 1 ) if $transfer_when_can > my @cancel_result; > # if we have a return from the form we cancel the holds > 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; > } > >@@ -134,7 +135,7 @@ while ( my $hold = $holds->next ) { > > if ($today > $calcDate) { > if ($cancelall) { >- my $res = cancel( $item->itemnumber, $patron->borrowernumber, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); >+ my $res = cancel( $item->itemnumber, $patron->borrowernumber, $holdingbranch, $homebranch, !$transfer_when_cancel_all, $charge_cancel_fee ); > push @cancel_result, $res if $res; > next; > } else { >@@ -174,13 +175,13 @@ if ($item && $tab eq 'holdsover' && !@cancel_result) { > 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 c7850d4913..f42e8b3b0c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -130,11 +130,16 @@ > <input type="hidden" name="cancelall" value="1" /> > <input type="hidden" name="allbranches" value="[% allbranches | html %]" /> > <input type="hidden" name="tab" value="holdsover"> >+ > [% IF TransferWhenCancelAllWaitingHolds %] > <input type="submit" value="Cancel and Transfer all" /> > [% ELSE %] > <input type="submit" value="Cancel all" /> > [% END %] >+ >+ [% 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) >@@ -178,6 +183,11 @@ > <input type="hidden" name="fbr" value="[% overloo.holdingbranch | html %]" /> > <input type="hidden" name="tbr" value="[% overloo.homebranch | html %]" /> > <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 : [% Branches.GetName( overloo.homebranch ) | html %]" /> > [% ELSE %] >-- >2.17.2 (Apple Git-113)
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