Bugzilla – Attachment 101467 Details for
Bug 21443
Add ability to exclude holidays when calculating rentals fees by time period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21443: Unit tests
Bug-21443-Unit-tests.patch (text/plain), 3.05 KB, created by
Katrin Fischer
on 2020-03-23 15:23:48 UTC
(
hide
)
Description:
Bug 21443: Unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-03-23 15:23:48 UTC
Size:
3.05 KB
patch
obsolete
>From c829e0e296f848120b6dfd7f3f7a6b3e2a2068a2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 9 Mar 2020 13:36:22 -0400 >Subject: [PATCH] Bug 21443: Unit tests > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Charges/Fees.t | 30 +++++++++++++++++++++++------- > 1 file changed, 23 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t >index f5a53714fb..a28cc48f92 100644 >--- a/t/db_dependent/Koha/Charges/Fees.t >+++ b/t/db_dependent/Koha/Charges/Fees.t >@@ -61,12 +61,14 @@ my $itemtype = $builder->build_object( > { > class => 'Koha::ItemTypes', > value => { >- rentalcharge_daily => '0.00', >- rentalcharge_hourly => '0.00', >- rentalcharge => '0.00', >- processfee => '0.00', >- defaultreplacecost => '0.00', >- }, >+ rentalcharge_daily => '0.00', >+ rentalcharge_daily_calendar => 1, >+ rentalcharge_hourly => '0.00', >+ rentalcharge_hourly_calendar => 1, >+ rentalcharge => '0.00', >+ processfee => '0.00', >+ defaultreplacecost => '0.00', >+ }, > } > ); > my $item = $builder->build_object( >@@ -307,7 +309,7 @@ subtest 'from_date accessor' => sub { > }; > > subtest 'accumulate_rentalcharge tests' => sub { >- plan tests => 7; >+ plan tests => 9; > > my $fees = Koha::Charges::Fees->new( > { >@@ -347,6 +349,13 @@ subtest 'accumulate_rentalcharge tests' => sub { > 'Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed' > ); > >+ $itemtype->rentalcharge_daily_calendar(0)->store(); >+ $charge = $fees->accumulate_rentalcharge(); >+ is( $charge, 6.00, >+'Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and rentalcharge_daily_calendar = 0' >+ ); >+ $itemtype->rentalcharge_daily_calendar(1)->store(); >+ > my $calendar = C4::Calendar->new( branchcode => $library->id ); > # DateTime 1..7 (Mon..Sun), C4::Calender 0..6 (Sun..Sat) > my $closed_day = >@@ -409,6 +418,13 @@ subtest 'accumulate_rentalcharge tests' => sub { > "Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $dayname (96h - 24h * 0.25u)" > ); > >+ $itemtype->rentalcharge_hourly_calendar(0)->store(); >+ $charge = $fees->accumulate_rentalcharge(); >+ is( $charge, 24.00, >+"Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed $dayname (96h - 24h * 0.25u) and rentalcharge_hourly_calendar = 0" >+ ); >+ $itemtype->rentalcharge_hourly_calendar(1)->store(); >+ > $calendar->delete_holiday( weekday => $closed_day ); > $charge = $fees->accumulate_rentalcharge(); > is( $charge, 24.00, 'Hourly rental charge calculated correctly with finesCalendar = noFinesWhenClosed (96h - 0h * 0.25u)' ); >-- >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 21443
:
100402
|
100403
|
100404
|
100405
|
100744
|
100745
|
100746
|
100747
|
100748
|
101428
|
101429
|
101430
|
101431
|
101458
|
101459
|
101460
|
101461
|
101462
|
101463
|
101464
|
101465
|
101466
| 101467 |
101468
|
101469
|
101631