Bugzilla – Attachment 97306 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: Corrections to UpdateFine logic concerning maxFine
Bug-24146-Corrections-to-UpdateFine-logic-concerni.patch (text/plain), 2.10 KB, created by
Jonathan Druart
on 2020-01-13 11:58:16 UTC
(
hide
)
Description:
Bug 24146: Corrections to UpdateFine logic concerning maxFine
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-01-13 11:58:16 UTC
Size:
2.10 KB
patch
obsolete
>From 303ca0d0df79ffaa867e906678475a2f7548c542 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 6 Dec 2019 15:10:17 +0000 >Subject: [PATCH] Bug 24146: Corrections to UpdateFine logic concerning maxFine > >The `maxFine` system preference actually refers to the amount of >outsanding debt (in fines) a patron may have at a given time. This patch >corrects the functionality of UpdateFine such that it properly respects >that counter given the payment of accruing fines scenario. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Overdues.pm | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 9ab0bdc6b1..cd4f838cfd 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -551,12 +551,19 @@ sub UpdateFine { > $total_amount_other += $overdue->amountoutstanding; > } > >- if (my $maxfine = C4::Context->preference('MaxFine')) { >- if ($total_amount_other + $amount > $maxfine) { >- my $new_amount = $maxfine - $total_amount_other; >- return if $new_amount <= 0.00; >- $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; >- $amount = $new_amount; >+ if ( my $maxfine = C4::Context->preference('MaxFine') ) { >+ my $maxIncrease = $maxfine - $total_amount_other; >+ return if $maxIncrease <= 0.00; >+ if ($accountline) { >+ if ( ( $amount - $accountline->amount ) > $maxIncrease ) { >+ my $new_amount = $accountline->amount + $maxIncrease; >+ $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; >+ $amount = $new_amount; >+ } >+ } >+ elsif ( $amount > $maxIncrease ) { >+ $debug and warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $maxIncrease - MaxFine reached"; >+ $amount = $maxIncrease; > } > } > >-- >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