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

(-)a/Koha/Hold.pm (-1 / +8 lines)
Lines 513-518 sub cancel { Link Here
513
    my ( $self, $params ) = @_;
513
    my ( $self, $params ) = @_;
514
    $self->_result->result_source->schema->txn_do(
514
    $self->_result->result_source->schema->txn_do(
515
        sub {
515
        sub {
516
            if ( $self->is_in_transit ) {
517
                my $transfer = $self->item->get_transfer;
518
                # NOTE: Transfers are well bound with Holds.. as such we have to check that there is actually a
519
                # transfer enqueued and in transit here prior to trying to cancel it.
520
                if ( $transfer && $transfer->in_transit ) {
521
                    $transfer->cancel( { reason => 'CancelReserve', force => 1 } );
522
                }
523
            }
516
            $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) );
524
            $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) );
517
            $self->priority(0);
525
            $self->priority(0);
518
            $self->cancellation_reason( $params->{cancellation_reason} );
526
            $self->cancellation_reason( $params->{cancellation_reason} );
519
- 

Return to bug 28527