View | Details | Raw Unified | Return to bug 15561
Collapse All | Expand All

(-)a/C4/Reserves.pm (-2 / +2 lines)
Lines 1359-1368 function to cancel reserv,check other reserves, and transfer document if it's ne Link Here
1359
sub ModReserveCancelAll {
1359
sub ModReserveCancelAll {
1360
    my $messages;
1360
    my $messages;
1361
    my $nextreservinfo;
1361
    my $nextreservinfo;
1362
    my ( $itemnumber, $borrowernumber ) = @_;
1362
    my ( $itemnumber, $borrowernumber, $charge_cancel_fee ) = @_;
1363
1363
1364
    #step 1 : cancel the reservation
1364
    #step 1 : cancel the reservation
1365
    my $CancelReserve = CancelReserve({ itemnumber => $itemnumber, borrowernumber => $borrowernumber });
1365
    my $CancelReserve = CancelReserve({ itemnumber => $itemnumber, borrowernumber => $borrowernumber, charge_cancel_fee => $charge_cancel_fee });
1366
1366
1367
    #step 2 launch the subroutine of the others reserves
1367
    #step 2 launch the subroutine of the others reserves
1368
    ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
1368
    ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
(-)a/circ/waitingreserves.pl (-11 / +12 lines)
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) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (-1 / +10 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% USE KohaDates %]
2
[% USE KohaDates %]
2
[% USE Branches %]
3
[% USE Branches %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 113-119 Link Here
113
                            <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
114
                            <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
114
                            <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch %]" />
115
                            <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch %]" />
115
                            <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
116
                            <input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
116
                            <input type="hidden" name="tab" value="holdswaiting">
117
                            <input type="hidden" name="tab" value="holdswaiting" />
117
                            [% IF ( reserveloo.dotransfer ) %]
118
                            [% IF ( reserveloo.dotransfer ) %]
118
                            <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> 
119
                            <input type="submit" value="Cancel hold and return to : [% reserveloo.branchname %]" /> 
119
                            [% ELSE %]
120
                            [% ELSE %]
Lines 137-142 Link Here
137
                   <input type="hidden" name="allbranches" value="[% allbranches %]" />
138
                   <input type="hidden" name="allbranches" value="[% allbranches %]" />
138
                   <input type="hidden" name="tab" value="holdsover">
139
                   <input type="hidden" name="tab" value="holdsover">
139
                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
140
                   <input type="submit" value="Cancel [% IF TransferWhenCancelAllWaitingHolds %]and Transfer [% END %]All" />
141
                   [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
142
                       <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
143
                   [% END %]
140
               </form>
144
               </form>
141
               [% UNLESS TransferWhenCancelAllWaitingHolds %]
145
               [% UNLESS TransferWhenCancelAllWaitingHolds %]
142
                    Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref)
146
                    Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref)
Lines 174-179 Link Here
174
                            <input type="hidden" name="fbr" value="[% overloo.holdingbranch %]" />
178
                            <input type="hidden" name="fbr" value="[% overloo.holdingbranch %]" />
175
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
179
                            <input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
176
                            <input type="hidden" name="tab" value="holdsover">
180
                            <input type="hidden" name="tab" value="holdsover">
181
182
                            [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
183
                                <p><input type="checkbox" class="charge_cancel_fee" name="charge_cancel_fee" value="1" checked="checked" /> Charge cancelation fee</p>
184
                            [% END %]
185
177
                            [% IF ( overloo.dotransfer ) %]
186
                            [% IF ( overloo.dotransfer ) %]
178
                            <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" />
187
                            <input type="submit" value="Cancel hold and return to : [% overloo.branchname %]" />
179
                            [% ELSE %]
188
                            [% ELSE %]

Return to bug 15561