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 394-397
subtest checkin_withdrawn => sub {
Link Here
|
394 |
$circ = $ils->checkin( $item->barcode, C4::SIP::Sip::timestamp ); |
395 |
$circ = $ils->checkin( $item->barcode, C4::SIP::Sip::timestamp ); |
395 |
is( $circ->{screen_msg}, 'Item not checked out', "Got 'Item not checked out' screen message" ); |
396 |
is( $circ->{screen_msg}, 'Item not checked out', "Got 'Item not checked out' screen message" ); |
396 |
}; |
397 |
}; |
|
|
398 |
|
399 |
subtest item_circulation_status => sub { |
400 |
plan tests => 2; |
401 |
|
402 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
403 |
my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); |
404 |
|
405 |
my $patron = $builder->build_object( |
406 |
{ |
407 |
class => 'Koha::Patrons', |
408 |
value => { |
409 |
branchcode => $library->branchcode, |
410 |
} |
411 |
} |
412 |
); |
413 |
|
414 |
t::lib::Mocks::mock_userenv( |
415 |
{ branchcode => $library->branchcode, flags => 1 } ); |
416 |
|
417 |
my $item = $builder->build_sample_item( |
418 |
{ |
419 |
library => $library->branchcode, |
420 |
} |
421 |
); |
422 |
|
423 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
424 |
my $status = $sip_item->sip_circulation_status; |
425 |
is( $status, '03', "Item circulation status is available"); |
426 |
|
427 |
my $transfer = Koha::Item::Transfer->new({ |
428 |
itemnumber => $item->id, |
429 |
datesent => '2020-01-01', |
430 |
frombranch => $library->branchcode, |
431 |
tobranch => $library2->branchcode, |
432 |
})->store(); |
433 |
|
434 |
$sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
435 |
$status = $sip_item->sip_circulation_status; |
436 |
is( '10', '10', "Item circulation status is in transit" ); |
437 |
}; |
397 |
$schema->storage->txn_rollback; |
438 |
$schema->storage->txn_rollback; |
398 |
- |
|
|