Lines 4-10
Link Here
|
4 |
# Current state is very rudimentary. Please help to extend it! |
4 |
# Current state is very rudimentary. Please help to extend it! |
5 |
|
5 |
|
6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
7 |
use Test::More tests => 10; |
7 |
use Test::More tests => 11; |
8 |
|
8 |
|
9 |
use Koha::Database; |
9 |
use Koha::Database; |
10 |
use t::lib::TestBuilder; |
10 |
use t::lib::TestBuilder; |
Lines 20-25
use C4::SIP::ILS::Transaction::Checkin;
Link Here
|
20 |
|
20 |
|
21 |
use C4::Reserves; |
21 |
use C4::Reserves; |
22 |
use Koha::CirculationRules; |
22 |
use Koha::CirculationRules; |
|
|
23 |
use Koha::Item::Transfer; |
23 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
24 |
use Koha::DateUtils qw( dt_from_string output_pref ); |
24 |
|
25 |
|
25 |
my $schema = Koha::Database->new->schema; |
26 |
my $schema = Koha::Database->new->schema; |
Lines 396-399
subtest checkin_withdrawn => sub {
Link Here
|
396 |
$circ = $ils->checkin( $item->barcode, C4::SIP::Sip::timestamp ); |
397 |
$circ = $ils->checkin( $item->barcode, C4::SIP::Sip::timestamp ); |
397 |
is( $circ->{screen_msg}, 'Item not checked out', "Got 'Item not checked out' screen message" ); |
398 |
is( $circ->{screen_msg}, 'Item not checked out', "Got 'Item not checked out' screen message" ); |
398 |
}; |
399 |
}; |
|
|
400 |
|
401 |
subtest item_circulation_status => sub { |
402 |
plan tests => 2; |
403 |
|
404 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
405 |
my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); |
406 |
|
407 |
my $patron = $builder->build_object( |
408 |
{ |
409 |
class => 'Koha::Patrons', |
410 |
value => { |
411 |
branchcode => $library->branchcode, |
412 |
} |
413 |
} |
414 |
); |
415 |
|
416 |
t::lib::Mocks::mock_userenv( |
417 |
{ branchcode => $library->branchcode, flags => 1 } ); |
418 |
|
419 |
my $item = $builder->build_sample_item( |
420 |
{ |
421 |
library => $library->branchcode, |
422 |
} |
423 |
); |
424 |
|
425 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
426 |
my $status = $sip_item->sip_circulation_status; |
427 |
is( $status, '03', "Item circulation status is available"); |
428 |
|
429 |
my $transfer = Koha::Item::Transfer->new({ |
430 |
itemnumber => $item->id, |
431 |
datesent => '2020-01-01', |
432 |
frombranch => $library->branchcode, |
433 |
tobranch => $library2->branchcode, |
434 |
})->store(); |
435 |
|
436 |
$sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
437 |
$status = $sip_item->sip_circulation_status; |
438 |
is( $status, '10', "Item circulation status is in transit" ); |
439 |
}; |
399 |
$schema->storage->txn_rollback; |
440 |
$schema->storage->txn_rollback; |
400 |
- |
|
|