Bugzilla – Attachment 98314 Details for
Bug 18936
Move issuingrules into circulation_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18936: new suspension_chargeperiod
Bug-18936-new-suspensionchargeperiod.patch (text/plain), 4.14 KB, created by
Jonathan Druart
on 2020-02-03 16:07:06 UTC
(
hide
)
Description:
Bug 18936: new suspension_chargeperiod
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-03 16:07:06 UTC
Size:
4.14 KB
patch
obsolete
>From e23c60426f2c91357c151bb066aaa8a7f15ce515 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Feb 2019 17:49:21 -0300 >Subject: [PATCH] Bug 18936: new suspension_chargeperiod >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Minna Kivinen <minna.kivinen@hamk.fi> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > C4/Circulation.pm | 1 + > Koha/CirculationRules.pm | 3 +++ > t/db_dependent/Circulation.t | 41 ++++++++++++++++++++++++++++++++++------- > 3 files changed, 38 insertions(+), 7 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 0027f81a9e..813c064fd6 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2269,6 +2269,7 @@ sub _calculate_new_debar_dt { > 'lengthunit', > 'firstremind', > 'maxsuspensiondays', >+ 'suspension_chargeperiod', > ] > } > ); >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index 2f6da8816d..9d38f19a16 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -148,6 +148,9 @@ our $RULE_KINDS = { > reservesallowed => { > scope => [ 'branchcode', 'categorycode', 'itemtype' ], > }, >+ suspension_chargeperiod => { >+ scope => [ 'branchcode', 'categorycode', 'itemtype' ], >+ }, > # Not included (deprecated?): > # * accountsent > # * reservecharge >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index e4550cedc5..7df409c2ce 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2065,7 +2065,16 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > > # We want to charge 2 days every 2 days, without grace > # With 5 days of overdue: (5 * 2) / 2 >- $rule->suspension_chargeperiod(2)->store; >+ Koha::CirculationRules->set_rule( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ rule_name => 'suspension_chargeperiod', >+ rule_value => '2', >+ } >+ ); >+ > $expected_expiration = dt_from_string->add( days => floor( 5 * 2 ) / 2 ); > test_debarment_on_checkout( > { >@@ -2079,8 +2088,17 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > > # We want to charge 2 days every 3 days, with 1 day of grace > # With 5 days of overdue: ((5-1) / 3 ) * 2 >- $rule->suspension_chargeperiod(3)->store; >- $rule->firstremind(1)->store; >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ rules => { >+ suspension_chargeperiod => 3, >+ firstremind => 1, >+ } >+ } >+ ); > $expected_expiration = dt_from_string->add( days => floor( ( ( 5 - 1 ) / 3 ) * 2 ) ); > test_debarment_on_checkout( > { >@@ -2094,9 +2112,18 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > > # Use finesCalendar to know if holiday must be skipped to calculate the due date > # We want to charge 2 days every days, with 0 day of grace (to not burn brains) >- $rule->finedays(2)->store; >- $rule->suspension_chargeperiod(1)->store; >- $rule->firstremind(0)->store; >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ rules => { >+ finedays => 2, >+ suspension_chargeperiod => 1, >+ firstremind => 0, >+ } >+ } >+ ); > t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); > t::lib::Mocks::mock_preference('SuspensionsCalendar', 'noSuspensionsWhenClosed'); > >@@ -2241,7 +2268,7 @@ subtest 'AddReturn | is_overdue' => sub { > )->unblessed; > > Koha::CirculationRules->search->delete; >- my $rule = Koha::CirculationRules->set_rules( >+ Koha::CirculationRules->set_rules( > { > categorycode => undef, > itemtype => undef, >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18936
:
65247
|
65248
|
65249
|
67629
|
67758
|
68236
|
71034
|
71035
|
71036
|
71037
|
71038
|
71039
|
71040
|
71041
|
72230
|
72231
|
72232
|
72233
|
72234
|
72235
|
72236
|
72237
|
72238
|
91953
|
91954
|
91955
|
91956
|
91957
|
91958
|
91959
|
91960
|
91961
|
91962
|
91963
|
91964
|
91965
|
91966
|
91967
|
91968
|
91969
|
91970
|
91971
|
91972
|
91973
|
91974
|
91975
|
94179
|
94180
|
94181
|
94182
|
94183
|
94184
|
94185
|
94186
|
94187
|
94188
|
94189
|
94190
|
94191
|
94192
|
94193
|
94194
|
94195
|
94196
|
94197
|
94198
|
94199
|
94200
|
98299
|
98300
|
98301
|
98302
|
98303
|
98304
|
98305
|
98306
|
98307
|
98308
|
98309
|
98310
|
98311
|
98312
|
98313
| 98314 |
98315
|
98316
|
98317
|
98318
|
98319
|
98320
|
98321
|
98322
|
98323
|
98324
|
98325
|
98326
|
98327
|
98328
|
98329
|
98330
|
98331
|
98332
|
98333
|
98334
|
98335
|
98336
|
98337
|
98338
|
98339
|
98340
|
98341
|
98342
|
98343
|
98344
|
98345
|
98346
|
98347
|
98407
|
98408