Bugzilla – Attachment 96073 Details for
Bug 24186
maxFine can break fine reductions in updateFine
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24186: Add Tests
Bug-24186-Add-Tests.patch (text/plain), 2.89 KB, created by
Martin Renvoize (ashimema)
on 2019-12-06 16:55:21 UTC
(
hide
)
Description:
Bug 24186: Add Tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-12-06 16:55:21 UTC
Size:
2.89 KB
patch
obsolete
>From dc818e4a660025405b2523a6070f0d92d194fc7d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 6 Dec 2019 16:54:04 +0000 >Subject: [PATCH] Bug 24186: Add Tests > >--- > t/db_dependent/Overdues.t | 36 +++++++++++++++++++++++++++++++++--- > 1 file changed, 33 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index 88388163ba..99226b055f 100644 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -132,7 +132,7 @@ $schema->storage->txn_rollback; > > subtest 'UpdateFine tests' => sub { > >- plan tests => 59; >+ plan tests => 70; > > $schema->storage->txn_begin; > >@@ -348,6 +348,38 @@ subtest 'UpdateFine tests' => sub { > # Total : Outstanding : MaxFine > # 150 : 100 : 100 > >+ # Decrease fine 3 - First item, third overdue adjust (backdated return example) >+ UpdateFine( >+ { >+ issue_id => $checkout1->issue_id, >+ itemnumber => $item1->itemnumber, >+ borrowernumber => $patron->borrowernumber, >+ amount => '30', >+ due => $checkout1->date_due >+ } >+ ); >+ >+ $fines = Koha::Account::Lines->search( >+ { borrowernumber => $patron->borrowernumber }, >+ { order_by => { '-asc' => 'accountlines_id' } } >+ ); >+ is( $fines->count, 3, "Still three fines after fourth checkout update" ); >+ $fine = $fines->next; >+ is( $fine->amount, '80.000000', "First fine amount unchanged" ); >+ is( $fine->amountoutstanding, '50.000000', "First fine amountoutstanding unchanged" ); >+ $fine2 = $fines->next; >+ is( $fine2->amount, '30.000000', "Second fine amount unchanged" ); >+ is( $fine2->amountoutstanding, '30.000000', "Second fine amountoutstanding unchanged" ); >+ $fine3 = $fines->next; >+ is( $fine3->amount, '30.000000', "Third fine reduced as expected" ); >+ is( $fine3->amountoutstanding, '10.000000', "Third fine amountoutstanding reduced..." ); >+ is( $fine3->issue_id, $checkout1->issue_id, "Third fine is associated with the correct issue" ); >+ is( $fine3->itemnumber, $checkout1->itemnumber, "Third fine is associated with the correct item" ); >+ is( $fine->amount + $fine2->amount + $fine3->amount, '140', "Total fines = 140" ); >+ is( $fine->amountoutstanding + $fine2->amountoutstanding + $fine3->amountoutstanding, '90', "Total outstanding = 90" ); >+ # Total : Outstanding : MaxFine >+ # 140 : 90 : 100 >+ > # FIXME: Add test to check whether sundry/manual charges are included within MaxFine. > # FIXME: Add test to ensure other charges are not included within MaxFine. > >@@ -400,7 +432,5 @@ subtest 'UpdateFine tests' => sub { > is( $fine3->amount, '30.000000', "Third fine reduced" ); > is( $fine3->amountoutstanding, '10.000000', "Third fine amount outstanding is reduced" ); > >- >- > $schema->storage->txn_rollback; > }; >-- >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 24186
: 96073 |
96074