Lines 108-114
subtest 'Test renew desensitize' => sub {
Link Here
|
108 |
subtest 'Checkin V2' => sub { |
108 |
subtest 'Checkin V2' => sub { |
109 |
my $schema = Koha::Database->new->schema; |
109 |
my $schema = Koha::Database->new->schema; |
110 |
$schema->storage->txn_begin; |
110 |
$schema->storage->txn_begin; |
111 |
plan tests => 40; |
111 |
plan tests => 46; |
112 |
$C4::SIP::Sip::protocol_version = 2; |
112 |
$C4::SIP::Sip::protocol_version = 2; |
113 |
test_checkin_v2(); |
113 |
test_checkin_v2(); |
114 |
$schema->storage->txn_rollback; |
114 |
$schema->storage->txn_rollback; |
Lines 1461-1466
sub test_checkin_v2 {
Link Here
|
1461 |
$item_object->holdingbranch($branchcode)->store(); |
1461 |
$item_object->holdingbranch($branchcode)->store(); |
1462 |
t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' ); |
1462 |
t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' ); |
1463 |
|
1463 |
|
|
|
1464 |
# Change homebranch to trigger NeedsTransfer response (with and without automatic item return) |
1465 |
t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 0 ); |
1466 |
$item_object->homebranch($branchcode2)->store(); |
1467 |
undef $response; |
1468 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1469 |
$msg->handle_checkin($server); |
1470 |
check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got CV 04' ); |
1471 |
check_field( |
1472 |
$respcode, $response, FID_SCREEN_MSG, 'This item must still be transferred', 'Check screen msg', |
1473 |
'regex' |
1474 |
); |
1475 |
is( $item_object->transfer, undef, 'No transfer was started' ); |
1476 |
t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 1 ); |
1477 |
undef $response; |
1478 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1479 |
$msg->handle_checkin($server); |
1480 |
check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got CV 04' ); |
1481 |
check_field( $respcode, $response, FID_SCREEN_MSG, undef, 'No screen msg' ); |
1482 |
isnt( $item_object->transfer, undef, 'A transfer was started' ); |
1483 |
$item_object->transfer->delete; |
1484 |
$item_object->homebranch($branchcode)->store(); |
1485 |
|
1464 |
$server->{account}->{cv_send_00_on_success} = 0; |
1486 |
$server->{account}->{cv_send_00_on_success} = 0; |
1465 |
undef $response; |
1487 |
undef $response; |
1466 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1488 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1467 |
- |
|
|