|
Lines 2103-2109
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
| 2103 |
}; |
2103 |
}; |
| 2104 |
|
2104 |
|
| 2105 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
2105 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
| 2106 |
plan tests => 24; |
2106 |
plan tests => 27; |
| 2107 |
|
2107 |
|
| 2108 |
my $library = $builder->build( { source => 'Branch' } ); |
2108 |
my $library = $builder->build( { source => 'Branch' } ); |
| 2109 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
2109 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
|
Lines 2152-2157
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
| 2152 |
} |
2152 |
} |
| 2153 |
); |
2153 |
); |
| 2154 |
|
2154 |
|
|
|
2155 |
# Same with undef firstremind |
| 2156 |
Koha::CirculationRules->search->delete; |
| 2157 |
Koha::CirculationRules->set_rules( |
| 2158 |
{ |
| 2159 |
categorycode => '*', |
| 2160 |
itemtype => '*', |
| 2161 |
branchcode => '*', |
| 2162 |
rules => { |
| 2163 |
issuelength => 1, |
| 2164 |
firstremind => undef, # 0 day of grace |
| 2165 |
finedays => 2, # 2 days of fine per day of overdue |
| 2166 |
suspension_chargeperiod => 1, |
| 2167 |
lengthunit => 'days', |
| 2168 |
} |
| 2169 |
} |
| 2170 |
); |
| 2171 |
{ |
| 2172 |
my $now = dt_from_string; |
| 2173 |
my $five_days_ago = $now->clone->subtract( days => 5 ); |
| 2174 |
# We want to charge 2 days every day, without grace |
| 2175 |
# With 5 days of overdue: 5 * Z |
| 2176 |
my $expected_expiration = $now->clone->add( days => ( 5 * 2 ) / 1 ); |
| 2177 |
test_debarment_on_checkout( |
| 2178 |
{ |
| 2179 |
item => $item_1, |
| 2180 |
library => $library, |
| 2181 |
patron => $patron, |
| 2182 |
due_date => $five_days_ago, |
| 2183 |
expiration_date => $expected_expiration, |
| 2184 |
} |
| 2185 |
); |
| 2186 |
} |
| 2155 |
# We want to charge 2 days every 2 days, without grace |
2187 |
# We want to charge 2 days every 2 days, without grace |
| 2156 |
# With 5 days of overdue: (5 * 2) / 2 |
2188 |
# With 5 days of overdue: (5 * 2) / 2 |
| 2157 |
Koha::CirculationRules->set_rule( |
2189 |
Koha::CirculationRules->set_rule( |
| 2158 |
- |
|
|