[Bug 8770] New: amount does not equal amountoutstanding on a fine with no payments or credits
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Priority: P5 - low Change sponsored?: --- Bug ID: 8770 CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Assignee: koha-bugs@lists.koha-community.org Summary: amount does not equal amountoutstanding on a fine with no payments or credits Severity: blocker Classification: Unclassified OS: All Reporter: melia@bywatersolutions.com Hardware: All Status: NEW Version: rel_3_8 Component: Circulation Product: Koha Fine amount is being correctly calculated. The amountoutstanding does not agree with the amount, even when no payments or credits have been made. This seems to affect lost items in particular. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #1 from Chris Cormack <chris@bigballofwax.co.nz> --- This is definitely a regression. Since this has worked for the 12 years up to now. Whomever fixes it, (should be able to track it down with git bisect) should make sure to write tests for this behaviour -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #2 from Melia Meggs <melia@bywatersolutions.com> --- Created attachment 12201 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12201&action=edit amount =! amountoutstanding screenshot1 Here are some screenshots, if it helps. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #3 from Melia Meggs <melia@bywatersolutions.com> --- Created attachment 12202 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12202&action=edit amount != amountoutstanding screenshot2 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #4 from Melia Meggs <melia@bywatersolutions.com> --- Created attachment 12203 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12203&action=edit amount != amountoutstanding screenshot3 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Can you check the database, check the accountlines table, what type are those ones that don't match, 'F' ? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #6 from Melia Meggs <melia@bywatersolutions.com> --- I can't check that particular one because I can't make their silly VPN work, but I have another example from a different library of the same thing. This one is also related to a lost item that was later returned (I think?). The one with the wrong amountoutstanding is accounttype F. It looks like this: mysql> SELECT * FROM accountlines WHERE borrowernumber = 323737\G; *************************** 1. row *************************** borrowernumber: 323737 accountno: 2 itemnumber: 700451 date: 2012-08-22 amount: 3.950000 description: Froggy goes to Hawaii / 05/22/2012 23:59 dispute: NULL accounttype: F amountoutstanding: 2.950000 lastincrement: 0.050000 timestamp: 2012-08-22 16:42:19 notify_id: 0 notify_level: 0 note: NULL manager_id: NULL *************************** 2. row *************************** borrowernumber: 323737 accountno: 3 itemnumber: 700451 date: 2012-07-30 amount: 15.990000 description: Lost Item Froggy goes to Hawaii / 31319001350302 dispute: NULL accounttype: LR amountoutstanding: 0.000000 lastincrement: NULL timestamp: 2012-08-22 16:42:19 notify_id: 0 notify_level: 0 note: NULL manager_id: NULL *************************** 3. row *************************** borrowernumber: 323737 accountno: 4 itemnumber: NULL date: 2012-08-22 amount: -15.990000 description: Item Returned 31319001350302 dispute: NULL accounttype: CR amountoutstanding: 0.000000 lastincrement: NULL timestamp: 2012-08-22 16:42:19 notify_id: 0 notify_level: 0 note: NULL manager_id: NULL 3 rows in set (0.00 sec) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #7 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 12508 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12508&action=edit Fine error 1 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #8 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 12509 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12509&action=edit fine error 2 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12508|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #12509|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #9 from Galen Charlton <gmcharlt@gmail.com> --- The content of attachment 12508 has been deleted by Galen Charlton <gmcharlt@gmail.com> without providing any reason. The token used to delete this attachment was generated at 2012-09-26 13:52:42 UTC. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #10 from Galen Charlton <gmcharlt@gmail.com> --- The content of attachment 12509 has been deleted by Galen Charlton <gmcharlt@gmail.com> who provided the following reason: inadvertantly included real patron data The token used to delete this attachment was generated at 2012-09-26 13:53:07 UTC. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #11 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 12529 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12529&action=edit Fines 1 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #12 from Jesse Maseto <jesse@bywatersolutions.com> --- Created attachment 12530 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12530&action=edit Fines 2 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com --- Comment #13 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #1)
This is definitely a regression. Since this has worked for the 12 years up to now. OK, interesting information.
Digging into changes in C4/Accounts: * patch 5954631aeaf261a9bbbb44a7a7fcae225031eb24, 2012-10-03 17:58:56 just do: - $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount, + $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, 0 - $amount, => can't be the origin of the problem 0-$amount populates amountoutstanding, if it was the culprit, we had X and -X, not a small difference. * patch a8b168dc63df9d60e8e562f368f8bdbec520ffd8, 2012-09-15 07:31:58 is related to adding a primary key, nothing related to amountoutstanding Patches before that have been pushed before 3.8, so should not be the culprit -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #14 from Paul Poulain <paul.poulain@biblibre.com> --- mmm... I'm a little bit confused: The version is "3.8", it seems there are "real world" datas. Does it mean the problem exists on 3.8 ? I'm confused because chris said it worked "for the 12 years up to now". So, is it broken in master/3.10 or in 3.8 ? (continuing investigating patches) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #15 from Melia Meggs <melia@bywatersolutions.com> --- Yes, these are real world dates. The problem exists in 3.8. We've got four different libraries on 3.8 that have all reported this strange problem. I'm not sure if this is happening in master because I'm not really sure how it got like that in the first place... I will go play around a bit on master and see if I can somehow reproduce it. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle.m.hall@gmail.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #16 from Kyle M Hall <kyle.m.hall@gmail.com> --- Looks like the problem code is in C4::Circulation around line 2142 in _FixAccountForLostAndReturned. I returned lost item is only refunded the unpaid amount of the lost fee. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 17175 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17175&action=edit Bug 8770 - amount does not equal amountoutstanding on a fine with no payments or credits If a lost item fee is owed and partially paid off when an item is returned and a refund is processed, Koha tries to pay off existing fees before adding any leftover balance as a credit on the account. However, those fee payments aren't actually processed, due to a bug where the accountnumber was quoted as a string literal, and thus the for the fee payment would fail. This did not result in an DB error, as the query was still valid SQL. Checking the return value of the query would have revealed that the accountline had not been updated. History: This bug was introduced on April 23, 2007 with the commit 'reintroducing fixaccountforlostandreturned as requested by rosalie'. Commit id 111d590e9cdaf801256822e23f170bfc2365338f On July 30, 2009 the error was flagged with a FIXME and remained in that state until now. Commit id 51e8fc2cb6a0cf79f19206c822a4361aeca6f63f Test plan: 1) Create a test patron 2) Check out an item to that patron and give it a due date in the past 3) Run fines.pl to generate the fine for the item 4) Mark the item long overdue on the item tab (not in edit items) 5) Pay for the lost item 6) Check the item back in 7) Note the incorrect fines. Only the lost fee balance due is refunded, not the entire lost fee, but no other fees are paid off. 8) Apply the patch 9) Repeat steps 1-6, then not the fines are paid correctly -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.8 |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17175|0 |1 is obsolete| | --- Comment #18 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 17220 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17220&action=edit Bug 8770 - amount does not equal amountoutstanding on a fine with no payments or credits If a lost item fee is owed and partially paid off when an item is returned and a refund is processed, Koha tries to pay off existing fees before adding any leftover balance as a credit on the account. However, those fee payments aren't actually processed, due to a bug where the accountnumber was quoted as a string literal, and thus the for the fee payment would fail. This did not result in an DB error, as the query was still valid SQL. Checking the return value of the query would have revealed that the accountline had not been updated. History: This bug was introduced on April 23, 2007 with the commit 'reintroducing fixaccountforlostandreturned as requested by rosalie'. Commit id 111d590e9cdaf801256822e23f170bfc2365338f On July 30, 2009 the error was flagged with a FIXME and remained in that state until now. Commit id 51e8fc2cb6a0cf79f19206c822a4361aeca6f63f Test plan: 1) Create a test patron 2) Check out an item to that patron and give it a due date in the past 3) Run fines.pl to generate the fine for the item 4) Mark the item long overdue on the item tab (not in edit items) 5) Pay for the lost item 6) Check the item back in 7) Note the incorrect fines. Only the lost fee balance due is refunded, not the entire lost fee, but no other fees are paid off. 8) Apply the patch 9) Repeat steps 1-6, then not the fines are paid correctly Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17220|0 |1 is obsolete| | --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17253 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17253&action=edit [PASSED QA] Bug 8770 - amount does not equal amountoutstanding on a fine with no payments or credits If a lost item fee is owed and partially paid off when an item is returned and a refund is processed, Koha tries to pay off existing fees before adding any leftover balance as a credit on the account. However, those fee payments aren't actually processed, due to a bug where the accountnumber was quoted as a string literal, and thus the for the fee payment would fail. This did not result in an DB error, as the query was still valid SQL. Checking the return value of the query would have revealed that the accountline had not been updated. History: This bug was introduced on April 23, 2007 with the commit 'reintroducing fixaccountforlostandreturned as requested by rosalie'. Commit id 111d590e9cdaf801256822e23f170bfc2365338f On July 30, 2009 the error was flagged with a FIXME and remained in that state until now. Commit id 51e8fc2cb6a0cf79f19206c822a4361aeca6f63f Test plan: 1) Create a test patron 2) Check out an item to that patron and give it a due date in the past 3) Run fines.pl to generate the fine for the item 4) Mark the item long overdue on the item tab (not in edit items) 5) Pay for the lost item 6) Check the item back in 7) Note the incorrect fines. Only the lost fee balance due is refunded, not the entire lost fee, but no other fees are paid off. 8) Apply the patch 9) Repeat steps 1-6, then not the fines are paid correctly Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Totel due is correct after applying the patch. All tests and QA script pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #20 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master; recommended for inclusion in 3.12. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 --- Comment #21 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to 3.12.x -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8770 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #22 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.6 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org