Lines 2102-2108
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
2102 |
}; |
2102 |
}; |
2103 |
|
2103 |
|
2104 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2104 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2105 |
plan tests => 24; |
2105 |
plan tests => 26; |
2106 |
|
2106 |
|
2107 |
my $library = $builder->build( { source => 'Branch' } ); |
2107 |
my $library = $builder->build( { source => 'Branch' } ); |
2108 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
2108 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
Lines 2300-2305
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
2300 |
} |
2300 |
} |
2301 |
); |
2301 |
); |
2302 |
|
2302 |
|
|
|
2303 |
# Debarred message when finesdays = 0 |
2304 |
|
2305 |
Koha::CirculationRules->set_rules( |
2306 |
{ |
2307 |
categorycode => undef, |
2308 |
branchcode => undef, |
2309 |
itemtype => undef, |
2310 |
rules => { |
2311 |
finedays => 0, |
2312 |
suspension_chargeperiod => 1, |
2313 |
} |
2314 |
} |
2315 |
); |
2316 |
|
2317 |
Koha::Patron::Debarments::AddDebarment( { borrowernumber => $patron->{borrowernumber}, type => 'MANUAL', expiration => $now->clone->add(days => 10) } ); |
2318 |
|
2319 |
AddIssue( $patron, $item_1->{barcode}, $now->clone->add(days => 1) ); |
2320 |
|
2321 |
my ( undef, $message ) = AddReturn( $item_1->{barcode}, $library->{branchcode}, undef, $now->clone->subtract(days => 1) ); |
2322 |
is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for AddReturn when not overdue' ); |
2323 |
|
2324 |
AddIssue( $patron, $item_1->{barcode}, $now->clone->add(days => 1) ); |
2325 |
|
2326 |
( undef, $message ) = AddReturn( $item_1->{barcode}, $library->{branchcode}, undef, $now->clone->add(days => 5) ); |
2327 |
is( $message->{WasReturned} && exists $message->{PrevDebarred}, 1, 'Previously debarred message for AddReturn when overdue' ); |
2328 |
|
2329 |
Koha::Patron::Debarments::DelUniqueDebarment( |
2330 |
{ borrowernumber => $patron->{borrowernumber}, type => 'MANUAL' } ); |
2331 |
|
2303 |
}; |
2332 |
}; |
2304 |
|
2333 |
|
2305 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
2334 |
subtest 'CanBookBeIssued + AutoReturnCheckedOutItems' => sub { |
2306 |
- |
|
|