[Bug 28421] New: When refunding lost fees we should not include voided payments
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Bug ID: 28421 Summary: When refunding lost fees we should not include voided payments Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1 - Mark an item lost 2 - Add a manual lost fee for that barcode to a patron (or checkout before #1 and ensure a fine will be charged when marked lost) 3 - Pay the fee 4 - Void the fee 5 - Pay the fee 6 - Checkin the item 7 - The patron has a credit for twice the fee The problematic code appears to be in _FixAccountForLostAndReturned: my $credits_offsets = Koha::Account::Offsets->search({ debit_id => $accountline->id, credit_id => { '!=' => undef }, # it is not the debit itself type => { '!=' => 'Writeoff' }, amount => { '<' => 0 } # credits are negative on the DB }); We count both the payment and the voided payment -- 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=28421 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hi nick, -- 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=28421 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hi Nick, _FixAccountForLostAndReturned has gone away in master.. what version were you testing against? I'm working my way through writing a test and can confirm so far this does indeed exist in master, but I think the fix will be very different for versions prior to 21.05 release (we use double-entry accounting for VOID in the coming release) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 121316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121316&action=edit Bug 28421: Unit Tests This patch adds test test cases for both a Voided Payment and Voided Writeoff. These cases need special handling in the refund process. Test plan 1/ Run t/db_dependent/Koha/Items.t 2/ Prior to this commit the test should pass 3/ After this commit the test should fail 4/ The subsequent commit should make the test pass again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121316|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 121317 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121317&action=edit Bug 28421: Unit Tests This patch adds test test cases for both a Voided Payment and Voided Writeoff. These cases need special handling in the refund process. Test plan 1/ Run t/db_dependent/Koha/Items.t 2/ Prior to this commit the test should pass 3/ After this commit the test should fail 4/ The subsequent commit should make the test pass again. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |22435 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22435 [Bug 22435] account_offset types should be codes not descriptions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27971 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27971 [Bug 27971] The VOID method should be updated to respect double-entry accounting -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, For master, this is actually fixed with a combination of bug 22435 and bug 27971.. nice little side effect fix there. I've attached a test that I think should be added anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28432 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28432 [Bug 28432] When refunding lost fees we should not include voided payments [20.11 and below] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|28432 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28432 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28432 [Bug 28432] When refunding lost fees we should not include voided payments [20.11 and below] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Version|master |20.11 Keywords| |rel_20_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Needs Signoff |ASSIGNED --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Depends on bug 22435, I couldn't apply it on 20.11.x due to a conflict I didn't know how to solve. Tried to not apply the dependency: error: sha1 information is lacking or useless (t/db_dependent/Koha/Items.t) So not testable for now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_20_11_candidate |rel_21_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Oop.. it was meant to be 'rel_21_05_candidate'.. I mixed up the tags.. The 20.11 and below version is in it's own bug.. and I'm struggling to come up with a solution for it.. see bug 28432 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|20.11 |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_05_candidate |rel_21_11_candidate --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- This will be for 21.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121317|0 |1 is obsolete| | --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 122017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122017&action=edit Bug 28421: Unit Tests This patch adds test test cases for both a Voided Payment and Voided Writeoff. These cases need special handling in the refund process. Test plan 0/ Don't apply 1/ Run t/db_dependent/Koha/Items.t 2/ Prior to this commit the test should pass 3/ Apply this commit but not the dependency(bug 22435) 3/ The test should fail 4/ Bug 22435 should make the test pass again. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #10 from Victor Grousset/tuxayo <victor@tuxayo.net> --- It works :) Amended test plan to show the interaction with bug 22435 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #122017|0 |1 is obsolete| | --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 122162 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=122162&action=edit Bug 28421: Unit Tests This patch adds test test cases for both a Voided Payment and Voided Writeoff. These cases need special handling in the refund process. Test plan 0/ Don't apply 1/ Run t/db_dependent/Koha/Items.t 2/ Prior to this commit the test should pass 3/ Apply this commit but not the dependency(bug 22435) 3/ The test should fail 4/ Bug 22435 should make the test pass again. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|When refunding lost fees we |Add tests for Voided |should not include voided |Payment and Voided |payments |Writeoff. Severity|normal |enhancement -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Bug 28421 depends on bug 22435, which changed state. Bug 22435 Summary: Clarify account_offset types by converting them to clear codes https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22435 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Resolution|--- |FIXED Status|Pushed to master |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 Bug 28421 depends on bug 27971, which changed state. Bug 27971 Summary: The VOID method should be updated to respect double-entry accounting https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27971 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org