Lines 490-495
is(
Link Here
|
490 |
q{UpdateNotForLoanStatusOnCheckin does not update notforloan value for specific itemtype from 1 with setting "1: ONLYMESSAGE"} |
490 |
q{UpdateNotForLoanStatusOnCheckin does not update notforloan value for specific itemtype from 1 with setting "1: ONLYMESSAGE"} |
491 |
); |
491 |
); |
492 |
|
492 |
|
|
|
493 |
############################################## |
494 |
# |
495 |
# UpdateNotForLoanStatusOnCheckout |
496 |
# |
497 |
############################################## |
498 |
|
499 |
my $itemnumber4 = Koha::Item->new( |
500 |
{ |
501 |
biblionumber => $biblionumber, |
502 |
barcode => 'barcode_6', |
503 |
itemcallnumber => 'callnumber6', |
504 |
homebranch => $branchcode_1, |
505 |
holdingbranch => $branchcode_1, |
506 |
notforloan => -1, |
507 |
itype => $itemtype, |
508 |
location => 'loc1' |
509 |
}, |
510 |
)->store->itemnumber; |
511 |
|
512 |
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} ); |
513 |
AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
514 |
$item = Koha::Items->find( $itemnumber4 ); |
515 |
ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' ); |
516 |
|
517 |
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' ); |
518 |
AddReturn( 'barcode_6', $branchcode_1 ); |
519 |
my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
520 |
$item = Koha::Items->find( $itemnumber4 ); |
521 |
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} ); |
522 |
|
523 |
AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
524 |
AddReturn( 'barcode_6', $branchcode_1 ); |
525 |
$item = Koha::Items->find( $itemnumber4 ); |
526 |
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} ); |
527 |
|
528 |
|
529 |
########################################## |
530 |
# |
531 |
# END UpdateNotforloanOnCheckout |
532 |
# |
533 |
########################################## |
534 |
|
493 |
my $itemnumber2 = Koha::Item->new( |
535 |
my $itemnumber2 = Koha::Item->new( |
494 |
{ |
536 |
{ |
495 |
biblionumber => $biblionumber, |
537 |
biblionumber => $biblionumber, |
Lines 636-670
AddRenewal(
Link Here
|
636 |
my ( $unseen_reset ) = ( C4::Circulation::GetRenewCount( $unseen_patron->borrowernumber, $unseen_item->itemnumber ) )[3]; |
678 |
my ( $unseen_reset ) = ( C4::Circulation::GetRenewCount( $unseen_patron->borrowernumber, $unseen_item->itemnumber ) )[3]; |
637 |
is( $unseen_reset, 0, 'seen renewal resets the unseen count' ); |
679 |
is( $unseen_reset, 0, 'seen renewal resets the unseen count' ); |
638 |
|
680 |
|
639 |
my $itemnumber4 = Koha::Item->new( |
|
|
640 |
{ |
641 |
biblionumber => $biblionumber, |
642 |
barcode => 'barcode_6', |
643 |
itemcallnumber => 'callnumber6', |
644 |
homebranch => $branchcode_1, |
645 |
holdingbranch => $branchcode_1, |
646 |
notforloan => -1, |
647 |
itype => $itemtype, |
648 |
location => 'loc1' |
649 |
}, |
650 |
)->store->itemnumber; |
651 |
|
652 |
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', q{} ); |
653 |
AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
654 |
$item = Koha::Items->find( $itemnumber4 ); |
655 |
ok( $item->notforloan eq -1, 'UpdateNotForLoanStatusOnCheckout does not modify value when not enabled' ); |
656 |
|
657 |
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckout', '-1: 0' ); |
658 |
AddReturn( 'barcode_6', $branchcode_1 ); |
659 |
my $test = AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
660 |
$item = Koha::Items->find( $itemnumber4 ); |
661 |
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout updates notforloan value from -1 to 0 with setting "-1: 0"} ); |
662 |
|
663 |
AddIssue( $patron_2, 'barcode_6', dt_from_string ); |
664 |
AddReturn( 'barcode_6', $branchcode_1 ); |
665 |
$item = Koha::Items->find( $itemnumber4 ); |
666 |
ok( $item->notforloan eq 0, q{UpdateNotForLoanStatusOnCheckout does not update notforloan value from 0 with setting "-1: 0"} ); |
667 |
|
668 |
# Bug 21159 - Update item shelving location on checkout |
681 |
# Bug 21159 - Update item shelving location on checkout |
669 |
my $itemnumber5 = Koha::Item->new( |
682 |
my $itemnumber5 = Koha::Item->new( |
670 |
{ |
683 |
{ |
671 |
- |
|
|