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

(-)a/C4/Circulation.pm (-1 / +2 lines)
Lines 3541-3547 sub updateWrongTransfer { Link Here
3541
            reason        => $transfer->reason,
3541
            reason        => $transfer->reason,
3542
            comment       => $transfer->comments,
3542
            comment       => $transfer->comments,
3543
            ignore_limits => 1,
3543
            ignore_limits => 1,
3544
            enqueue       => 1
3544
            enqueue       => 1,
3545
            send_transfer => 1,
3545
        }
3546
        }
3546
    );
3547
    );
3547
3548
(-)a/Koha/Item.pm (+1 lines)
Lines 464-469 sub request_transfer { Link Here
464
        {
464
        {
465
            itemnumber    => $self->itemnumber,
465
            itemnumber    => $self->itemnumber,
466
            daterequested => dt_from_string,
466
            daterequested => dt_from_string,
467
            datesent      => $params->{send_transfer} ? dt_from_string : undef,
467
            frombranch    => $self->holdingbranch,
468
            frombranch    => $self->holdingbranch,
468
            tobranch      => $params->{to}->branchcode,
469
            tobranch      => $params->{to}->branchcode,
469
            reason        => $params->{reason},
470
            reason        => $params->{reason},
(-)a/t/db_dependent/Circulation.t (-1 / +1 lines)
Lines 4912-4918 subtest "updateWrongTransfer tests" => sub { Link Here
4912
4912
4913
    my $new_transfer = C4::Circulation::updateWrongTransfer($item->itemnumber, $library1->branchcode);
4913
    my $new_transfer = C4::Circulation::updateWrongTransfer($item->itemnumber, $library1->branchcode);
4914
    is(ref($new_transfer), 'Koha::Item::Transfer', "updateWrongTransfer returns a 'Koha::Item::Transfer' object");
4914
    is(ref($new_transfer), 'Koha::Item::Transfer', "updateWrongTransfer returns a 'Koha::Item::Transfer' object");
4915
    ok( !$new_transfer->in_transit, "New transfer is NOT created as in transit (or cancelled)");
4915
    ok( $new_transfer->in_transit, "New transfer is created as in transit");
4916
4916
4917
    my $original_transfer = $transfer->get_from_storage;
4917
    my $original_transfer = $transfer->get_from_storage;
4918
    ok( defined($original_transfer->datecancelled), "Original transfer was cancelled");
4918
    ok( defined($original_transfer->datecancelled), "Original transfer was cancelled");
(-)a/t/db_dependent/Koha/Item.t (-2 / +8 lines)
Lines 489-495 subtest 'pickup_locations' => sub { Link Here
489
};
489
};
490
490
491
subtest 'request_transfer' => sub {
491
subtest 'request_transfer' => sub {
492
    plan tests => 13;
492
    plan tests => 15;
493
    $schema->storage->txn_begin;
493
    $schema->storage->txn_begin;
494
494
495
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
495
    my $library1 = $builder->build_object( { class => 'Koha::Libraries' } );
Lines 549-554 subtest 'request_transfer' => sub { Link Here
549
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
549
    is($transfers->count, 1, "There is only 1 live transfer in the queue");
550
    $replaced_transfer->datearrived(dt_from_string)->store();
550
    $replaced_transfer->datearrived(dt_from_string)->store();
551
551
552
    $transfer = $item->request_transfer({ to => $library2, reason => 'Manual' });
553
    ok(!$transfer->datesent, "Transfer not marked as sent by default");
554
    $transfer->datearrived(dt_from_string)->store();
555
    $transfer = $item->request_transfer({ to => $library2, reason => 'Manual', send_transfer => 1 });
556
    ok($transfer->datesent, "Transfer marked as sent if send_transfer is passed");
557
    $transfer->datearrived(dt_from_string)->store();
558
552
    # BranchTransferLimits
559
    # BranchTransferLimits
553
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
560
    t::lib::Mocks::mock_preference('UseBranchTransferLimits', 1);
554
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
561
    t::lib::Mocks::mock_preference('BranchTransferLimitsType', 'itemtype');
555
- 

Return to bug 29792