Bugzilla – Attachment 96067 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), 1.98 KB, created by
Martin Renvoize (ashimema)
on 2019-12-06 15:13:06 UTC
(
hide
)
Description:
Bug 24146: Corrections to UpdateFine logic concerning maxFine
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-12-06 15:13:06 UTC
Size:
1.98 KB
patch
obsolete
>From dca8ba0ddb98255ae4e6512a99529644672ba9b7 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. >--- > C4/Overdues.pm | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index daffbd0397..64046aee9e 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -552,12 +552,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.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 24146
:
95992
|
96005
|
96006
|
96065
|
96066
|
96067
|
96068
|
96069
|
96070
|
96071
|
96072
|
97304
|
97305
|
97306
|
97307