Bugzilla – Attachment 112403 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.30 KB, created by
Chris Cormack
on 2020-10-24 21:30:50 UTC
(
hide
)
Description:
Bug 26232: Test for empty smart rule fine grace period
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2020-10-24 21:30:50 UTC
Size:
2.30 KB
patch
obsolete
>From 21eea6bef8433e368cec067e615fd2db84d9f3b7 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 > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > 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 a51349b186..51706fcf38 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2103,7 +2103,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} } } ); >@@ -2152,6 +2152,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