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

(-)a/Koha/Item.pm (-1 / +1 lines)
Lines 467-473 sub request_transfer { Link Here
467
        }
467
        }
468
    )->store();
468
    )->store();
469
469
470
    $request->cancel( { reason => $params->{reason}, force => 1 } )
470
    $request->cancel( { reason => $params->{reason}, force => 1, replace => 1 } )
471
      if ( defined($request) && $params->{replace} );
471
      if ( defined($request) && $params->{replace} );
472
472
473
    return $transfer;
473
    return $transfer;
(-)a/Koha/Item/Transfer.pm (-3 / +3 lines)
Lines 172-181 sub cancel { Link Here
172
        { datecancelled => dt_from_string, cancellation_reason => $params->{reason} } )
172
        { datecancelled => dt_from_string, cancellation_reason => $params->{reason} } )
173
      ->store;
173
      ->store;
174
174
175
    # Set up return transfer if transfer was force cancelled whilst in transit
175
    # Set up return transfer if transfer was force cancelled whilst in transit 
176
    # and we were not notified that the transfer is being replaced.
176
    # NOTE: We don't catch here, as we're happy to fail if there are already
177
    # NOTE: We don't catch here, as we're happy to fail if there are already
177
    # other transfers in the queue.
178
    # other transfers in the queue.
178
    if ($in_transit) {
179
    if ($in_transit && !$params->{replace}) {
179
        try {
180
        try {
180
            $self->item->request_transfer(
181
            $self->item->request_transfer(
181
                { to => $self->from_library, reason => 'TransferCancellation' } );
182
                { to => $self->from_library, reason => 'TransferCancellation' } );
182
- 

Return to bug 28294