[Bug 37645] New: Add ability to batch waive fines
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Bug ID: 37645 Summary: Add ability to batch waive fines Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Fines and fees Assignee: koha-bugs@lists.koha-community.org Reporter: enica@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org It would be nice if there's an ability in Koha to waive fines/fees in a batch. This is part of a regular workflow for libraries, especially those who regularly purge patron accounts. -- 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=37645 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org --- Comment #1 from Katie Bliss <kebliss@dmpl.org> --- +1 -- 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=37645 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Rebecca Coert <rcoert@arlingtonva.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rcoert@arlingtonva.us --- Comment #2 from Rebecca Coert <rcoert@arlingtonva.us> --- If it existed, I would definitely use this function! This would make our semi-annual patron cleanup faster and more efficient. -- 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=37645 hebah@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hebah@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 karie.straube@yavapaiaz.gov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |karie.straube@yavapaiaz.gov --- Comment #3 from karie.straube@yavapaiaz.gov --- My consortium also needs this functionality! -- 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=37645 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Brandon <brandon@wwcrld.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |brandon@wwcrld.org --- Comment #4 from Brandon <brandon@wwcrld.org> --- +1 We would also use this feature multiple times a year. -- 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=37645 Laura O'Neil <laura@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |laura@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Mollie Myers <mmyers@eulesstx.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mmyers@eulesstx.gov --- Comment #5 from Mollie Myers <mmyers@eulesstx.gov> --- If this existed I would LOVE to have this function as I've finally gotten clearance to clear out old accounts with or without charges past a certain date. We would use this feature once a year, I believe, but having the ability to do it ourselves vs. sending in a ticket to ByWater every year would be preferred. Thank you! -- 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=37645 saylett <saylett@spanishfork.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |saylett@spanishfork.org --- Comment #6 from saylett <saylett@spanishfork.org> --- We would also use this if available. We recently change dour policy to waive fines/fees that are older than 5 years, and have over 2,500 accounts that are eligible for fines/fees to be waived but we have to review them individually. Also, we're going to start deleting accounts that have been expired for more than 5 years, so this functionality would also be helpful for that process. -- 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=37645 Catrina Berka <catrina@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |catrina@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 carthur@slolibrary.org <carthur@slolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carthur@slolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #7 from carthur@slolibrary.org <carthur@slolibrary.org> --- +1 -- 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=37645 Chip Halvorsen <Chip.Halvorsen@WestlakeLibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Chip.Halvorsen@WestlakeLibr | |ary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Elizabeth Hoffman <ehoffman@plumcreeklibrary.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ehoffman@plumcreeklibrary.n | |et -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Kris <kbecker@jcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kbecker@jcls.org --- Comment #8 from Kris <kbecker@jcls.org> --- We would love this for our yearly expired patron purge. -- 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=37645 Todd Goatley <tgoatley@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tgoatley@gmail.com --- Comment #9 from Todd Goatley <tgoatley@gmail.com> --- +1 -- 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=37645 Amy Muchmore <amuchmore@dubuque.lib.ia.us> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amuchmore@dubuque.lib.ia.us --- Comment #10 from Amy Muchmore <amuchmore@dubuque.lib.ia.us> --- Our library would love this for our yearly expired patron purge -- 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=37645 Rebecca Leifker <rleifker@carnegiestout.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rleifker@carnegiestout.org --- Comment #11 from Rebecca Leifker <rleifker@carnegiestout.org> --- This feature would be very helpful with the yearly patron purge. -- 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=37645 --- Comment #12 from Chip Halvorsen <Chip.Halvorsen@WestlakeLibrary.org> --- +1 We have a policy to do an annual writeoff of bills more than 7 years old. It would be nice to have options similar to "Batch patron deletion and anonymization," with selections similar to those used by the cronjob writeoff_debts.pl -- 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=37645 Jason Robb <jrobb@sekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jrobb@sekls.org --- Comment #13 from Jason Robb <jrobb@sekls.org> --- +1 -- 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=37645 Sally Lodico <Slodico@knoxlib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Slodico@knoxlib.org --- Comment #14 from Sally Lodico <Slodico@knoxlib.org> --- There's a cron job to write off old fines (not waive). We've had it scheduled for a couple of years to run on the 1st of every month, writing off fines that are 84 months (7 years) or more years old. We had a couple of hick-ups getting it rolling, but it's been running smoothly for at least a year now. /misc/cronjobs/writeoff_debts.pl I had ByWater clear the first batch of old accounts before we scheduled the cron to run regularly due to the very large number of old bills we had in the system, but haven't needed to go back to them for data services since then. The cronjob handles it for us. -- 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=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com Assignee|koha-bugs@lists.koha-commun |Laura.escamilla@bywatersolu |ity.org |tions.com -- 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=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.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=37645 Sonia Bouis <sonia.bouis@univ-lyon3.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sonia.bouis@univ-lyon3.fr --- Comment #15 from Sonia Bouis <sonia.bouis@univ-lyon3.fr> --- +1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Mathieu Saby <mathsabypro@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mathsabypro@gmail.com --- Comment #16 from Mathieu Saby <mathsabypro@gmail.com> --- We may be interested, but I see the status is "assigned" to Laura Escamilla. Does that mean that Bywaters is already planning a patch for that ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com --- Comment #17 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- I've had someone ask for this recently. They have to clear the writeoffs with the board of administrators every year so it cannot be an automated cron job. For now they'll open a ticket every year to ask us to run the script, but it would be great if they were independent in doing this. They would need something like a report on what WOULD be written off (number of transactions + amount), so an option of a dry run with report. Then an actual run. They haven't mentioned if they need to exclude certain types of transactions, but I assume a staff interface tool would include all the possible options from the existing script. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Melissa <mwalker@akronlibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mwalker@akronlibrary.org --- Comment #18 from Melissa <mwalker@akronlibrary.org> --- This would be incredibly helpful! I just put in a huge request to the data team to batch waive fines. I'm going to have to make that request regularly when we go to clean up patron data or when juveniles age up to 18. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 zoho.roboto@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zoho.roboto@bywatersolution | |s.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 mteal@greenvillelibrary.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mteal@greenvillelibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 nicole@hchlibrary.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nicole@hchlibrary.org --- Comment #19 from nicole@hchlibrary.org --- Would love to see this developed. It would make our workflow so much more efficient when batch deleting expired patrons that still owe money. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 trevor.diamond@mainlib.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |trevor.diamond@mainlib.org --- Comment #20 from trevor.diamond@mainlib.org --- +1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #21 from mteal@greenvillelibrary.org --- It would be nice to be able have a note for these waived fines that says something like "Aged out fines 9/4/26" to easily see why the transaction was waived. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to mteal from comment #21)
It would be nice to be able have a note for these waived fines that says something like "Aged out fines 9/4/26" to easily see why the transaction was waived.
Please keep in mind that note should be configurable or at least translatable and follow DateFormat system preference. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.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=37645 --- Comment #23 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205256&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205256|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #24 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205257 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205257&action=edit Bug 37645: Add reusable methods for writing off debts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #25 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205258 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205258&action=edit Bug 37645: Add batch writeoff staff tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #26 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205259 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205259&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205257|0 |1 is obsolete| | Attachment #205258|0 |1 is obsolete| | Attachment #205259|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #27 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205261 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205261&action=edit Bug 37645: Add reusable methods for writing off debts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #28 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205262 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205262&action=edit Bug 37645: Add batch writeoff staff tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #29 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205263 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205263&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #30 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 205264 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205264&action=edit Bug 37645: (follow-up) Add new permission to Permissions.t Patch from commit c798037 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #31 from Owen Leonard <oleonard@myacpl.org> --- QA tool is reporting this: # Failed test 'Expected permissions generated for superlibrarian' # at /kohadevbox/koha/t/Koha/Auth/Permissions.t line 315. # Structures begin differing at: # $got->{CAN_user_tools_batch_writeoff} = Does not exist # $expected->{CAN_user_tools_batch_writeoff} = '1' # Looks like you failed 1 test of 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #32 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Owen Leonard from comment #31)
QA tool is reporting this:
# Failed test 'Expected permissions generated for superlibrarian' # at /kohadevbox/koha/t/Koha/Auth/Permissions.t line 315. # Structures begin differing at: # $got->{CAN_user_tools_batch_writeoff} = Does not exist # $expected->{CAN_user_tools_batch_writeoff} = '1' # Looks like you failed 1 test of 1.
I cannot recreate this. Is it possible you ran the QA tools before updatedatabase? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #33 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- I tested this locally by deleting the batch_writeoff permission row, running updatedatabase, and then rerunning t/Koha/Auth/Permissions.t. The atomic update recreated the permission successfully and the test passed. Could you check whether your test database has applied the atomic update? You can verify with: SELECT module_bit, code, description FROM permissions WHERE code = 'batch_writeoff'; If the row is missing, running updatedatabase should add it. After that, prove -v t/Koha/Auth/Permissions.t should pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #34 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I get an error when filtering debits by both category and branch: DBI Exception: DBD::mysql::st execute failed: Column 'branchcode' in WHERE is ambiguous at /usr/share/perl5/Exception/Class/Base.pm line 88 The date filters are comparing the user-selected date to the datetime value in accountlines.date. This causes the Created After value to be inclusive of the date chosen but the Created Before value to exclude the date chosen. My preference here would be: - compare the user-selected date to only the date portion of accountlines.date - update the comparisons in search_for_writeoff to be >= and <= - reword the UI labels to read "Created on or after" and "Created on or before" The Tools sidebar isn't shown while in the Batch writeoff tool and Batch writeoff doesn't appear in the sidebar while using other tools. All of my attempts to writeoff resulted in background jobs that fail. Logs show: [2026/09/09 14:18:26] [WARN] Uncaught exception processing job id=55: Exception 'Koha::Exception' thrown 'batch_writeoff is not a valid job_type' main::catch {...} /kohadevbox/koha/misc/workers/background_jobs_worker.pl (235) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #35 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205387 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205387&action=edit Bug 37645: (follow-up) Address QA feedback for batch writeoff tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #36 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Thanks for testing! I've pushed a follow-up addressing the issues you found: --Fixed the ambiguous branchcode when branch and patron category filters are used together. --Changed the date filters to compare against the date portion of the account line date and made the boundaries inclusive. --Updated the labels to “Created on or after” and “Created on or before.” --Added Batch writeoff to the Tools sidebar and added the sidebar to the Batch writeoff page. --Added regression coverage for the combined category/branch filters and date behavior. I also reproduced the background job issue. The batch_writeoff job type was correctly registered, but my long_tasks worker was still running with the previous code loaded. After restarting that worker, a new Batch writeoff job completed successfully (1/1). The focused account line and background job tests are passing, and git diff --check is clean. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #37 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Two small things: Step 15 - The lost item fee I wrote off received status "Returned" rather than "Forgiven." That doesn't seem correct. Step 18 - While Koha does not enqueue a duplicate job, it still tells the user "The batch writeoff job has been enqueued." It would be more clear and accurate to tell the user that no new job was created. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #38 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Andrew Fuerste-Henry from comment #37)
Two small things: Step 15 - The lost item fee I wrote off received status "Returned" rather than "Forgiven." That doesn't seem correct.
On further testing, I was incorrect here. The LOST fee is marked Forgiven when waived and later updates to Found if the item is checked in or checked out. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #39 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 205650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205650&action=edit Bug 37645: Clarify duplicate batch writeoff jobs Addressed the remaining feedback from comment 37/38. Duplicate active batch writeoff submissions are still prevented from creating another background job, but the staff interface now explicitly reports that a matching job is already queued and that no new job was created, with a link to the existing job. Added test coverage for the duplicate indicator as well. Focused tests and git diff --check pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205261|0 |1 is obsolete| | Attachment #205262|0 |1 is obsolete| | Attachment #205263|0 |1 is obsolete| | Attachment #205264|0 |1 is obsolete| | Attachment #205387|0 |1 is obsolete| | Attachment #205650|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #40 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205774&action=edit Bug 37645: Add reusable methods for writing off debts Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #41 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205775&action=edit Bug 37645: Add batch writeoff staff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #42 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205776&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #43 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205777&action=edit Bug 37645: (follow-up) Add new permission to Permissions.t Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #44 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205778&action=edit Bug 37645: (follow-up) Address QA feedback for batch writeoff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #45 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 205779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205779&action=edit Bug 37645: Clarify duplicate batch writeoff jobs Addressed the remaining feedback from comment 37/38. Duplicate active batch writeoff submissions are still prevented from creating another background job, but the staff interface now explicitly reports that a matching job is already queued and that no new job was created, with a link to the existing job. Added test coverage for the duplicate indicator as well. Focused tests and git diff --check pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 snewell@hmcpl.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |snewell@hmcpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off --- Comment #46 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Rebased the patch series against the current main branch to resolve patch application conflicts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #205774|0 |1 is obsolete| | Attachment #205775|0 |1 is obsolete| | Attachment #205776|0 |1 is obsolete| | Attachment #205777|0 |1 is obsolete| | Attachment #205778|0 |1 is obsolete| | Attachment #205779|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #47 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207519 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207519&action=edit Bug 37645: Add reusable methods for writing off debts Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #48 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207520&action=edit Bug 37645: Add batch writeoff staff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #49 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207521&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #50 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207522 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207522&action=edit Bug 37645: (follow-up) Add new permission to Permissions.t Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #51 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207523 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207523&action=edit Bug 37645: (follow-up) Address QA feedback for batch writeoff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #52 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 207524 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207524&action=edit Bug 37645: Clarify duplicate batch writeoff jobs Addressed the remaining feedback from comment 37/38. Duplicate active batch writeoff submissions are still prevented from creating another background job, but the staff interface now explicitly reports that a matching job is already queued and that no new job was created, with a link to the existing job. Added test coverage for the duplicate indicator as well. Focused tests and git diff --check pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #53 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Although I do think HTML native date pickers have came a long way, we still need to use Flatpickr for consistency. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #54 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 208813 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208813&action=edit Bug 37645: Use Flatpickr for batch writeoff date filters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply CC| |paul.derscheid@lmscloud.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207519|0 |1 is obsolete| | Attachment #207520|0 |1 is obsolete| | Attachment #207521|0 |1 is obsolete| | Attachment #207522|0 |1 is obsolete| | Attachment #207523|0 |1 is obsolete| | Attachment #207524|0 |1 is obsolete| | Attachment #208813|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #55 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211099 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211099&action=edit Bug 37645: Add reusable methods for writing off debts Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #56 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211100&action=edit Bug 37645: Add batch writeoff staff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #57 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211101&action=edit Bug 37645: Add batch writeoff filters and staff tool navigation Test plan: 1. Apply the patches and run the database update. 2. Grant a staff user: - tools > batch_writeoff - updatecharges > writeoff 3. Confirm “Batch writeoff” appears under Tools. 4. Create test data for at least two patrons. If possible, use patrons in different patron categories and create charges at different libraries. Create the following charges: Patron A: - A manual fee (for example, New card fee), with an outstanding balance. - A LOST charge, with an outstanding balance. - A returned OVERDUE fine, with an outstanding balance. Patron B: - A manual fee with an outstanding balance, using a different patron category and/or branch from Patron A. Also create an accruing OVERDUE fine: - Check an item out to a test patron. - Make the item overdue and generate an overdue fine. - Leave the item checked out so that the account line has: debit_type_code = OVERDUE status = UNRETURNED - Do not return the item before testing the batch writeoff. If practical, also leave one fully paid charge on a test patron for comparison. 5. Open Tools > Batch writeoff and confirm filtering is available by: - Created after - Created before - Patron category - Debit type - Branch - Account line ID 6. With no filters selected, click Preview and confirm the tool requires at least one filter. 7. Test the filters individually using the test charges: - Debit type returns only charges of the selected debit type. - Patron category returns only charges belonging to patrons in that category. - Branch returns only charges created for that branch. - Created after excludes older charges. - Created before excludes newer charges. - Account line ID returns the specified eligible charge. 8. Test a combination of filters and confirm only charges matching all selected criteria are returned. 9. Confirm eligible outstanding debts are included in the preview. 10. Confirm the accruing OVERDUE fine with status UNRETURNED is NOT included in the preview. 11. If a fully paid charge was created, confirm it is NOT included in the preview. 12. Select one or more eligible charges and submit the batch writeoff. 13. Confirm a background job is created. 14. Confirm the background job finishes successfully and reports the account lines that were written off. 15. Confirm each original debit that was written off has: - amountoutstanding = 0 - status = FORGIVEN 16. Confirm a WRITEOFF credit and APPLY offset are created for each successful writeoff. 17. Confirm the accruing OVERDUE fine remains unchanged and outstanding. 18. Confirm duplicate active submissions for the same staff user, branch, and account-line set do not create stacked background jobs. 19. Run a report that returns an accountlines_id column. 20. Confirm Batch operations > Batch writeoff is available in the report results. 21. Send the report results to Batch writeoff and confirm the visible account line IDs are loaded into the tool and eligible lines can be previewed and submitted. 22. Confirm misc/cronjobs/writeoff_debts.pl continues to work using the shared writeoff routines. Automated tests: prove -v t/db_dependent/Koha/Account/Line.t prove -v t/db_dependent/Koha/Account/Lines.t prove -v t/db_dependent/Koha/BackgroundJob/BatchWriteoff.t All tests pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #58 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211102 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211102&action=edit Bug 37645: (follow-up) Add new permission to Permissions.t Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #59 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211103&action=edit Bug 37645: (follow-up) Address QA feedback for batch writeoff tool Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #60 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211104&action=edit Bug 37645: Clarify duplicate batch writeoff jobs Addressed the remaining feedback from comment 37/38. Duplicate active batch writeoff submissions are still prevented from creating another background job, but the staff interface now explicitly reports that a matching job is already queued and that no new job was created, with a link to the existing job. Added test coverage for the duplicate indicator as well. Focused tests and git diff --check pass. Signed-off-by: Marisha Sullivan <msullivan@holdenfg.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #61 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211105&action=edit Bug 37645: Use Flatpickr for batch writeoff date filters -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #62 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 211106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211106&action=edit Bug 37645: Fix test file tidiness -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #63 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hi Laura, Thanks for working on this. Having the cron and the new tool share a single writeoff() / search_for_writeoff code path is a nice improvement, and the structure is easy to follow. I applied the patches, ran the new tests (Permissions.t, Account/Line.t, Account/Lines.t, BackgroundJob/BatchWriteoff.t, plus Account.t and BackgroundJob.t) and the QA script. They all pass, so what follows is mostly things the current tests don't exercise. The first two are the ones I'd really like to see fixed, because both can lead to an unintended mass writeoff. BLOCKERS 1. An empty --file writes off everything (misc/cronjobs/writeoff_debts.pl) Before the patch, an empty list became "accountlines_id IN ()" and matched nothing. Now search_for_writeoff ignores an empty accountline_ids, and the "at least one filter" check passes because $file is set. I checked this: with one outstanding debt in the database, search_for_writeoff({ accountline_ids => [] }) returns it. So "--file empty.txt --confirm" would write off every outstanding debt, and the same happens if the file only holds blank or non-numeric lines. Could you validate and trim the IDs (/^\d+$/), die if --file gives us none, and make search_for_writeoff treat "IDs supplied but empty" differently from "no ID filter" (exists $params->{accountline_ids} rather than truthiness)? A test for that case would be great. 2. The web tool ignores the user's dateformat (tools/writeoff_debts.pl) The flatpickr fields submit dates in the system preference format, and those values go straight into "DATE(me.date) <= ?". I checked this too: added_before => '2999-01-01' matches my test debt, '01/01/2999' matches nothing. On any non-ISO site the preview and the writeoff set will be wrong without any warning. Please run the values through dt_from_string, hand ISO dates to search_for_writeoff, and reject anything that doesn't parse. A test with a non-ISO dateformat would be good. ON DATE FORMATS GENERALLY Most of the cron scripts that take dates (delete_patrons.pl, update_patrons_category.pl, overdue_notices.pl, holds_reminder.pl) use ISO YYYY-MM-DD parsed with dt_from_string($v, 'iso'). Let's stick with that for the CLI options here. For the web tool, convert from the user's format to ISO in the script, and keep search_for_writeoff ISO-only. (cleanup_database.pl and erm_run_harvester.pl parse in the syspref format instead. That's out of scope here, but probably worth its own bug.) SHOULD FIX 3. Cron date semantics changed. It used to be "date < 'YYYY-MM-DD 00:00:00'" / "date > ...". Now it's DATE(date) <= / >=, so the boundary day is included. That might be the better behaviour, but it needs to be deliberate, so please note it in the POD and commit message, or keep the old behaviour. DATE(me.date) also can't use an index on a big accountlines table, so a range comparison (date >= ? and date < ? + 1 day) would be kinder. 4. BatchWriteoff::process uses stale data and skips silently. All lines are loaded up front. If one is paid or changed while the job waits in the queue, it's written off using the old amount, or fails. Please reload each line (->discard_changes) before writing it off. Lines that are no longer eligible are skipped with no message, so total_records and total_success don't add up and the report doesn't say why. A "skipped / not eligible" message would help. 5. Line::writeoff exceptions. The PAYOUT guard throws IsNotDebit, which is misleading, so a dedicated exception would be clearer. The state guards also run before the mandatory-parameter checks, so the error you get depends on the line. Please document the exceptions in the POD. 6. No error handling in the cron. writeoff can now throw, and the first failure aborts the whole run. Please catch per line and report under --verbose. 7. Library scoping. The tool offers every library and can write off lines for any branch, whatever IndependentBranches says. It would be good to match how the sibling tools handle this. The branch filter also uses accountlines.branchcode, which can be NULL. 8. Translatable strings and error text (tools/writeoff_debts.pl). The messages set in Perl (filter_error, "No eligible account lines...") can't be translated, so please pass flags and keep the wording in the template. error => "$_" also shows raw exception text to staff. Log it and show something generic. 9. Preview uses cud-form. It works because of the CSRF token, but cud- should be for state changes, and preview is read-only. The report page also posts the ID list as a hidden textarea, so a cap on size would be sensible. 10. Duplicate-job check in enqueue. It's race-prone, and $data->{staff_id} eq $staff_id will warn if $staff_id is undef. 11. Job link permissions. The "view job" link goes to admin/background_jobs.pl, which requires catalogue. Someone with only tools: batch_writeoff and updatecharges: writeoff may not be able to open it. Could you check? TESTS The current tests don't cover an empty ID list, a non-ISO dateformat, or a line that changes between enqueue and process, so those would be worth adding alongside the fixes above. NITS - BackgroundJob.pm: batch_writeoff is out of order in core_types_to_classes. - Exceptions/Account.pm: stray =cut before the next =head2 (the QA script skips pod_coverage on this file). - batch_writeoff.inc: empty js block and unused success/warning branches. - A short comment on the -not { OVERDUE + UNRETURNED } condition would help. It's easy to misread. - Please squash the follow-up commits when you attach the next version. Thanks again, and shout if any of this is unclear. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #64 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- *** Bug 39168 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 Michael Adamyk <michael.adamyk@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.adamyk@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37645 --- Comment #65 from Andrii Nugged <nugged@gmail.com> --- Laura, we also need this functionality and would be happy to help move this series forward. The shared writeoff code path and the staff tool look like a useful foundation. Are you already working on Martin's QA feedback in comment 63? We could help address those issues, including reworking parts of the implementation where needed. Let us know which parts would be most useful for us to take on so we can avoid overlapping work. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org