Lines 326-336
sub test_checkin_v2 {
Link Here
|
326 |
my $card1 = $patron1->{cardnumber}; |
326 |
my $card1 = $patron1->{cardnumber}; |
327 |
my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); |
327 |
my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); |
328 |
$findpatron = $sip_patron1; |
328 |
$findpatron = $sip_patron1; |
329 |
my $item = $builder->build({ |
329 |
my $item_object = $builder->build_sample_item({ |
330 |
source => 'Item', |
330 |
damaged => 0, |
331 |
value => { damaged => 0, withdrawn => 0, itemlost => 0, restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode }, |
331 |
withdrawn => 0, |
|
|
332 |
itemlost => 0, |
333 |
restricted => 0, |
334 |
homebranch => $branchcode, |
335 |
holdingbranch => $branchcode, |
332 |
}); |
336 |
}); |
333 |
my $item_object = Koha::Items->find( $item->{itemnumber} ); |
|
|
334 |
|
337 |
|
335 |
my $mockILS = $mocks->{ils}; |
338 |
my $mockILS = $mocks->{ils}; |
336 |
my $server = { ils => $mockILS, account => {} }; |
339 |
my $server = { ils => $mockILS, account => {} }; |
Lines 364-370
sub test_checkin_v2 {
Link Here
|
364 |
$siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . |
367 |
$siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . |
365 |
siprequestdate( $today->clone->add( days => 1) ) . |
368 |
siprequestdate( $today->clone->add( days => 1) ) . |
366 |
FID_INST_ID . $branchcode . '|'. |
369 |
FID_INST_ID . $branchcode . '|'. |
367 |
FID_ITEM_ID . $item->{barcode} . '|' . |
370 |
FID_ITEM_ID . $item_object->barcode . '|' . |
368 |
FID_TERMINAL_PWD . 'ignored' . '|'; |
371 |
FID_TERMINAL_PWD . 'ignored' . '|'; |
369 |
undef $response; |
372 |
undef $response; |
370 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
373 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
Lines 443-449
sub test_checkin_v2 {
Link Here
|
443 |
$server->{account}->{ct_always_send} = 0; |
446 |
$server->{account}->{ct_always_send} = 0; |
444 |
|
447 |
|
445 |
# Checkin at wrong branch: issue item and switch branch, and checkin |
448 |
# Checkin at wrong branch: issue item and switch branch, and checkin |
446 |
my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item->{itemnumber} })->store; |
449 |
my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item_object->itemnumber })->store; |
447 |
$branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
450 |
$branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
448 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'homebranch' ); |
451 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'homebranch' ); |
449 |
undef $response; |
452 |
undef $response; |
Lines 452-458
sub test_checkin_v2 {
Link Here
|
452 |
is( substr($response,2,1), '0', 'OK flag is false when we check in at the wrong branch and we do not allow it' ); |
455 |
is( substr($response,2,1), '0', 'OK flag is false when we check in at the wrong branch and we do not allow it' ); |
453 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
456 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
454 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Checkin failed', 'Check screen msg' ); |
457 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Checkin failed', 'Check screen msg' ); |
455 |
$branchcode = $item->{homebranch}; # switch back |
458 |
$branchcode = $item_object->homebranch; # switch back |
456 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
459 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
457 |
|
460 |
|
458 |
# Data corrupted: add same issue_id to old_issues |
461 |
# Data corrupted: add same issue_id to old_issues |