Bugzilla – Attachment 96068 Details for
Bug 24146
Paying Accruing Fines prior to return causes another accruing fine when returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24146: Illustrate increasing and decreasing fine
Bug-24146-Illustrate-increasing-and-decreasing-fin.patch (text/plain), 2.58 KB, created by
Nick Clemens
on 2019-12-06 15:35:47 UTC
(
hide
)
Description:
Bug 24146: Illustrate increasing and decreasing fine
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2019-12-06 15:35:47 UTC
Size:
2.58 KB
patch
obsolete
>From 9cc7bcc803aa419ddf99a59066466b61fcb59a5f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 6 Dec 2019 15:35:27 +0000 >Subject: [PATCH] Bug 24146: Illustrate increasing and decreasing fine > >--- > t/db_dependent/Overdues.t | 33 ++++++++++++++++++++++++++++++--- > 1 file changed, 30 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index 48c957d61d..88388163ba 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 => 53; >+ plan tests => 59; > > $schema->storage->txn_begin; > >@@ -358,7 +358,7 @@ subtest 'UpdateFine tests' => sub { > issue_id => $checkout1->issue_id, > itemnumber => $item1->itemnumber, > borrowernumber => $patron->borrowernumber, >- amount => '30', >+ amount => '50', > due => $checkout1->date_due > } > ); >@@ -373,7 +373,34 @@ subtest 'UpdateFine tests' => sub { > $fine2 = $fines->next; > is( $fine2->amount, '30.000000', "Second fine amount unchanged" ); > $fine3 = $fines->next; >- is( $fine3->amount, '30.000000', "Third fine increased now MaxFine cap is disabled" ); >+ is( $fine3->amount, '50.000000', "Third fine increased now MaxFine cap is disabled" ); >+ is( $fine3->amountoutstanding, '30.000000', "Third fine increased now MaxFine cap is disabled" ); >+ >+ # If somehow the fine should be reduced, we changed rules or checkout date or something >+ 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 only three fines after MaxFine cap removed and third fine altered" ); >+ $fine = $fines->next; >+ is( $fine->amount, '80.000000', "First fine amount unchanged" ); >+ $fine2 = $fines->next; >+ is( $fine2->amount, '30.000000', "Second fine amount unchanged" ); >+ $fine3 = $fines->next; >+ is( $fine3->amount, '30.000000', "Third fine reduced" ); >+ is( $fine3->amountoutstanding, '10.000000', "Third fine amount outstanding is reduced" ); >+ >+ > > $schema->storage->txn_rollback; > }; >-- >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 24146
:
95992
|
96005
|
96006
|
96065
|
96066
|
96067
|
96068
|
96069
|
96070
|
96071
|
96072
|
97304
|
97305
|
97306
|
97307