Bugzilla – Attachment 51628 Details for
Bug 14390
Fine not updated from 'FU' to 'F' on renewal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14390 [QA Followup] - Unit Test
Bug-14390-QA-Followup---Unit-Test.patch (text/plain), 2.95 KB, created by
Kyle M Hall (khall)
on 2016-05-19 15:15:03 UTC
(
hide
)
Description:
Bug 14390 [QA Followup] - Unit Test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-05-19 15:15:03 UTC
Size:
2.95 KB
patch
obsolete
>From c864e46716c564bc98ba1e7dbdb124ccc51b0387 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 1 Dec 2015 16:53:03 +0000 >Subject: [PATCH] Bug 14390 [QA Followup] - Unit Test > >--- > t/db_dependent/Circulation.t | 28 +++++++++++++++++++++++----- > 1 file changed, 23 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index cfee3e2..8e98a54 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -24,13 +24,13 @@ use C4::Branch; > use C4::Items; > use C4::Members; > use C4::Reserves; >-use C4::Overdues qw(UpdateFine); >+use C4::Overdues qw(UpdateFine CalcFine); > use Koha::DateUtils; > use Koha::Database; > > use t::lib::TestBuilder; > >-use Test::More tests => 84; >+use Test::More tests => 85; > > BEGIN { > use_ok('C4::Circulation'); >@@ -442,9 +442,28 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > my $datedue6 = AddIssue( $renewing_borrower, $barcode6); > is (defined $datedue6, 1, "Item 2 checked out, due date: $datedue6"); > >- my $passeddatedue1 = AddIssue($renewing_borrower, $barcode7, DateTime->from_epoch(epoch => 1)); >- is (defined $passeddatedue1, 1, "Item with passed date due checked out, due date: $passeddatedue1"); >+ my $now = dt_from_string(); >+ my $five_weeks = DateTime::Duration->new(weeks => 5); >+ my $five_weeks_ago = $now - $five_weeks; >+ >+ my $passeddatedue1 = AddIssue($renewing_borrower, $barcode7, $five_weeks_ago); >+ is (defined $passeddatedue1, 1, "Item with passed date due checked out, due date: " . $passeddatedue1->date_due); > >+ my ( $fine ) = CalcFine( GetItem(undef, $barcode7), $renewing_borrower->{categorycode}, $branch, $five_weeks_ago, $now ); >+ C4::Overdues::UpdateFine( >+ { >+ issue_id => $passeddatedue1->id(), >+ itemnumber => $itemnumber7, >+ borrowernumber => $renewing_borrower->{borrowernumber}, >+ amount => $fine, >+ type => 'FU', >+ due => Koha::DateUtils::output_pref($five_weeks_ago) >+ } >+ ); >+ AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch ); >+ $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } ); >+ is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' ); >+ $fine->delete(); > > t::lib::Mocks::mock_preference('OverduesBlockRenewing','blockitem'); > ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber6); >@@ -596,7 +615,6 @@ C4::Context->dbh->do("DELETE FROM accountlines"); > > ok( $total_due == 15, 'Borrower only charged fine with both WhenLostForgiveFine and WhenLostChargeReplacementFee disabled' ); > >- my $now = dt_from_string(); > my $future = dt_from_string(); > $future->add( days => 7 ); > my $units = C4::Overdues::get_chargeable_units('days', $future, $now, $library2->{branchcode}); >-- >2.1.4
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 14390
:
41428
|
44600
|
44603
|
45280
|
45281
|
45285
|
47465
|
51627
|
51628
|
51629
|
54593
|
54594
|
54595
|
54596
|
54704
|
54778
|
54779
|
54821
|
54822
|
54823
|
54824
|
54825