Lines 2617-2623
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
2617 |
}; |
2617 |
}; |
2618 |
|
2618 |
|
2619 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2619 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2620 |
plan tests => 27; |
2620 |
plan tests => 29; |
2621 |
|
2621 |
|
2622 |
my $library = $builder->build( { source => 'Branch' } ); |
2622 |
my $library = $builder->build( { source => 'Branch' } ); |
2623 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
2623 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
Lines 2847-2852
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
2847 |
} |
2847 |
} |
2848 |
); |
2848 |
); |
2849 |
|
2849 |
|
|
|
2850 |
Koha::CirculationRules->search->delete; |
2851 |
Koha::CirculationRules->set_rules( |
2852 |
{ |
2853 |
categorycode => undef, |
2854 |
itemtype => undef, |
2855 |
branchcode => undef, |
2856 |
rules => { |
2857 |
finedays => 0, |
2858 |
} |
2859 |
} |
2860 |
); |
2861 |
|
2862 |
Koha::Patron::Debarments::AddDebarment( |
2863 |
{ |
2864 |
borrowernumber => $patron->{borrowernumber}, |
2865 |
expiration => '9999-12-31', |
2866 |
type => 'MANUAL', |
2867 |
} |
2868 |
); |
2869 |
|
2870 |
AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); |
2871 |
my ( undef, $message ) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); |
2872 |
is( $message->{WasReturned} && exists $message->{ForeverDebarred}, 1, 'Forever debarred message for Addreturn when overdue'); |
2873 |
|
2874 |
Koha::Patron::Debarments::DelUniqueDebarment( |
2875 |
{ |
2876 |
borrowernumber => $patron->{borrowernumber}, |
2877 |
type => 'MANUAL', |
2878 |
} |
2879 |
); |
2880 |
Koha::Patron::Debarments::AddDebarment( |
2881 |
{ |
2882 |
borrowernumber => $patron->{borrowernumber}, |
2883 |
expiration => $now->clone->add( days => 10 ), |
2884 |
type => 'MANUAL', |
2885 |
} |
2886 |
); |
2887 |
|
2888 |
AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); |
2889 |
(undef, $message) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); |
2890 |
is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for Addreturn when overdue'); |
2850 |
}; |
2891 |
}; |
2851 |
|
2892 |
|
2852 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
2893 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
2853 |
- |
|
|