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 542-547
sub test_checkin_v2 {
Link Here
|
542 |
is( substr($response,5,1), 'N', 'Alert flag is not set' ); |
544 |
is( substr($response,5,1), 'N', 'Alert flag is not set' ); |
543 |
is( Koha::Checkouts->find( $issue->issue_id ), undef, |
545 |
is( Koha::Checkouts->find( $issue->issue_id ), undef, |
544 |
'Issue record is gone now' ); |
546 |
'Issue record is gone now' ); |
|
|
547 |
|
548 |
# Test account option no_holds_check that prevents items on hold from being checked in via SIP |
549 |
Koha::Old::Checkouts->search({ issue_id => $issue->issue_id })->delete; |
550 |
$server->{account}->{no_holds_checkin} = 1; |
551 |
my $reserve_id = AddReserve({ |
552 |
branchcode => $branchcode, |
553 |
borrowernumber => $patron1->{borrowernumber}, |
554 |
biblionumber => $item_object->biblionumber, |
555 |
priority => 1, |
556 |
}); |
557 |
my $hold = Koha::Holds->find( $reserve_id ); |
558 |
is( $hold->id, $reserve_id, "Hold was created successfully" ); |
559 |
undef $response; |
560 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
561 |
$msg->handle_checkin( $server ); |
562 |
is( substr($response,2,1), '0', 'OK flag is false when we check in an item on hold and we do not allow it' ); |
563 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
564 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Item is on hold, please return to circulation desk', 'Screen message is correct' ); |
565 |
$hold->delete(); |
566 |
$server->{account}->{no_holds_checkin} = 0; |
567 |
|
545 |
} |
568 |
} |
546 |
|
569 |
|
547 |
sub test_hold_patron_bcode { |
570 |
sub test_hold_patron_bcode { |
548 |
- |
|
|