View | Details | Raw Unified | Return to bug 36687
Collapse All | Expand All

(-)a/t/db_dependent/Circulation.t (-11 / +11 lines)
Lines 143-153 my $itemtype = $builder->build( Link Here
143
    {
143
    {
144
        source => 'Itemtype',
144
        source => 'Itemtype',
145
        value  => {
145
        value  => {
146
            notforloan          => undef,
146
            notforloan         => 0,
147
            rentalcharge        => 0,
147
            rentalcharge       => 0,
148
            rentalcharge_daily => 0,
148
            rentalcharge_daily => 0,
149
            defaultreplacecost  => undef,
149
            defaultreplacecost => undef,
150
            processfee          => undef
150
            processfee         => undef
151
        }
151
        }
152
    }
152
    }
153
)->{itemtype};
153
)->{itemtype};
Lines 4650-4656 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4650
    my $itemtype = $builder->build(
4650
    my $itemtype = $builder->build(
4651
        {
4651
        {
4652
            source => 'Itemtype',
4652
            source => 'Itemtype',
4653
            value  => { notforloan => undef, }
4653
            value  => { notforloan => 0, }
4654
        }
4654
        }
4655
    );
4655
    );
4656
    my $item = $builder->build_sample_item(
4656
    my $item = $builder->build_sample_item(
Lines 4684-4690 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4684
        );
4684
        );
4685
4685
4686
        # not for loan at item level
4686
        # not for loan at item level
4687
        Koha::ItemTypes->find( $itemtype->{itemtype} )->notforloan(undef)->store;
4687
        Koha::ItemTypes->find( $itemtype->{itemtype} )->notforloan(0)->store;
4688
        $item->notforloan( 1 )->store;
4688
        $item->notforloan( 1 )->store;
4689
        ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, undef, undef, undef, undef );
4689
        ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, undef, undef, undef, undef );
4690
        is_deeply( $needsconfirmation, {}, 'No confirmation needed, AllowNotForLoanOverride=0' );
4690
        is_deeply( $needsconfirmation, {}, 'No confirmation needed, AllowNotForLoanOverride=0' );
Lines 4704-4710 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4704
        my $itemtype = $builder->build(
4704
        my $itemtype = $builder->build(
4705
            {
4705
            {
4706
                source => 'Itemtype',
4706
                source => 'Itemtype',
4707
                value  => { notforloan => undef, }
4707
                value  => { notforloan => 0, }
4708
            }
4708
            }
4709
        );
4709
        );
4710
4710
Lines 4726-4732 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4726
        );
4726
        );
4727
4727
4728
        # not for loan at item level
4728
        # not for loan at item level
4729
        Koha::ItemTypes->find( $itemtype->{itemtype} )->notforloan(undef)->store;
4729
        Koha::ItemTypes->find( $itemtype->{itemtype} )->notforloan(0)->store;
4730
        $item->notforloan( 1 )->store;
4730
        $item->notforloan( 1 )->store;
4731
        ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, undef, undef, undef, undef );
4731
        ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, undef, undef, undef, undef );
4732
        is_deeply( $needsconfirmation, {}, 'No confirmation needed, AllowNotForLoanOverride=0' );
4732
        is_deeply( $needsconfirmation, {}, 'No confirmation needed, AllowNotForLoanOverride=0' );
Lines 5191-5197 subtest 'Incremented fee tests' => sub { Link Here
5191
        {
5191
        {
5192
            class => 'Koha::ItemTypes',
5192
            class => 'Koha::ItemTypes',
5193
            value => {
5193
            value => {
5194
                notforloan                   => undef,
5194
                notforloan                   => 0,
5195
                rentalcharge                 => 0,
5195
                rentalcharge                 => 0,
5196
                rentalcharge_daily           => 1,
5196
                rentalcharge_daily           => 1,
5197
                rentalcharge_daily_calendar  => 0
5197
                rentalcharge_daily_calendar  => 0
Lines 5456-5463 subtest 'CanBookBeIssued & RentalFeesCheckoutConfirmation' => sub { Link Here
5456
        {
5456
        {
5457
            class => 'Koha::ItemTypes',
5457
            class => 'Koha::ItemTypes',
5458
            value => {
5458
            value => {
5459
                notforloan             => 0,
5459
                notforloan         => 0,
5460
                rentalcharge           => 0,
5460
                rentalcharge       => 0,
5461
                rentalcharge_daily => 0
5461
                rentalcharge_daily => 0
5462
            }
5462
            }
5463
        }
5463
        }
(-)a/t/db_dependent/Circulation/issue.t (-4 / +6 lines)
Lines 73-85 $dbh->do(q|DELETE FROM statistics|); Link Here
73
73
74
# Generate sample datas
74
# Generate sample datas
75
my $itemtype = $builder->build(
75
my $itemtype = $builder->build(
76
    {   source => 'Itemtype',
76
    {
77
        value  => { notforloan => undef, rentalcharge => 0 }
77
        source => 'Itemtype',
78
        value  => { notforloan => 0, rentalcharge => 0 }
78
    }
79
    }
79
)->{itemtype};
80
)->{itemtype};
80
my $itemtype2 = $builder->build(
81
my $itemtype2 = $builder->build(
81
    {   source => 'Itemtype',
82
    {
82
        value  => { notforloan => undef }
83
        source => 'Itemtype',
84
        value  => { notforloan => 0 }
83
    }
85
    }
84
)->{itemtype};
86
)->{itemtype};
85
my $branchcode_1 = $builder->build({ source => 'Branch' })->{branchcode};
87
my $branchcode_1 = $builder->build({ source => 'Branch' })->{branchcode};
(-)a/t/db_dependent/CourseReserves.t (-2 / +1 lines)
Lines 35-42 $schema->storage->txn_begin; Link Here
35
my $builder = t::lib::TestBuilder->new;
35
my $builder = t::lib::TestBuilder->new;
36
36
37
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
37
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
38
my $itemtype = $builder->build(
38
my $itemtype = $builder->build( { source => 'Itemtype', value => { notforloan => 0 } } )->{itemtype};
39
    { source => 'Itemtype', value => { notforloan => undef } } )->{itemtype};
40
39
41
# Create 10 sample borrowers
40
# Create 10 sample borrowers
42
my @borrowers = ();
41
my @borrowers = ();
(-)a/t/db_dependent/Holds/LocalHoldsPriority.t (-2 / +3 lines)
Lines 32-39 my $library2 = $builder->build({ source => 'Branch', }); Link Here
32
my $library3 = $builder->build({ source => 'Branch', });
32
my $library3 = $builder->build({ source => 'Branch', });
33
my $library4 = $builder->build({ source => 'Branch', });
33
my $library4 = $builder->build({ source => 'Branch', });
34
my $itemtype = $builder->build(
34
my $itemtype = $builder->build(
35
    {   source => 'Itemtype',
35
    {
36
        value  => { notforloan => undef, rentalcharge => 0 }
36
        source => 'Itemtype',
37
        value  => { notforloan => 0, rentalcharge => 0 }
37
    }
38
    }
38
)->{itemtype};
39
)->{itemtype};
39
40
(-)a/t/db_dependent/Holds/RevertWaitingStatus.t (-2 / +1 lines)
Lines 38-45 $dbh->do("DELETE FROM reserves"); Link Here
38
$dbh->do("DELETE FROM old_reserves");
38
$dbh->do("DELETE FROM old_reserves");
39
39
40
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
40
my $branchcode = $builder->build( { source => 'Branch' } )->{branchcode};
41
my $itemtype = $builder->build(
41
my $itemtype = $builder->build( { source => 'Itemtype', value => { notforloan => 0 } } )->{itemtype};
42
    { source => 'Itemtype', value => { notforloan => undef } } )->{itemtype};
43
42
44
t::lib::Mocks::mock_userenv({ flags => 1, userid => '1', branchcode => $branchcode });
43
t::lib::Mocks::mock_userenv({ flags => 1, userid => '1', branchcode => $branchcode });
45
44
(-)a/t/db_dependent/Koha/Items.t (-4 / +4 lines)
Lines 268-274 subtest 'store' => sub { Link Here
268
            {
268
            {
269
                class => 'Koha::ItemTypes',
269
                class => 'Koha::ItemTypes',
270
                value => {
270
                value => {
271
                    notforloan         => undef,
271
                    notforloan         => 0,
272
                    rentalcharge       => 0,
272
                    rentalcharge       => 0,
273
                    defaultreplacecost => undef,
273
                    defaultreplacecost => undef,
274
                    processfee         => $processfee_amount,
274
                    processfee         => $processfee_amount,
Lines 791-797 subtest 'store' => sub { Link Here
791
                {
791
                {
792
                    class => 'Koha::ItemTypes',
792
                    class => 'Koha::ItemTypes',
793
                    value => {
793
                    value => {
794
                        notforloan         => undef,
794
                        notforloan         => 0,
795
                        rentalcharge       => 0,
795
                        rentalcharge       => 0,
796
                        defaultreplacecost => undef,
796
                        defaultreplacecost => undef,
797
                        processfee         => 0,
797
                        processfee         => 0,
Lines 915-921 subtest 'store' => sub { Link Here
915
                {
915
                {
916
                    class => 'Koha::ItemTypes',
916
                    class => 'Koha::ItemTypes',
917
                    value => {
917
                    value => {
918
                        notforloan         => undef,
918
                        notforloan         => 0,
919
                        rentalcharge       => 0,
919
                        rentalcharge       => 0,
920
                        defaultreplacecost => undef,
920
                        defaultreplacecost => undef,
921
                        processfee         => 0,
921
                        processfee         => 0,
Lines 1290-1296 subtest 'store' => sub { Link Here
1290
                {
1290
                {
1291
                    class => 'Koha::ItemTypes',
1291
                    class => 'Koha::ItemTypes',
1292
                    value => {
1292
                    value => {
1293
                        notforloan         => undef,
1293
                        notforloan         => 0,
1294
                        rentalcharge       => 0,
1294
                        rentalcharge       => 0,
1295
                        defaultreplacecost => undef,
1295
                        defaultreplacecost => undef,
1296
                        processfee         => 0,
1296
                        processfee         => 0,
(-)a/t/db_dependent/Labels/t_Label.t (-1 / +1 lines)
Lines 54-60 my $branch_1 = $builder->build( { source => 'Branch' } )->{branchcode}; Link Here
54
my $category_1 = $builder->build( { source => 'Category' } )->{categorycode};
54
my $category_1 = $builder->build( { source => 'Category' } )->{categorycode};
55
55
56
# Add an item type
56
# Add an item type
57
my $itemtype = $builder->build( { source => 'Itemtype', value => { notforloan => undef } } )->{itemtype};
57
my $itemtype = $builder->build( { source => 'Itemtype', value => { notforloan => 0 } } )->{itemtype};
58
58
59
t::lib::Mocks::mock_userenv( { branchcode => $branch_1 } );
59
t::lib::Mocks::mock_userenv( { branchcode => $branch_1 } );
60
60
(-)a/t/db_dependent/Reserves.t (-2 / +1 lines)
Lines 79-86 my $branch_3 = $builder->build({ source => 'Branch' })->{ branchcode }; Link Here
79
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode };
79
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode };
80
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode };
80
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode };
81
# Add an item type
81
# Add an item type
82
my $itemtype = $builder->build(
82
my $itemtype = $builder->build( { source => 'Itemtype', value => { notforloan => 0 } } )->{itemtype};
83
    { source => 'Itemtype', value => { notforloan => undef } } )->{itemtype};
84
83
85
t::lib::Mocks::mock_userenv({ branchcode => $branch_1 });
84
t::lib::Mocks::mock_userenv({ branchcode => $branch_1 });
86
85
(-)a/t/db_dependent/api/v1/items.t (-2 / +1 lines)
Lines 333-339 subtest 'get() tests' => sub { Link Here
333
      ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' )
333
      ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' )
334
      ->json_is( '/effective_not_for_loan_status' => 2, 'effective_not_for_loan_status now picks up itemtype level - item-level_itypes:1' );
334
      ->json_is( '/effective_not_for_loan_status' => 2, 'effective_not_for_loan_status now picks up itemtype level - item-level_itypes:1' );
335
335
336
    $itype->notforloan(undef)->store();
336
    $itype->notforloan(0)->store();
337
    $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber )->status_is( 200, 'SWAGGER3.2.2' )
337
    $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber )->status_is( 200, 'SWAGGER3.2.2' )
338
        ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' )->json_is(
338
        ->json_is( '/not_for_loan_status' => 0, 'not_for_loan_status is 0' )->json_is(
339
        '/effective_not_for_loan_status' => 0,
339
        '/effective_not_for_loan_status' => 0,
340
- 

Return to bug 36687