Lines 983-988
sub ModReserve {
Link Here
|
983 |
my $suspend_until = $params->{'suspend_until'}; |
983 |
my $suspend_until = $params->{'suspend_until'}; |
984 |
my $borrowernumber = $params->{'borrowernumber'}; |
984 |
my $borrowernumber = $params->{'borrowernumber'}; |
985 |
my $biblionumber = $params->{'biblionumber'}; |
985 |
my $biblionumber = $params->{'biblionumber'}; |
|
|
986 |
my $cancellation_reason = $params->{'cancellation_reason'}; |
986 |
|
987 |
|
987 |
return if $rank eq "W"; |
988 |
return if $rank eq "W"; |
988 |
return if $rank eq "n"; |
989 |
return if $rank eq "n"; |
Lines 1000-1006
sub ModReserve {
Link Here
|
1000 |
$hold ||= Koha::Holds->find($reserve_id); |
1001 |
$hold ||= Koha::Holds->find($reserve_id); |
1001 |
|
1002 |
|
1002 |
if ( $rank eq "del" ) { |
1003 |
if ( $rank eq "del" ) { |
1003 |
$hold->cancel; |
1004 |
$hold->cancel({ cancellation_reason => $cancellation_reason }); |
1004 |
} |
1005 |
} |
1005 |
elsif ($rank =~ /^\d+/ and $rank > 0) { |
1006 |
elsif ($rank =~ /^\d+/ and $rank > 0) { |
1006 |
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) ) |
1007 |
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) ) |
Lines 1185-1191
sub ModReserveAffect {
Link Here
|
1185 |
|
1186 |
|
1186 |
=head2 ModReserveCancelAll |
1187 |
=head2 ModReserveCancelAll |
1187 |
|
1188 |
|
1188 |
($messages,$nextreservinfo) = &ModReserveCancelAll($itemnumber,$borrowernumber); |
1189 |
($messages,$nextreservinfo) = &ModReserveCancelAll($itemnumber,$borrowernumber,$reason); |
1189 |
|
1190 |
|
1190 |
function to cancel reserv,check other reserves, and transfer document if it's necessary |
1191 |
function to cancel reserv,check other reserves, and transfer document if it's necessary |
1191 |
|
1192 |
|
Lines 1194-1205
function to cancel reserv,check other reserves, and transfer document if it's ne
Link Here
|
1194 |
sub ModReserveCancelAll { |
1195 |
sub ModReserveCancelAll { |
1195 |
my $messages; |
1196 |
my $messages; |
1196 |
my $nextreservinfo; |
1197 |
my $nextreservinfo; |
1197 |
my ( $itemnumber, $borrowernumber ) = @_; |
1198 |
my ( $itemnumber, $borrowernumber, $cancellation_reason ) = @_; |
1198 |
|
1199 |
|
1199 |
#step 1 : cancel the reservation |
1200 |
#step 1 : cancel the reservation |
1200 |
my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); |
1201 |
my $holds = Koha::Holds->search({ itemnumber => $itemnumber, borrowernumber => $borrowernumber }); |
1201 |
return unless $holds->count; |
1202 |
return unless $holds->count; |
1202 |
$holds->next->cancel; |
1203 |
$holds->next->cancel({ cancellation_reason => $cancellation_reason }); |
1203 |
|
1204 |
|
1204 |
#step 2 launch the subroutine of the others reserves |
1205 |
#step 2 launch the subroutine of the others reserves |
1205 |
( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); |
1206 |
( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); |