Lines 40-52
use C4::Koha;
Link Here
|
40 |
|
40 |
|
41 |
my $input = new CGI; |
41 |
my $input = new CGI; |
42 |
|
42 |
|
43 |
my $item = $input->param('itemnumber'); |
43 |
my $item = $input->param('itemnumber'); |
44 |
my $borrowernumber = $input->param('borrowernumber'); |
44 |
my $borrowernumber = $input->param('borrowernumber'); |
45 |
my $fbr = $input->param('fbr') || ''; |
45 |
my $fbr = $input->param('fbr') || ''; |
46 |
my $tbr = $input->param('tbr') || ''; |
46 |
my $tbr = $input->param('tbr') || ''; |
47 |
my $all_branches = $input->param('allbranches') || ''; |
47 |
my $all_branches = $input->param('allbranches') || ''; |
48 |
my $cancelall = $input->param('cancelall'); |
48 |
my $cancelall = $input->param('cancelall'); |
49 |
my $tab = $input->param('tab'); |
49 |
my $tab = $input->param('tab'); |
|
|
50 |
my $charge_cancel_fee = $input->param('charge_cancel_fee'); |
50 |
|
51 |
|
51 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
52 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
52 |
{ |
53 |
{ |
Lines 67-73
$template->param( TransferWhenCancelAllWaitingHolds => 1 ) if $transfer_when_can
Link Here
|
67 |
my @cancel_result; |
68 |
my @cancel_result; |
68 |
# if we have a return from the form we launch the subroutine CancelReserve |
69 |
# if we have a return from the form we launch the subroutine CancelReserve |
69 |
if ($item) { |
70 |
if ($item) { |
70 |
my $res = cancel( $item, $borrowernumber, $fbr, $tbr ); |
71 |
my $res = cancel( $item, $borrowernumber, $fbr, $tbr, undef, $charge_cancel_fee ); |
71 |
push @cancel_result, $res if $res; |
72 |
push @cancel_result, $res if $res; |
72 |
} |
73 |
} |
73 |
|
74 |
|
Lines 140-146
foreach my $num (@getreserves) {
Link Here
|
140 |
|
141 |
|
141 |
if ($today > $calcDate) { |
142 |
if ($today > $calcDate) { |
142 |
if ($cancelall) { |
143 |
if ($cancelall) { |
143 |
my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all ); |
144 |
my $res = cancel( $itemnumber, $borrowernum, $holdingbranch, $homebranch, !$transfer_when_cancel_all, $charge_cancel_fee ); |
144 |
push @cancel_result, $res if $res; |
145 |
push @cancel_result, $res if $res; |
145 |
next; |
146 |
next; |
146 |
} else { |
147 |
} else { |
Lines 175-187
if ($item && $tab eq 'holdsover') {
Link Here
|
175 |
exit; |
176 |
exit; |
176 |
|
177 |
|
177 |
sub cancel { |
178 |
sub cancel { |
178 |
my ($item, $borrowernumber, $fbr, $tbr, $skip_transfers ) = @_; |
179 |
my ($item, $borrowernumber, $fbr, $tbr, $skip_transfers, $charge_cancel_fee ) = @_; |
179 |
|
180 |
|
180 |
my $transfer = $fbr ne $tbr; # XXX && !$nextreservinfo; |
181 |
my $transfer = $fbr ne $tbr; # XXX && !$nextreservinfo; |
181 |
|
182 |
|
182 |
return if $transfer && $skip_transfers; |
183 |
return if $transfer && $skip_transfers; |
183 |
|
184 |
|
184 |
my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $item, $borrowernumber ); |
185 |
my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $item, $borrowernumber, $charge_cancel_fee ); |
185 |
|
186 |
|
186 |
# if the document is not in his homebranch location and there is not reservation after, we transfer it |
187 |
# if the document is not in his homebranch location and there is not reservation after, we transfer it |
187 |
if ($transfer && !$nextreservinfo) { |
188 |
if ($transfer && !$nextreservinfo) { |