Bugzilla – Attachment 88327 Details for
Bug 22563
Convert lost handling to use 'status' instead of multiple accounttypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22563: (follow-up) Corrections for overdue tests
Bug-22563-follow-up-Corrections-for-overdue-tests.patch (text/plain), 3.38 KB, created by
Martin Renvoize (ashimema)
on 2019-04-18 15:58:11 UTC
(
hide
)
Description:
Bug 22563: (follow-up) Corrections for overdue tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-18 15:58:11 UTC
Size:
3.38 KB
patch
obsolete
>From d3c4fa0762af1791c7879ce2fbff1f58755bad8d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 18 Apr 2019 15:47:24 +0100 >Subject: [PATCH] Bug 22563: (follow-up) Corrections for overdue tests > >Updates to unit tests to reflect the accounttype changes and introduction of >status usage for _FixOverduesOnReturn. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 16aa8c6bcb..5403ee169c 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2447,7 +2447,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > }; > > subtest '_FixOverduesOnReturn' => sub { >- plan tests => 9; >+ plan tests => 11; > > my $manager = $builder->build_object({ class => "Koha::Patrons" }); > t::lib::Mocks::mock_userenv({ patron => $manager, branchcode => $manager->branchcode }); >@@ -2480,12 +2480,13 @@ subtest '_FixOverduesOnReturn' => sub { > } > )->store(); > >- C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $item->itemnumber ); >+ C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $item->itemnumber, undef, 'RETURNED' ); > > $accountline->_result()->discard_changes(); > > is( $accountline->amountoutstanding, '99.000000', 'Fine has the same amount outstanding as previously' ); >- is( $accountline->status, 'RETURNED', 'Open fine ( account type OVERDUE ) has been closed out ( status RETURNED )'); >+ isnt( $accountline->status, 'UNRETURNED', 'Open fine ( account type OVERDUE ) has been closed out ( status not UNRETURNED )'); >+ is( $accountline->status, 'RETURNED', 'Passed status has been used to set as RETURNED )'); > > ## Run again, with exemptfine enabled > $accountline->set( >@@ -2496,18 +2497,19 @@ subtest '_FixOverduesOnReturn' => sub { > } > )->store(); > >- C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $item->itemnumber, 1 ); >+ C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $item->itemnumber, 1, 'RETURNED' ); > > $accountline->_result()->discard_changes(); > my $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Forgiven' })->next(); > >- is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' ); >+ is( $accountline->amountoutstanding + 0, 0, 'Fine amountoutstanding has been reduced to 0' ); >+ isnt( $accountline->status, 'UNRETURNED', 'Open fine ( account type OVERDUE ) has been closed out ( status not UNRETURNED )'); > is( $accountline->status, 'FORGIVEN', 'Open fine ( account type OVERDUE ) has been set to fine forgiven ( status FORGIVEN )'); > is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" ); >- is( $offset->amount, '-99.000000', "Amount of offset is correct" ); >+ is( $offset->amount + 0, -99, "Amount of offset is correct" ); > my $credit = $offset->credit; > is( ref $credit, "Koha::Account::Line", "Found matching credit for fine forgiveness" ); >- is( $credit->amount, '-99.000000', "Credit amount is set correctly" ); >+ is( $credit->amount + 0, -99, "Credit amount is set correctly" ); > is( $credit->amountoutstanding + 0, 0, "Credit amountoutstanding is correctly set to 0" ); > }; > >-- >2.20.1
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 22563
:
86913
|
86914
|
87092
|
87093
|
87094
|
87637
|
87638
|
87639
|
87640
|
87641
|
87642
|
87801
|
87802
|
87803
|
87804
|
87805
|
87806
|
88279
|
88280
|
88281
|
88282
|
88283
|
88284
|
88285
|
88323
|
88324
|
88325
|
88326
|
88327
|
88328
|
88720
|
88721
|
88722
|
88723
|
88724
|
88725
|
89462
|
89463
|
89464
|
89465
|
89466
|
89467
|
90221
|
90222
|
90223
|
90224
|
90225
|
90226
|
90227
|
90307
|
90308
|
90309
|
90310
|
90311
|
90312
|
90330
|
90331
|
90332
|
90333
|
90334
|
90335
|
90632
|
90637
|
90667
|
91338
|
91339
|
91340
|
91341
|
91342
|
91343
|
91344
|
91345
|
91346
|
91347
|
91348