Lines 98-104
subtest 'Test renew desensitize' => sub {
Link Here
|
98 |
subtest 'Checkin V2' => sub { |
98 |
subtest 'Checkin V2' => sub { |
99 |
my $schema = Koha::Database->new->schema; |
99 |
my $schema = Koha::Database->new->schema; |
100 |
$schema->storage->txn_begin; |
100 |
$schema->storage->txn_begin; |
101 |
plan tests => 35; |
101 |
plan tests => 39; |
102 |
$C4::SIP::Sip::protocol_version = 2; |
102 |
$C4::SIP::Sip::protocol_version = 2; |
103 |
test_checkin_v2(); |
103 |
test_checkin_v2(); |
104 |
$schema->storage->txn_rollback; |
104 |
$schema->storage->txn_rollback; |
Lines 831-841
sub test_checkin_v2 {
Link Here
|
831 |
$msg->handle_checkin( $server ); |
831 |
$msg->handle_checkin( $server ); |
832 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
832 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
833 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
833 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
834 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); |
|
|
835 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); |
834 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); |
836 |
$hold->delete(); |
835 |
$hold->discard_changes; |
|
|
836 |
is( $hold->found, undef, "Hold was not marked as found by SIP when holds_block_checkin enabled"); |
837 |
$server->{account}->{holds_block_checkin} = 0; |
837 |
$server->{account}->{holds_block_checkin} = 0; |
838 |
|
838 |
|
|
|
839 |
# Test account option holds_get_captured that automatically sets the hold as found for a hold and possibly sets it to in transit |
840 |
$server->{account}->{holds_get_captured} = 0; |
841 |
undef $response; |
842 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
843 |
$msg->handle_checkin( $server ); |
844 |
is( substr($response,2,1), '1', 'OK flag is true when we check in an item on hold and we allow it but do not capture it' ); |
845 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
846 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 0, "Item was checked in"); |
847 |
$hold->discard_changes; |
848 |
is( $hold->found, undef, "Hold was not marked as found by SIP when holds_get_captured disabled"); |
849 |
$hold->delete(); |
850 |
$server->{account}->{holds_get_captured} = 1; |
839 |
} |
851 |
} |
840 |
|
852 |
|
841 |
sub test_hold_patron_bcode { |
853 |
sub test_hold_patron_bcode { |
842 |
- |
|
|