Lines 2469-2484
subtest 'Cancel transfers on lost items' => sub {
Link Here
|
2469 |
#Check transfer exists and the items holding branch is the transfer destination branch before marking it as lost |
2469 |
#Check transfer exists and the items holding branch is the transfer destination branch before marking it as lost |
2470 |
my ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); |
2470 |
my ($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); |
2471 |
is( $tobranch, $library_2->{branchcode}, 'The transfer record exists in the branchtransfers table'); |
2471 |
is( $tobranch, $library_2->{branchcode}, 'The transfer record exists in the branchtransfers table'); |
2472 |
my $itemcheck = GetItem($item->{itemnumber}); |
2472 |
my $itemcheck = Koha::Items->find($item->{itemnumber}); |
2473 |
is( $itemcheck->{holdingbranch}, $library_2->{branchcode}, 'Items holding branch is the transfers destination branch before it is marked as lost' ); |
2473 |
is( $itemcheck->holdingbranch, $library_2->{branchcode}, 'Items holding branch is the transfers destination branch before it is marked as lost' ); |
2474 |
|
2474 |
|
2475 |
#Simulate item being marked as lost and confirm the transfer is deleted and the items holding branch is the transfers source branch |
2475 |
#Simulate item being marked as lost and confirm the transfer is deleted and the items holding branch is the transfers source branch |
2476 |
ModItem( { itemlost => 1 }, $biblio->{biblionumber}, $item->{itemnumber} ); |
2476 |
ModItem( { itemlost => 1 }, $biblio->{biblionumber}, $item->{itemnumber} ); |
2477 |
LostItem( $item->{itemnumber}, 'test', 1 ); |
2477 |
LostItem( $item->{itemnumber}, 'test', 1 ); |
2478 |
($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); |
2478 |
($datesent,$frombranch,$tobranch) = GetTransfers($item->{itemnumber}); |
2479 |
is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled'); |
2479 |
is( $tobranch, undef, 'The transfer on the lost item has been deleted as the LostItemCancelOutstandingTransfer is enabled'); |
2480 |
$itemcheck = GetItem($item->{itemnumber}); |
2480 |
$itemcheck = Koha::Items->find($item->{itemnumber}); |
2481 |
is( $itemcheck->{holdingbranch}, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' ); |
2481 |
is( $itemcheck->holdingbranch, $library_1->{branchcode}, 'Lost item with cancelled hold has holding branch equallying the transfers source branch' ); |
2482 |
}; |
2482 |
}; |
2483 |
|
2483 |
|
2484 |
subtest 'CanBookBeIssued | is_overdue' => sub { |
2484 |
subtest 'CanBookBeIssued | is_overdue' => sub { |
Lines 2862-2869
subtest 'AddRenewal and AddIssuingCharge tests' => sub {
Link Here
|
2862 |
); |
2862 |
); |
2863 |
my $item = Koha::Items->find( $item_id ); |
2863 |
my $item = Koha::Items->find( $item_id ); |
2864 |
|
2864 |
|
2865 |
my $items = Test::MockModule->new('C4::Items'); |
|
|
2866 |
$items->mock( GetItem => $item->unblessed ); |
2867 |
my $context = Test::MockModule->new('C4::Context'); |
2865 |
my $context = Test::MockModule->new('C4::Context'); |
2868 |
$context->mock( userenv => { branch => $library->id } ); |
2866 |
$context->mock( userenv => { branch => $library->id } ); |
2869 |
|
2867 |
|
2870 |
- |
|
|