[Bug 18580] New: Account-pay does not apply credits / clear old fines as did recordpayment
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Bug ID: 18580 Summary: Account-pay does not apply credits / clear old fines as did recordpayment Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: colin.campbell@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com the recordpayment routine in C4::Accounts cleared old paid fines and applied credit amounts as part of its pay routine. The behaviour was implicit and not signalled or commented in the code. The pay routine in Koha::Account which is now called by paycollect.pl instead of the old routine does not leaving these on the users fine display although they owe 0. Staff cannot manually remove these. For example a user has the following accountlines +-----------+-------------+-------------------+ | amount | accounttype | amountoutstanding | +-----------+-------------+-------------------+ | -1.300000 | C | -1.300000 | | 0.650000 | Res | 0.650000 | | 0.650000 | Res | 0.650000 | | 0.650000 | Res | 0.650000 | +-----------+-------------+-------------------+ after recordpayment has been called with an amount of 0.65 the lines are +-----------+-------------+-------------------+ | amount | accounttype | amountoutstanding | +-----------+-------------+-------------------+ | -1.300000 | C | 0.000000 | | 0.650000 | Res | 0.000000 | | 0.650000 | Res | 0.000000 | | 0.650000 | Res | 0.000000 | | -0.650000 | Pay | 0.000000 | +-----------+-------------+-------------------+ However now calling Account->pay for the same amount results in +-----------+-------------+-------------------+ | amount | accounttype | amountoutstanding | +-----------+-------------+-------------------+ | -1.300000 | C | -1.300000 | | 0.650000 | Res | 0.000000 | | 0.650000 | Res | 0.650000 | | 0.650000 | Res | 0.650000 | | -0.650000 | Pay | 0.000000 | +-----------+-------------+-------------------+ leaving the credit and two fines with an amountoutstanding although the user has nothing to pay (the amountoutstanding columns sum to 0) and leading to misleading displays. The difference is driven by the line where @outstanding_fines is retrieved the selection is amountoutstanding > 0. In recordpayment it was amountoutstanding <> 0 so that negative amounts were included and processed as part of the payment, rather than ignored. The fact that this implicit behaviour was not commented made it easy to miss. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |colin.campbell@ptfs-europe. |ity.org |com Status|NEW |Needs Signoff --- Comment #1 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Created attachment 63386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63386&action=edit proposed patch This is a minimal patch which restores the previous behaviour which some operations relied on. Its a bit of a code smell that this is handled as a side-effect of a payment, but as Accounts never explicitly handled credit amounts it would require a bit of a rethink to the Accounts api -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Colin Campbell <colin.campbell@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P1 - high Severity|enhancement |major --- Comment #2 from Colin Campbell <colin.campbell@ptfs-europe.com> --- Upped priority as we are finding sites on upgrade to 16.11 and beyond repeatedly enocountering inability to pay off fines as a result of this -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Colin, I think the behaviour is still a bit odd. Your patch works, but only if the fine was created first. I think sequence should not matter? I have made sure to restart Plack after applying the patch: Test plan: 1) Created to fines, 1.00 each 2) Created a credit, 1.00 3) Balance is at 1.00 4) Pay amount of 1.00 1.00 is paid, Credit and other fine remain unchanged (amount <> 0) 1) Created a credit, 1.00 2) Created to fines, 1.00 each 3) Balance is at 1.00 4) Pay amount of 1.00 All amount outstanding are set to 0.00. Good. I appears it only works if the credit was created before the fines were. I used a fresh patron account for each test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 --- Comment #4 from Colin Campbell <colin.campbell@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #3)
Hi Colin, I think the behaviour is still a bit odd. Your patch works, but only if the fine was created first. I think sequence should not matter?
I have made sure to restart Plack after applying the patch:
Test plan: 1) Created to fines, 1.00 each 2) Created a credit, 1.00 3) Balance is at 1.00 4) Pay amount of 1.00 1.00 is paid, Credit and other fine remain unchanged (amount <> 0)
1) Created a credit, 1.00 2) Created to fines, 1.00 each 3) Balance is at 1.00 4) Pay amount of 1.00 All amount outstanding are set to 0.00. Good.
I appears it only works if the credit was created before the fines were. I used a fresh patron account for each test. I'll see if I can set up something to confirm what the old api did and see if I can see anywhere the new fails
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Jason Palmer <jpalmer@switchinc.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jpalmer@switchinc.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Sally Healey <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20997 CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Christopher Davis <cgdavis@uintah.utah.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cgdavis@uintah.utah.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 --- Comment #5 from Christopher Davis <cgdavis@uintah.utah.gov> --- Hi Everyone, My institution is seeing this behaviour several time per week since our upgrade to Koha v. 18.05.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE CC| |martin.renvoize@ptfs-europe | |.com Status|Failed QA |RESOLVED --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- *** This bug has been marked as a duplicate of bug 21915 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18580 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15899 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15899 [Bug 15899] Remove the use of recordpayment -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org