Bugzilla – Attachment 63386 Details for
Bug 18580
Account-pay does not apply credits / clear old fines as did recordpayment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-Bug-18580-Restore-handling-ve-amts-in-Account-pay.patch (text/plain), 1.53 KB, created by
Colin Campbell
on 2017-05-11 15:12:40 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2017-05-11 15:12:40 UTC
Size:
1.53 KB
patch
obsolete
>From e17f3f3674224427c6c70f2d39806e15dba1f468 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Thu, 11 May 2017 15:58:11 +0100 >Subject: [PATCH] Bug 18580 - Restore handling -ve amts in Account->pay > >The older api handled accountlines with a negative amountoutstanding >this meant that credit amounts were applied to the user's balance >and negative amountoutstanding were cleared to 0 rather than credits and >paid fines persisting in the user display. This restores this >behaviour and indicates in a comment why our selection needs to >be not zero rather than greater than 0 >--- > Koha/Account.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 9ec1c1b..662203b 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -131,11 +131,12 @@ sub pay { > # Were not passed a specific line to pay, or the payment was for more > # than the what was owed on the given line. In that case pay down other > # lines with remaining balance. >- my @outstanding_fines; >- @outstanding_fines = Koha::Account::Lines->search( >+ # We select all lines with both positive and negative amountoutstanding >+ # this allows credits to be applied by the logic below and negative balances to be cleared >+ my @outstanding_fines = Koha::Account::Lines->search( > { > borrowernumber => $self->{patron_id}, >- amountoutstanding => { '>' => 0 }, >+ amountoutstanding => { '<>' => 0 }, > } > ) if $balance_remaining > 0; > >-- >2.9.3 >
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 18580
: 63386