Bugzilla – Attachment 104901 Details for
Bug 8338
Add ability to remove fines with dropbox mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8338: Remove zero amount overdues on backdated returns where appropriate
Bug-8338-Remove-zero-amount-overdues-on-backdated-.patch (text/plain), 2.02 KB, created by
Andrew Fuerste-Henry
on 2020-05-14 21:29:26 UTC
(
hide
)
Description:
Bug 8338: Remove zero amount overdues on backdated returns where appropriate
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2020-05-14 21:29:26 UTC
Size:
2.02 KB
patch
obsolete
>From eb3ad4def418269f5a93b9686fa6b5afac29cfaf Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 13 May 2020 14:11:38 +0100 >Subject: [PATCH] Bug 8338: Remove zero amount overdues on backdated returns > where appropriate > >This patch removes any overdues which would be reversed on a backdated >return if CalcFineOnBackdate is enabled and the user has not already >attempted to pay off the accruing fine. > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > C4/Circulation.pm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5f48cfc288..d84fbd9735 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2430,9 +2430,12 @@ sub _FixOverduesOnReturn { > return 0 unless $accountlines->count; # no warning, there's just nothing to fix > > my $accountline = $accountlines->next; >+ my $payments = $accountline->credits; > > my $amountoutstanding = $accountline->amountoutstanding; >- if ($exemptfine && ($amountoutstanding != 0)) { >+ if ( $accountline->amount == 0 && $payments->count == 0 ) { >+ $accountline->delete; >+ } elsif ($exemptfine && ($amountoutstanding != 0)) { > my $account = Koha::Account->new({patron_id => $borrowernumber}); > my $credit = $account->add_credit( > { >@@ -2448,15 +2451,15 @@ sub _FixOverduesOnReturn { > $credit->apply({ debits => [ $accountline ], offset_type => 'Forgiven' }); > > $accountline->status('FORGIVEN'); >+ $accountline->store(); > > if (C4::Context->preference("FinesLog")) { > &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); > } > } else { > $accountline->status($status); >+ $accountline->store(); > } >- >- return $accountline->store(); > } > ); > >-- >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 8338
:
104841
|
104842
|
104900
|
104901
|
105496
|
105497
|
105498
|
106152
|
106153
|
106154
|
106155
|
106209
|
106523
|
106524
|
106525
|
106526
|
106527
|
107140
|
110640