Bugzilla – Attachment 87094 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 tests
Bug-22563-follow-up-Corrections-for-tests.patch (text/plain), 8.26 KB, created by
Martin Renvoize (ashimema)
on 2019-03-27 16:19:03 UTC
(
hide
)
Description:
Bug 22563: (follow-up) Corrections for tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-03-27 16:19:03 UTC
Size:
8.26 KB
patch
obsolete
>From ae05066ee1a1be35c5474b54c9138535d82fcd34 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 27 Mar 2019 14:56:52 +0000 >Subject: [PATCH] Bug 22563: (follow-up) Corrections for tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation.t | 41 ++++++++++++++++++++---------------- > 1 file changed, 23 insertions(+), 18 deletions(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index aa61be8442..c8f647f2aa 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2005,7 +2005,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > > subtest 'Full write-off tests' => sub { > >- plan tests => 10; >+ plan tests => 11; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > my $manager = $builder->build_object({ class => "Koha::Patrons" }); >@@ -2039,9 +2039,9 @@ subtest '_FixAccountForLostAndReturned' => sub { > { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } ); > is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' ); > my $lost_fee_line = $lost_fee_lines->next; >- is( $lost_fee_line->amount + 0, $replacement_amount, 'The right L amount is generated' ); >+ is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' ); > is( $lost_fee_line->amountoutstanding + 0, >- $replacement_amount, 'The right L amountoutstanding is generated' ); >+ $replacement_amount, 'The right LOST amountoutstanding is generated' ); > > my $account = $patron->account; > my $debts = $account->outstanding_debits; >@@ -2060,14 +2060,15 @@ subtest '_FixAccountForLostAndReturned' => sub { > $lost_fee_line->discard_changes; # reload from DB > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); > is( $lost_fee_line->accounttype, >- 'LR', 'Lost fee now has account type of LR ( Lost Returned )' ); >+ 'LOST', 'Lost fee now still has account type of LOST' ); >+ is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); > > is( $patron->account->balance, -0, 'The patron balance is 0, everything was written off' ); > }; > > subtest 'Full payment tests' => sub { > >- plan tests => 12; >+ plan tests => 13; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > >@@ -2099,9 +2100,9 @@ subtest '_FixAccountForLostAndReturned' => sub { > { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } ); > is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' ); > my $lost_fee_line = $lost_fee_lines->next; >- is( $lost_fee_line->amount + 0, $replacement_amount, 'The right L amount is generated' ); >+ is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' ); > is( $lost_fee_line->amountoutstanding + 0, >- $replacement_amount, 'The right L amountountstanding is generated' ); >+ $replacement_amount, 'The right LOST amountountstanding is generated' ); > > my $account = $patron->account; > my $debts = $account->outstanding_debits; >@@ -2126,7 +2127,8 @@ subtest '_FixAccountForLostAndReturned' => sub { > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); > is( $lost_fee_line->accounttype, >- 'LR', 'Lost fee now has account type of LR ( Lost Returned )' ); >+ 'LOST', 'Lost fee now still has account type of LOST' ); >+ is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); > > is( $patron->account->balance, > -99, 'The patron balance is -99, a credit that equals the lost fee payment' ); >@@ -2134,7 +2136,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > > subtest 'Test without payment or write off' => sub { > >- plan tests => 12; >+ plan tests => 13; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > >@@ -2167,9 +2169,9 @@ subtest '_FixAccountForLostAndReturned' => sub { > { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } ); > is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' ); > my $lost_fee_line = $lost_fee_lines->next; >- is( $lost_fee_line->amount + 0, $replacement_amount, 'The right L amount is generated' ); >+ is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' ); > is( $lost_fee_line->amountoutstanding + 0, >- $replacement_amount, 'The right L amountountstanding is generated' ); >+ $replacement_amount, 'The right LOST amountountstanding is generated' ); > > my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); > my $credit_return = Koha::Account::Lines->find($credit_return_id); >@@ -2180,14 +2182,16 @@ subtest '_FixAccountForLostAndReturned' => sub { > > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); >- is( $lost_fee_line->accounttype, 'LR', 'Lost fee now has account type of LR ( Lost Returned )' ); >+ is( $lost_fee_line->accounttype, >+ 'LOST', 'Lost fee now still has account type of LOST' ); >+ is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); > > is( $patron->account->balance, 20, 'The patron balance is 20, still owes the processing fee' ); > }; > > subtest 'Test with partial payement and write off, and remaining debt' => sub { > >- plan tests => 15; >+ plan tests => 16; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > my $item = $builder->build_sample_item( >@@ -2218,9 +2222,9 @@ subtest '_FixAccountForLostAndReturned' => sub { > { borrowernumber => $patron->id, itemnumber => $item->itemnumber, accounttype => 'LOST' } ); > is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' ); > my $lost_fee_line = $lost_fee_lines->next; >- is( $lost_fee_line->amount + 0, $replacement_amount, 'The right L amount is generated' ); >+ is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' ); > is( $lost_fee_line->amountoutstanding + 0, >- $replacement_amount, 'The right L amountountstanding is generated' ); >+ $replacement_amount, 'The right LOST amountountstanding is generated' ); > > my $account = $patron->account; > is( $account->balance, $processfee_amount + $replacement_amount, 'Balance is PF + L' ); >@@ -2261,7 +2265,8 @@ subtest '_FixAccountForLostAndReturned' => sub { > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); > is( $lost_fee_line->accounttype, >- 'LR', 'Lost fee now has account type of LR ( Lost Returned )' ); >+ 'LOST', 'Lost fee now still has account type of LOST' ); >+ is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); > > is( $credit_return->accounttype, 'CR', 'An account line of type CR is added' ); > is( $credit_return->amount + 0, >@@ -2319,9 +2324,9 @@ subtest '_FixAccountForLostAndReturned' => sub { > { borrowernumber => $patron->id, itemnumber => $item_id, accounttype => 'LOST' } ); > is( $lost_fee_lines->count, 1, 'Only one lost item fee produced' ); > my $lost_fee_line = $lost_fee_lines->next; >- is( $lost_fee_line->amount + 0, $replacement_amount, 'The right L amount is generated' ); >+ is( $lost_fee_line->amount + 0, $replacement_amount, 'The right LOST amount is generated' ); > is( $lost_fee_line->amountoutstanding + 0, >- $replacement_amount, 'The right L amountountstanding is generated' ); >+ $replacement_amount, 'The right LOST amountountstanding is generated' ); > > my $account = $patron->account; > is( $account->balance, $replacement_amount, 'Balance is L' ); >-- >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