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