Bugzilla – Attachment 94609 Details for
Bug 23051
Add ability to optionally renew fine accruing items when all fines on item are paid off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23051: (follow-up) Fix unit tests
Bug-23051-follow-up-Fix-unit-tests.patch (text/plain), 2.22 KB, created by
Andrew Isherwood
on 2019-10-23 10:59:49 UTC
(
hide
)
Description:
Bug 23051: (follow-up) Fix unit tests
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2019-10-23 10:59:49 UTC
Size:
2.22 KB
patch
obsolete
>From 0f9d197b3d4adc113d3cbeb1bbeb71c80f54af3c Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Fri, 18 Oct 2019 10:44:06 +0100 >Subject: [PATCH] Bug 23051: (follow-up) Fix unit tests > >As raised by Nick in comment #35 >--- > Koha/Account/Line.pm | 4 +++- > t/db_dependent/Koha/Account.t | 2 +- > t/db_dependent/Koha/Account/Lines.t | 2 +- > 3 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 3793eba733..767ef13cb8 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -248,7 +248,9 @@ sub apply { > $debit->amountoutstanding, > $debit > ); >- $overdue_unreturned->{$debit->itemnumber} = $debit if $renewable; >+ if ($renewable && $debit->itemnumber) { >+ $overdue_unreturned->{$debit->itemnumber} = $debit; >+ } > > # Same logic exists in Koha::Account::pay > if ( $debit->amountoutstanding == 0 >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 8e98136e63..47c95afea8 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 11; >+use Test::More tests => 12; > use Test::MockModule; > use Test::Exception; > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index 4839017ca7..70131ef369 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -365,7 +365,7 @@ subtest 'apply() tests' => sub { > my $module = new Test::MockModule('C4::Circulation'); > $module->mock('AddRenewal', sub { $called = 1; }); > my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' }); >- my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id }); >+ my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id })->as_list; > $credit_renew->apply( { debits => $debits_renew, offset_type => 'Manual Credit' } ); > > is( $called, 1, 'RenewAccruingItemWhenPaid causes C4::Circulation::AddRenew to be called when appropriate' ); >-- >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 23051
:
90559
|
90560
|
90561
|
91058
|
91059
|
91060
|
91792
|
91793
|
91794
|
91795
|
92684
|
92685
|
92686
|
92687
|
92688
|
92689
|
93922
|
93923
|
93924
|
93925
|
94020
|
94021
|
94022
|
94023
|
94024
|
94402
|
94434
|
94453
|
94525
|
94604
|
94605
|
94606
|
94607
|
94608
|
94609
|
94610
|
94611
|
94629
|
94649
|
95557
|
95558
|
95559
|
95560
|
100127
|
100128
|
100129
|
100130
|
100131
|
100132
|
100133
|
100134
|
100135
|
100138
|
100172
|
100182
|
100183
|
100184
|
100185
|
100186
|
100187
|
100188
|
100271