[Bug 28432] New: When refunding lost fees we should not include voided payments [20.11 and below]
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28432 Bug ID: 28432 Summary: When refunding lost fees we should not include voided payments [20.11 and below] 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: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: martin.renvoize@ptfs-europe.com, nick@bywatersolutions.com, testopia@bugs.koha-community.org Depends on: 22435, 27971, 28421 +++ This bug was initially created as a clone of Bug #28421 +++ 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 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22435 [Bug 22435] account_offset types should be codes not descriptions https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27971 [Bug 27971] The VOID method should be updated to respect double-entry accounting https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 [Bug 28421] When refunding lost fees we should not include voided payments -- 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=28432 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|22435, 27971, 28421 | See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28421 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22435 [Bug 22435] account_offset types should be codes not descriptions https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27971 [Bug 27971] The VOID method should be updated to respect double-entry accounting https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28421 [Bug 28421] When refunding lost fees we should not include voided payments -- 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=28432 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |20.11 -- 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=28432 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 121323 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121323&action=edit Bug 28432: 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28432 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pretty confident in the test.. but no idea how to resolve the actual bug.. I've tried using joins to look at the credit line status.. but for some reason that breaks all sorts..
my $credits_offsets = Koha::Account::Offsets->search( { debit_id => $lost_charge->id, credit_id => { '!=' => undef }, # it is not the debit itself 'credit.credit_type_code' => { '!=' => 'Writeoff' }, 'credit.status' => { '!=' => 'VOID' }, }, { join => 'credit' } );
-- 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=28432 --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Is this 20.05 and earlier? 20.11 does not appear to have _FixAccountForLostAndReturned? -- 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=28432 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29923 -- 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=28432 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WONTFIX Status|NEW |RESOLVED --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- As 20.11 is no longer maintained, I am moving this to WONTFIX. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org