Lines 2089-2095
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
2089 |
|
2089 |
|
2090 |
# We want to charge 2 days every 2 days, without grace |
2090 |
# We want to charge 2 days every 2 days, without grace |
2091 |
# With 5 days of overdue: (5 * 2) / 2 |
2091 |
# With 5 days of overdue: (5 * 2) / 2 |
2092 |
$rule->suspension_chargeperiod(2)->store; |
2092 |
Koha::CirculationRules->set_rule( |
|
|
2093 |
{ |
2094 |
categorycode => undef, |
2095 |
branchcode => undef, |
2096 |
itemtype => undef, |
2097 |
rule_name => 'suspension_chargeperiod', |
2098 |
rule_value => '2', |
2099 |
} |
2100 |
); |
2101 |
|
2093 |
$expected_expiration = dt_from_string->add( days => floor( 5 * 2 ) / 2 ); |
2102 |
$expected_expiration = dt_from_string->add( days => floor( 5 * 2 ) / 2 ); |
2094 |
test_debarment_on_checkout( |
2103 |
test_debarment_on_checkout( |
2095 |
{ |
2104 |
{ |
Lines 2103-2110
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
2103 |
|
2112 |
|
2104 |
# We want to charge 2 days every 3 days, with 1 day of grace |
2113 |
# We want to charge 2 days every 3 days, with 1 day of grace |
2105 |
# With 5 days of overdue: ((5-1) / 3 ) * 2 |
2114 |
# With 5 days of overdue: ((5-1) / 3 ) * 2 |
2106 |
$rule->suspension_chargeperiod(3)->store; |
2115 |
Koha::CirculationRules->set_rules( |
2107 |
$rule->firstremind(1)->store; |
2116 |
{ |
|
|
2117 |
categorycode => undef, |
2118 |
branchcode => undef, |
2119 |
itemtype => undef, |
2120 |
rules => { |
2121 |
suspension_chargeperiod => 3, |
2122 |
firstremind => 1, |
2123 |
} |
2124 |
} |
2125 |
); |
2108 |
$expected_expiration = dt_from_string->add( days => floor( ( ( 5 - 1 ) / 3 ) * 2 ) ); |
2126 |
$expected_expiration = dt_from_string->add( days => floor( ( ( 5 - 1 ) / 3 ) * 2 ) ); |
2109 |
test_debarment_on_checkout( |
2127 |
test_debarment_on_checkout( |
2110 |
{ |
2128 |
{ |
Lines 2118-2126
subtest 'AddReturn + suspension_chargeperiod' => sub {
Link Here
|
2118 |
|
2136 |
|
2119 |
# Use finesCalendar to know if holiday must be skipped to calculate the due date |
2137 |
# Use finesCalendar to know if holiday must be skipped to calculate the due date |
2120 |
# We want to charge 2 days every days, with 0 day of grace (to not burn brains) |
2138 |
# We want to charge 2 days every days, with 0 day of grace (to not burn brains) |
2121 |
$rule->finedays(2)->store; |
2139 |
Koha::CirculationRules->set_rules( |
2122 |
$rule->suspension_chargeperiod(1)->store; |
2140 |
{ |
2123 |
$rule->firstremind(0)->store; |
2141 |
categorycode => undef, |
|
|
2142 |
branchcode => undef, |
2143 |
itemtype => undef, |
2144 |
rules => { |
2145 |
finedays => 2, |
2146 |
suspension_chargeperiod => 1, |
2147 |
firstremind => 0, |
2148 |
} |
2149 |
} |
2150 |
); |
2124 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2151 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2125 |
|
2152 |
|
2126 |
# Adding a holiday 2 days ago |
2153 |
# Adding a holiday 2 days ago |
Lines 2297-2303
subtest 'AddReturn | is_overdue' => sub {
Link Here
|
2297 |
); |
2324 |
); |
2298 |
|
2325 |
|
2299 |
Koha::CirculationRules->search->delete; |
2326 |
Koha::CirculationRules->search->delete; |
2300 |
my $rule = Koha::CirculationRules->set_rules( |
2327 |
Koha::CirculationRules->set_rules( |
2301 |
{ |
2328 |
{ |
2302 |
categorycode => undef, |
2329 |
categorycode => undef, |
2303 |
itemtype => undef, |
2330 |
itemtype => undef, |
2304 |
- |
|
|