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

(-)a/C4/Items.pm (-2 / +2 lines)
Lines 380-389 sub ModItemTransfer { Link Here
380
        $item->holdingbranch($frombranch)->store(
380
        $item->holdingbranch($frombranch)->store(
381
            {
381
            {
382
                log_action        => 0,
382
                log_action        => 0,
383
                skip_record_index => $params->{skip_record_index}
383
                skip_record_index => 1, # avoid indexing duplication, let ->transit handle it
384
            }
384
            }
385
        );
385
        );
386
        $transfer->transit;
386
        $transfer->transit({ skip_record_index => $params->{skip_record_index} });
387
    }
387
    }
388
388
389
    return;
389
    return;
(-)a/Koha/Item/Transfer.pm (-4 / +8 lines)
Lines 80-93 sub to_library { Link Here
80
80
81
=head3 transit
81
=head3 transit
82
82
83
Set the transfer as in transit by updating the datesent time.
83
    $transfer->transit({ [ skip_record_index => 0|1 ] });
84
85
Set the transfer as in transit by updating the I<datesent> time.
84
86
85
Also, update date last seen and ensure item holdingbranch is correctly set.
87
Also, update date last seen and ensure item holdingbranch is correctly set.
86
88
89
An optional I<skip_record_index> parameter can be passed to avoid triggering
90
reindex.
91
87
=cut
92
=cut
88
93
89
sub transit {
94
sub transit {
90
    my ($self) = @_;
95
    my ($self, $params) = @_;
91
96
92
    # Throw exception if item is still checked out
97
    # Throw exception if item is still checked out
93
    Koha::Exceptions::Item::Transfer::OnLoan->throw() if ( $self->item->checkout );
98
    Koha::Exceptions::Item::Transfer::OnLoan->throw() if ( $self->item->checkout );
Lines 107-113 sub transit { Link Here
107
        }
112
        }
108
    )->store;
113
    )->store;
109
114
110
    ModDateLastSeen( $self->item->itemnumber );
115
    ModDateLastSeen( $self->item->itemnumber, undef, { skip_record_index => $params->{skip_record_index} } );
111
    return $self;
116
    return $self;
112
117
113
}
118
}
114
- 

Return to bug 33739