Bugzilla – Attachment 108433 Details for
Bug 26232
undefined fine grace period kills koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26232: Test for empty smart rule fine grace period
Bug-26232-Test-for-empty-smart-rule-fine-grace-per.patch (text/plain), 2.25 KB, created by
Didier Gautheron
on 2020-08-18 06:00:53 UTC
(
hide
)
Description:
Bug 26232: Test for empty smart rule fine grace period
Filename:
MIME Type:
Creator:
Didier Gautheron
Created:
2020-08-18 06:00:53 UTC
Size:
2.25 KB
patch
obsolete
>From 61f049a2ae8896a7b54cf95de37e91b027d4a098 Mon Sep 17 00:00:00 2001 >From: Didier Gautheron <didier.gautheron@biblibre.com> >Date: Tue, 18 Aug 2020 07:39:53 +0200 >Subject: [PATCH] Bug 26232: Test for empty smart rule fine grace period > >--- > t/db_dependent/Circulation.t | 34 +++++++++++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index bb2ff5f978..1a2b5da5a2 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2106,7 +2106,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { > }; > > subtest 'AddReturn + suspension_chargeperiod' => sub { >- plan tests => 24; >+ plan tests => 27; > > my $library = $builder->build( { source => 'Branch' } ); > my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); >@@ -2155,6 +2155,38 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > } > ); > >+ # Same with undef firstremind >+ Koha::CirculationRules->search->delete; >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => '*', >+ itemtype => '*', >+ branchcode => '*', >+ rules => { >+ issuelength => 1, >+ firstremind => undef, # 0 day of grace >+ finedays => 2, # 2 days of fine per day of overdue >+ suspension_chargeperiod => 1, >+ lengthunit => 'days', >+ } >+ } >+ ); >+ { >+ my $now = dt_from_string; >+ my $five_days_ago = $now->clone->subtract( days => 5 ); >+ # We want to charge 2 days every day, without grace >+ # With 5 days of overdue: 5 * Z >+ my $expected_expiration = $now->clone->add( days => ( 5 * 2 ) / 1 ); >+ test_debarment_on_checkout( >+ { >+ item => $item_1, >+ library => $library, >+ patron => $patron, >+ due_date => $five_days_ago, >+ expiration_date => $expected_expiration, >+ } >+ ); >+ } > # We want to charge 2 days every 2 days, without grace > # With 5 days of overdue: (5 * 2) / 2 > Koha::CirculationRules->set_rule( >-- >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 26232
:
108432
|
108433
|
108434
|
111034
|
112403
|
112404
|
112427
|
112428