Bugzilla – Attachment 104536 Details for
Bug 25417
Backdating returns and forgiving fines causes and internal server error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25417: Prevent backdating returns and forgiving fines as the same time from causing an internal server error
Bug-25417-Prevent-backdating-returns-and-forgiving.patch (text/plain), 2.74 KB, created by
Kyle M Hall (khall)
on 2020-05-07 18:25:03 UTC
(
hide
)
Description:
Bug 25417: Prevent backdating returns and forgiving fines as the same time from causing an internal server error
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-05-07 18:25:03 UTC
Size:
2.74 KB
patch
obsolete
>From ce587dceeb8f8f113a73311bd894c1e27f898f5e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 7 May 2020 14:24:35 -0400 >Subject: [PATCH] Bug 25417: Prevent backdating returns and forgiving fines as > the same time from causing an internal server error > >--- > C4/Circulation.pm | 32 +++++++++++++++++--------------- > 1 file changed, 17 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 8db887db2e..40f4af68c9 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2433,24 +2433,26 @@ sub _FixOverduesOnReturn { > if ($exemptfine) { > my $amountoutstanding = $accountline->amountoutstanding; > >- my $account = Koha::Account->new({patron_id => $borrowernumber}); >- my $credit = $account->add_credit( >- { >- amount => $amountoutstanding, >- user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, >- library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, >- interface => C4::Context->interface, >- type => 'FORGIVEN', >- item_id => $item >- } >- ); >+ if ( $amountoutstanding > 0 ) { >+ my $account = Koha::Account->new({patron_id => $borrowernumber}); >+ my $credit = $account->add_credit( >+ { >+ amount => $amountoutstanding, >+ user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, >+ library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, >+ interface => C4::Context->interface, >+ type => 'FORGIVEN', >+ item_id => $item >+ } >+ ); > >- $credit->apply({ debits => [ $accountline ], offset_type => 'Forgiven' }); >+ $credit->apply({ debits => [ $accountline ], offset_type => 'Forgiven' }); > >- $accountline->status('FORGIVEN'); >+ $accountline->status('FORGIVEN'); > >- if (C4::Context->preference("FinesLog")) { >- &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); >+ if (C4::Context->preference("FinesLog")) { >+ &logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); >+ } > } > } else { > $accountline->status($status); >-- >2.24.2 (Apple Git-127)
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 25417
:
104535
|
104536
|
104575
|
104576
|
104578
|
104579
|
104580
|
104644
|
104645
|
104715
|
104716
|
104730
|
104731
|
104732
|
104733
|
104734
|
104735
|
104736
|
104737
|
104738
|
104739
|
104749
|
104750
|
104751
|
104752
|
104753
|
104754