[Bug 23018] New: Refunding a lost item fee may trigger error if any fee has been written off related to that item
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Bug ID: 23018 Summary: Refunding a lost item fee may trigger error if any fee has been written off related to that item Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Target Milestone: --- If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. -- 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=23018 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=23018 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 90205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90205&action=edit Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. Test Plan: 1) Create a lost item with a fee 2) Create a manual debit using the barcode of the item 3) Write off that manual debit 4) Check in the item, note the error 5) Apply this patch 6) Repeat steps 1-3 7) Check in the item, no error! -- 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=23018 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |18.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=23018 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90205|0 |1 is obsolete| | --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 90206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90206&action=edit Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. Test Plan: 1) Create a lost item with a fee 2) Create a manual debit using the barcode of the item 3) Write off that manual debit 4) Check in the item, note the error 5) Apply this patch 6) Repeat steps 1-3 7) Check in the item, no error! -- 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=23018 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- This bug will be fixed by bug 22563, however that bug will probably not be backported to previous releases of Koha. This bug patch would be a good candidate for Koha 19.05 and 18.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=23018 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=23018 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90206|0 |1 is obsolete| | --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 90640 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90640&action=edit Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. Test Plan: 1) Create a lost item with a fee 2) Create a manual debit using the barcode of the item 3) Write off that manual debit 4) Check in the item, note the error 5) Apply this patch 6) Repeat steps 1-3 7) Check in the item, no error! Signed-off-by: Martin Renvoize <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=23018 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |martin.renvoize@ptfs-europe | |.com --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Signing off.. it's basically the same change I made in bug 22563 only more backport friendly. Works as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90640|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 91330 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=91330&action=edit Bug 23018: Refunding a lost item fee may trigger error if any fee has been written off related to that item If a lost item fee is written off, it creates a writeoff with the same itemnumber but the amount column is a negative number. Now, when the lost item is returned, it calls _FixAccountForLostAndReturned which searchs for all accountlines with an account type of 'L' or 'W'. Then, if the *first* of those lines has an outstanding balance, a credit is created and *all* the lines found are passed to $credit->apply. The apply method then calls is_debit on each line and when it hits the writeoff, it throws an exception ( Koha::Exceptions::Account::IsNotDebit ). When this happens, the credit is creating but not applied the the outstanding lost item fee, and the librarian is presented with an error page. It seems like the solution is to only fetch the first result since it seems like that is the only one we should be operating on. Test Plan: 1) Create a lost item with a fee 2) Create a manual debit using the barcode of the item 3) Write off that manual debit 4) Check in the item, note the error 5) Apply this patch 6) Repeat steps 1-3 7) Check in the item, no error! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Version|18.11 |master QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|19.11.00 |19.11.00,19.05.03 released in| | Status|Pushed to master |Pushed to stable --- Comment #8 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23018 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- tried many times to recreate this bug in 18.11.x and was unable to. not backporting to 18.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org