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 1077-1082
sub test_checkin_v2 {
Link Here
|
1077 |
$item_object->holdingbranch( $branchcode )->store(); |
1077 |
$item_object->holdingbranch( $branchcode )->store(); |
1078 |
t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' ); |
1078 |
t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' ); |
1079 |
|
1079 |
|
|
|
1080 |
# Change homebranch to trigger NeedsTransfer response (with and without automatic item return) |
1081 |
t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 0 ); |
1082 |
$item_object->homebranch($branchcode2)->store(); |
1083 |
undef $response; |
1084 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1085 |
$msg->handle_checkin($server); |
1086 |
check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got CV 04' ); |
1087 |
check_field( |
1088 |
$respcode, $response, FID_SCREEN_MSG, 'This item must still be transferred', 'Check screen msg', |
1089 |
'regex' |
1090 |
); |
1091 |
is( $item_object->transfer, undef, 'No transfer was started' ); |
1092 |
t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 1 ); |
1093 |
undef $response; |
1094 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1095 |
$msg->handle_checkin($server); |
1096 |
check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got CV 04' ); |
1097 |
check_field( $respcode, $response, FID_SCREEN_MSG, undef, 'No screen msg' ); |
1098 |
isnt( $item_object->transfer, undef, 'A transfer was started' ); |
1099 |
$item_object->transfer->delete; |
1100 |
$item_object->homebranch($branchcode)->store(); |
1101 |
|
1080 |
$server->{account}->{cv_send_00_on_success} = 0; |
1102 |
$server->{account}->{cv_send_00_on_success} = 0; |
1081 |
undef $response; |
1103 |
undef $response; |
1082 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1104 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
1083 |
- |
|
|