Lines 317-327
sub test_checkin_v2 {
Link Here
|
317 |
my $card1 = $patron1->{cardnumber}; |
317 |
my $card1 = $patron1->{cardnumber}; |
318 |
my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); |
318 |
my $sip_patron1 = C4::SIP::ILS::Patron->new( $card1 ); |
319 |
$findpatron = $sip_patron1; |
319 |
$findpatron = $sip_patron1; |
320 |
my $item = $builder->build({ |
320 |
my $item_object = $builder->build_sample_item({ |
321 |
source => 'Item', |
321 |
damaged => 0, |
322 |
value => { damaged => 0, withdrawn => 0, itemlost => 0, restricted => 0, homebranch => $branchcode, holdingbranch => $branchcode }, |
322 |
withdrawn => 0, |
|
|
323 |
itemlost => 0, |
324 |
restricted => 0, |
325 |
homebranch => $branchcode, |
326 |
holdingbranch => $branchcode, |
323 |
}); |
327 |
}); |
324 |
my $item_object = Koha::Items->find( $item->{itemnumber} ); |
|
|
325 |
|
328 |
|
326 |
my $mockILS = $mocks->{ils}; |
329 |
my $mockILS = $mocks->{ils}; |
327 |
my $server = { ils => $mockILS, account => {} }; |
330 |
my $server = { ils => $mockILS, account => {} }; |
Lines 355-361
sub test_checkin_v2 {
Link Here
|
355 |
$siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . |
358 |
$siprequest = CHECKIN . 'N' . 'YYYYMMDDZZZZHHMMSS' . |
356 |
siprequestdate( $today->clone->add( days => 1) ) . |
359 |
siprequestdate( $today->clone->add( days => 1) ) . |
357 |
FID_INST_ID . $branchcode . '|'. |
360 |
FID_INST_ID . $branchcode . '|'. |
358 |
FID_ITEM_ID . $item->{barcode} . '|' . |
361 |
FID_ITEM_ID . $item_object->barcode . '|' . |
359 |
FID_TERMINAL_PWD . 'ignored' . '|'; |
362 |
FID_TERMINAL_PWD . 'ignored' . '|'; |
360 |
undef $response; |
363 |
undef $response; |
361 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
364 |
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 ); |
Lines 434-440
sub test_checkin_v2 {
Link Here
|
434 |
$server->{account}->{ct_always_send} = 0; |
437 |
$server->{account}->{ct_always_send} = 0; |
435 |
|
438 |
|
436 |
# Checkin at wrong branch: issue item and switch branch, and checkin |
439 |
# Checkin at wrong branch: issue item and switch branch, and checkin |
437 |
my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item->{itemnumber} })->store; |
440 |
my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item_object->itemnumber })->store; |
438 |
$branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
441 |
$branchcode = $builder->build({ source => 'Branch' })->{branchcode}; |
439 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'homebranch' ); |
442 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'homebranch' ); |
440 |
undef $response; |
443 |
undef $response; |
Lines 443-449
sub test_checkin_v2 {
Link Here
|
443 |
is( substr($response,2,1), '0', 'OK flag is false when we check in at the wrong branch and we do not allow it' ); |
446 |
is( substr($response,2,1), '0', 'OK flag is false when we check in at the wrong branch and we do not allow it' ); |
444 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
447 |
is( substr($response,5,1), 'Y', 'Alert flag is set' ); |
445 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Checkin failed', 'Check screen msg' ); |
448 |
check_field( $respcode, $response, FID_SCREEN_MSG, 'Checkin failed', 'Check screen msg' ); |
446 |
$branchcode = $item->{homebranch}; # switch back |
449 |
$branchcode = $item_object->homebranch; # switch back |
447 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
450 |
t::lib::Mocks::mock_preference( 'AllowReturnToBranch', 'anywhere' ); |
448 |
|
451 |
|
449 |
# Data corrupted: add same issue_id to old_issues |
452 |
# Data corrupted: add same issue_id to old_issues |