@@ -, +, @@ previous transfer finishes 1) Apply patch 1) Have biblio with item in branch A 2) Create a new hold with a pickup library to branch B 3) Check-in the item at branch A and confirm the hold and transfer 4) Cancel the hold 5) Check-in the hold at branch B and notice it prompt to return it to branch A --- C4/Circulation.pm | 2 ++ Koha/Hold.pm | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2171,6 +2171,7 @@ sub AddReturn { if ( $transfer->tobranch eq $branch ) { $transfer->receive; $messages->{'TransferArrived'} = $transfer->frombranch; + $validTransfer = 1 if $transfer->reason eq 'Reserve'; } else { $messages->{'WrongTransfer'} = $transfer->tobranch; @@ -2181,6 +2182,7 @@ sub AddReturn { if ( $transfer->tobranch eq $branch ) { $transfer->receive; $messages->{'TransferArrived'} = $transfer->frombranch; + $validTransfer = 1 if $transfer->reason eq 'Reserve'; } else { $messages->{'WasTransfered'} = $transfer->tobranch; --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -514,14 +514,6 @@ sub cancel { $self->_result->result_source->schema->txn_do( sub { - if ( $self->is_in_transit ) { - my $transfer = $self->item->get_transfer; - # NOTE: Transfers are well bound with Holds.. as such we have to check that there is actually a - # transfer enqueued and in transit here prior to trying to cancel it. - if ( $transfer && $transfer->in_transit ) { - $transfer->cancel({ reason => 'CancelReserve', force => 1 }); - } - } $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) ); $self->priority(0); $self->cancellation_reason( $params->{cancellation_reason} ); --