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

(-)a/C4/Circulation.pm (-10 / +7 lines)
Lines 3591-3609 This function validate the line of brachtransfer but with the wrong destination Link Here
3591
sub updateWrongTransfer {
3591
sub updateWrongTransfer {
3592
	my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_;
3592
	my ( $itemNumber,$waitingAtLibrary,$FromLibrary ) = @_;
3593
3593
3594
    # first step: cancel the original transfer
3594
    my $to_library = Koha::Libraries->find($waitingAtLibrary);
3595
    my $item = Koha::Items->find($itemNumber);
3596
    my $transfer = $item->get_transfer;
3597
    $transfer->set({ datecancelled => dt_from_string, cancellation_reason => 'WrongTransfer' })->store();
3598
3595
3599
    # second step: create a new transfer to the right location
3596
    # Request a new transfer, replacing the existing one.
3597
    my $item = Koha::Items->find($itemNumber);
3600
    my $new_transfer = $item->request_transfer(
3598
    my $new_transfer = $item->request_transfer(
3601
        {
3599
        {
3602
            to            => $transfer->to_library,
3600
            to            => $to_library,
3603
            reason        => $transfer->reason,
3601
            reason        => 'WrongTransfer',
3604
            comment       => $transfer->comments,
3605
            ignore_limits => 1,
3602
            ignore_limits => 1,
3606
            enqueue       => 1
3603
            replace       => 1,
3604
            force         => 1
3607
        }
3605
        }
3608
    );
3606
    );
3609
3607
3610
- 

Return to bug 28294