Lines 970-975
sub ModReserve {
Link Here
|
970 |
my $suspend_until = $params->{'suspend_until'}; |
970 |
my $suspend_until = $params->{'suspend_until'}; |
971 |
my $borrowernumber = $params->{'borrowernumber'}; |
971 |
my $borrowernumber = $params->{'borrowernumber'}; |
972 |
my $biblionumber = $params->{'biblionumber'}; |
972 |
my $biblionumber = $params->{'biblionumber'}; |
|
|
973 |
my $cancellation_reason = $params->{'cancellation_reason'}; |
973 |
|
974 |
|
974 |
return if $rank eq "W"; |
975 |
return if $rank eq "W"; |
975 |
return if $rank eq "n"; |
976 |
return if $rank eq "n"; |
Lines 987-993
sub ModReserve {
Link Here
|
987 |
$hold ||= Koha::Holds->find($reserve_id); |
988 |
$hold ||= Koha::Holds->find($reserve_id); |
988 |
|
989 |
|
989 |
if ( $rank eq "del" ) { |
990 |
if ( $rank eq "del" ) { |
990 |
$hold->cancel; |
991 |
$hold->cancel({ cancellation_reason => $cancellation_reason }); |
991 |
} |
992 |
} |
992 |
elsif ($rank =~ /^\d+/ and $rank > 0) { |
993 |
elsif ($rank =~ /^\d+/ and $rank > 0) { |
993 |
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) ) |
994 |
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) ) |
Lines 1172-1178
sub ModReserveAffect {
Link Here
|
1172 |
|
1173 |
|
1173 |
=head2 ModReserveCancelAll |
1174 |
=head2 ModReserveCancelAll |
1174 |
|
1175 |
|
1175 |
($messages,$nextreservinfo) = &ModReserveCancelAll($itemnumber,$borrowernumber); |
1176 |
($messages,$nextreservinfo) = &ModReserveCancelAll($itemnumber,$borrowernumber,$reason); |
1176 |
|
1177 |
|
1177 |
function to cancel reserv,check other reserves, and transfer document if it's necessary |
1178 |
function to cancel reserv,check other reserves, and transfer document if it's necessary |
1178 |
|
1179 |
|
Lines 1181-1192
function to cancel reserv,check other reserves, and transfer document if it's ne
Link Here
|
1181 |
sub ModReserveCancelAll { |
1182 |
sub ModReserveCancelAll { |
1182 |
my $messages; |
1183 |
my $messages; |
1183 |
my $nextreservinfo; |
1184 |
my $nextreservinfo; |
1184 |
my ( $itemnumber, $borrowernumber ) = @_; |
1185 |
my ( $itemnumber, $borrowernumber, $cancellation_reason ) = @_; |
1185 |
|
1186 |
|
1186 |
#step 1 : cancel the reservation |
1187 |
#step 1 : cancel the reservation |
1187 |
my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); |
1188 |
my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); |
1188 |
return unless $holds->count; |
1189 |
return unless $holds->count; |
1189 |
$holds->next->cancel; |
1190 |
$holds->next->cancel({ cancellation_reason => $cancellation_reason }); |
1190 |
|
1191 |
|
1191 |
#step 2 launch the subroutine of the others reserves |
1192 |
#step 2 launch the subroutine of the others reserves |
1192 |
( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); |
1193 |
( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); |