Lines 80-86
subtest 'Checkout V2' => sub {
Link Here
|
80 |
subtest 'Checkin V2' => sub { |
80 |
subtest 'Checkin V2' => sub { |
81 |
my $schema = Koha::Database->new->schema; |
81 |
my $schema = Koha::Database->new->schema; |
82 |
$schema->storage->txn_begin; |
82 |
$schema->storage->txn_begin; |
83 |
plan tests => 35; |
83 |
plan tests => 39; |
84 |
$C4::SIP::Sip::protocol_version = 2; |
84 |
$C4::SIP::Sip::protocol_version = 2; |
85 |
test_checkin_v2(); |
85 |
test_checkin_v2(); |
86 |
$schema->storage->txn_rollback; |
86 |
$schema->storage->txn_rollback; |
Lines 813-823
sub test_checkin_v2 {
Link Here
|
813 |
$msg->handle_checkin( $server ); |
813 |
$msg->handle_checkin( $server ); |
814 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
814 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
815 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
815 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
816 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); |
|
|
817 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); |
816 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was not checked in"); |
818 |
$hold->delete(); |
817 |
$hold->discard_changes; |
|
|
818 |
is( $hold->found, undef, "Hold was not marked as found by SIP when holds_block_checkin enabled"); |
819 |
$server->{account}->{holds_block_checkin} = 0; |
819 |
$server->{account}->{holds_block_checkin} = 0; |
820 |
|
820 |
|
|
|
821 |
# Test account option holds_get_captured that automatically sets the hold as found for a hold and possibly sets it to in transit |
822 |
$server->{account}->{holds_get_captured} = 0; |
823 |
undef $response; |
824 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
825 |
$msg->handle_checkin( $server ); |
826 |
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' ); |
827 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
828 |
is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 0, "Item was checked in"); |
829 |
$hold->discard_changes; |
830 |
is( $hold->found, undef, "Hold was not marked as found by SIP when holds_get_captured disabled"); |
831 |
$hold->delete(); |
832 |
$server->{account}->{holds_get_captured} = 1; |
821 |
} |
833 |
} |
822 |
|
834 |
|
823 |
sub test_hold_patron_bcode { |
835 |
sub test_hold_patron_bcode { |
824 |
- |
|
|