@@ -, +, @@ cancelation" --- Koha/Hold.pm | 9 ------- Koha/Item/Transfer.pm | 25 +++---------------- .../prog/en/modules/circ/returns.tt | 2 -- 3 files changed, 4 insertions(+), 32 deletions(-) --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -511,17 +511,8 @@ Cancel a hold: sub cancel { my ( $self, $params ) = @_; - $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} ); --- a/Koha/Item/Transfer.pm +++ a/Koha/Item/Transfer.pm @@ -52,20 +52,6 @@ sub item { return Koha::Item->_new_from_dbic($item_rs); } -=head3 from_library - - my $from_library = $transfer->from_library; - -Returns the associated from_library for this transfer. - -=cut - -sub from_library { - my ($self) = @_; - my $from_library_rs = $self->_result->frombranch; - return Koha::Library->_new_from_dbic($from_library_rs); -} - =head3 to_library my $to_library = $transfer->to_library; @@ -173,15 +159,12 @@ sub cancel { ->store; # Set up return transfer if transfer was force cancelled whilst in transit - # and we were not notified that the transfer is being replaced. # NOTE: We don't catch here, as we're happy to fail if there are already # other transfers in the queue. - if ($in_transit && !$params->{replace}) { - try { - $self->item->request_transfer( - { to => $self->from_library, reason => 'TransferCancellation' } ); - }; - } + try { + $self->item->request_transfer( + { to => $self->from_library, reason => 'TransferCancellation' } ); + }; return $self; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -134,8 +134,6 @@ [%- CASE 'Reserve' -%]Reserve [%- CASE 'LostReserve' -%]Lost reserve [%- CASE 'CancelReserve' -%]Cancelled reserve - [%- CASE 'TransferCancellation' -%]Transfer was cancelled whilst in transit - [%- CASE -%][% trigger | html %] [%- END -%]

--