Lines 29-34
use Test::Warn;
Link Here
|
29 |
use t::lib::Mocks; |
29 |
use t::lib::Mocks; |
30 |
use t::lib::TestBuilder; |
30 |
use t::lib::TestBuilder; |
31 |
|
31 |
|
|
|
32 |
use C4::Reserves qw(AddReserve); |
32 |
use Koha::Database; |
33 |
use Koha::Database; |
33 |
use Koha::AuthUtils qw(hash_password); |
34 |
use Koha::AuthUtils qw(hash_password); |
34 |
use Koha::DateUtils; |
35 |
use Koha::DateUtils; |
Lines 36-41
use Koha::Items;
Link Here
|
36 |
use Koha::Checkouts; |
37 |
use Koha::Checkouts; |
37 |
use Koha::Old::Checkouts; |
38 |
use Koha::Old::Checkouts; |
38 |
use Koha::Patrons; |
39 |
use Koha::Patrons; |
|
|
40 |
use Koha::Holds; |
39 |
|
41 |
|
40 |
use C4::SIP::ILS; |
42 |
use C4::SIP::ILS; |
41 |
use C4::SIP::ILS::Patron; |
43 |
use C4::SIP::ILS::Patron; |
Lines 67-73
subtest 'Testing Patron Info Request V2' => sub {
Link Here
|
67 |
subtest 'Checkin V2' => sub { |
69 |
subtest 'Checkin V2' => sub { |
68 |
my $schema = Koha::Database->new->schema; |
70 |
my $schema = Koha::Database->new->schema; |
69 |
$schema->storage->txn_begin; |
71 |
$schema->storage->txn_begin; |
70 |
plan tests => 29; |
72 |
plan tests => 33; |
71 |
$C4::SIP::Sip::protocol_version = 2; |
73 |
$C4::SIP::Sip::protocol_version = 2; |
72 |
test_checkin_v2(); |
74 |
test_checkin_v2(); |
73 |
$schema->storage->txn_rollback; |
75 |
$schema->storage->txn_rollback; |
Lines 596-601
sub test_checkin_v2 {
Link Here
|
596 |
is( substr($response,5,1), 'N', 'Alert flag is not set' ); |
598 |
is( substr($response,5,1), 'N', 'Alert flag is not set' ); |
597 |
is( Koha::Checkouts->find( $issue->issue_id ), undef, |
599 |
is( Koha::Checkouts->find( $issue->issue_id ), undef, |
598 |
'Issue record is gone now' ); |
600 |
'Issue record is gone now' ); |
|
|
601 |
|
602 |
# Test account option no_holds_check that prevents items on hold from being checked in via SIP |
603 |
Koha::Old::Checkouts->search({ issue_id => $issue->issue_id })->delete; |
604 |
$server->{account}->{no_holds_checkin} = 1; |
605 |
my $reserve_id = AddReserve({ |
606 |
branchcode => $branchcode, |
607 |
borrowernumber => $patron1->{borrowernumber}, |
608 |
biblionumber => $item_object->biblionumber, |
609 |
priority => 1, |
610 |
}); |
611 |
my $hold = Koha::Holds->find( $reserve_id ); |
612 |
is( $hold->id, $reserve_id, "Hold was created successfully" ); |
613 |
undef $response; |
614 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
615 |
$msg->handle_checkin( $server ); |
616 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
617 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
618 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); |
619 |
$hold->delete(); |
620 |
$server->{account}->{no_holds_checkin} = 0; |
621 |
|
599 |
} |
622 |
} |
600 |
|
623 |
|
601 |
sub test_hold_patron_bcode { |
624 |
sub test_hold_patron_bcode { |
602 |
- |
|
|