|
Lines 2598-2604
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
| 2598 |
}; |
2598 |
}; |
| 2599 |
|
2599 |
|
| 2600 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2600 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
| 2601 |
plan tests => 27; |
2601 |
plan tests => 29; |
| 2602 |
|
2602 |
|
| 2603 |
my $library = $builder->build( { source => 'Branch' } ); |
2603 |
my $library = $builder->build( { source => 'Branch' } ); |
| 2604 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
2604 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
|
Lines 2828-2833
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
| 2828 |
} |
2828 |
} |
| 2829 |
); |
2829 |
); |
| 2830 |
|
2830 |
|
|
|
2831 |
Koha::CirculationRules->search->delete; |
| 2832 |
Koha::CirculationRules->set_rules( |
| 2833 |
{ |
| 2834 |
categorycode => undef, |
| 2835 |
itemtype => undef, |
| 2836 |
branchcode => undef, |
| 2837 |
rules => { |
| 2838 |
finedays => 0, |
| 2839 |
} |
| 2840 |
} |
| 2841 |
); |
| 2842 |
|
| 2843 |
Koha::Patron::Debarments::AddDebarment( |
| 2844 |
{ |
| 2845 |
borrowernumber => $patron->{borrowernumber}, |
| 2846 |
expiration => '9999-12-31', |
| 2847 |
type => 'MANUAL', |
| 2848 |
} |
| 2849 |
); |
| 2850 |
|
| 2851 |
AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); |
| 2852 |
my ( undef, $message ) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); |
| 2853 |
is( $message->{WasReturned} && exists $message->{ForeverDebarred}, 1, 'Forever debarred message for Addreturn when overdue'); |
| 2854 |
|
| 2855 |
Koha::Patron::Debarments::DelUniqueDebarment( |
| 2856 |
{ |
| 2857 |
borrowernumber => $patron->{borrowernumber}, |
| 2858 |
type => 'MANUAL', |
| 2859 |
} |
| 2860 |
); |
| 2861 |
Koha::Patron::Debarments::AddDebarment( |
| 2862 |
{ |
| 2863 |
borrowernumber => $patron->{borrowernumber}, |
| 2864 |
expiration => $now->clone->add( days => 10 ), |
| 2865 |
type => 'MANUAL', |
| 2866 |
} |
| 2867 |
); |
| 2868 |
|
| 2869 |
AddIssue( $patron, $item_1->barcode, $now->clone->subtract( days => 1 ) ); |
| 2870 |
(undef, $message) = AddReturn( $item_1->barcode, $library->{branchcode}, undef, $now ); |
| 2871 |
is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for Addreturn when overdue'); |
| 2831 |
}; |
2872 |
}; |
| 2832 |
|
2873 |
|
| 2833 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
2874 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
| 2834 |
- |
|
|