my $item = Koha::Items->find($itemnumber);
my $transfers = $item->get_transfers;
while (my $transfer = $transfers->next) {
$transfer->cancel({ reason => 'ItemLost', force => 1 });
$transfer->cancel({ reason => 'ItemLost', force => 1, replace => 1 });
}
-