Lines 267-273
subtest "Tests for needs_advancing." => sub {
Link Here
|
267 |
)->store; |
267 |
)->store; |
268 |
is($dbitem->needs_advancing, 1, "Ready to be advanced."); |
268 |
is($dbitem->needs_advancing, 1, "Ready to be advanced."); |
269 |
$dbtransfer->delete; |
269 |
$dbtransfer->delete; |
270 |
warning_is {$dbitem->needs_advancing} "We have no historical branch transfer for itemnumber " . $dbitem->item->itemnumber . "; This should not have happened!", "Missing transfer is warned."; |
270 |
warning_is {$dbitem->needs_advancing} "We have no historical branch transfer for item " . $dbitem->item->itemnumber . "; This should not have happened!", "Missing transfer is warned."; |
271 |
|
271 |
|
272 |
$schema->storage->txn_rollback; |
272 |
$schema->storage->txn_rollback; |
273 |
}; |
273 |
}; |
Lines 469-481
subtest "Tests for advance." => sub {
Link Here
|
469 |
class => 'Koha::Checkouts', |
469 |
class => 'Koha::Checkouts', |
470 |
value => { |
470 |
value => { |
471 |
branchcode => $srstage_1->branchcode_id, |
471 |
branchcode => $srstage_1->branchcode_id, |
472 |
itemnumber => $sritem_1->itemnumber->itemnumber, |
472 |
itemnumber => $sritem_1->item->itemnumber, |
473 |
returndate => undef |
473 |
returndate => undef |
474 |
} |
474 |
} |
475 |
}); |
475 |
}); |
476 |
$sritem_1->itemnumber->holdingbranch($srstage_1->branchcode_id)->store; |
476 |
$sritem_1->item->holdingbranch($srstage_1->branchcode_id)->store; |
477 |
ok($sritem_1->advance, "Advancement done."); |
477 |
ok($sritem_1->advance, "Advancement done."); |
478 |
$transfer_request = $sritem_1->itemnumber->get_transfer; |
478 |
$transfer_request = $sritem_1->item->get_transfer; |
479 |
is($transfer_request->frombranch, $srstage_1->branchcode_id, "Origin correct."); |
479 |
is($transfer_request->frombranch, $srstage_1->branchcode_id, "Origin correct."); |
480 |
is($transfer_request->tobranch, $srstage_1->branchcode_id, "Target correct."); |
480 |
is($transfer_request->tobranch, $srstage_1->branchcode_id, "Target correct."); |
481 |
is($transfer_request->datesent, undef, "Transfer waiting to initiate until return."); |
481 |
is($transfer_request->datesent, undef, "Transfer waiting to initiate until return."); |
Lines 484-490
subtest "Tests for advance." => sub {
Link Here
|
484 |
$sritem_1->advance; #advance back to second stage |
484 |
$sritem_1->advance; #advance back to second stage |
485 |
# Set arrived |
485 |
# Set arrived |
486 |
$transfer_request->datearrived(dt_from_string())->store; |
486 |
$transfer_request->datearrived(dt_from_string())->store; |
487 |
$sritem_1->itemnumber->holdingbranch($srstage_2->branchcode_id)->store; |
487 |
$sritem_1->item->holdingbranch($srstage_2->branchcode_id)->store; |
488 |
|
488 |
|
489 |
|
489 |
|
490 |
$srstage_1->rota->cyclical(0)->store; # Set Rota to non-cyclical. |
490 |
$srstage_1->rota->cyclical(0)->store; # Set Rota to non-cyclical. |