[Bug 43504] New: Extract Koha::Account->forgive_debit from _FixOverduesOnReturn
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Bug ID: 43504 Summary: Extract Koha::Account->forgive_debit from _FixOverduesOnReturn Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: chloe.zermatten@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- In preparation for bug 39756, extract Koha::Account->forgive_debit from _FixOverduesOnReturn. The new method is also independent from userenv. This patch is also to do with bug 39756 not calling either LostItem or the methods it calls (in this case, _FixOverduesOnReturn) so that it is compatible with the trigger-based circulation rules around long overdue processing 39756 introduces. -- 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=43504 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Blocks| |39756 Assignee|koha-bugs@lists.koha-commun |chloe.zermatten@openfifth.c |ity.org |o.uk Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39756 [Bug 39756] Long overdue cron configuration page -- 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=43504 --- Comment #1 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 206650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206650&action=edit Bug 43504: refactor: extract forgive_debit from _FixOverduesOnReturn In preparation for bug 39756, the forgive_debit method is introduced to Account.pm The choice of location is due to it calling Koha::Account::add_credit. This also removes the reliance on userenv. Test plan: 1) run prove -t t/db_dependent/Koha/Account.t (see next commit for the new tests) 2) run prove -t t/db_dependent/Circulation.t (regression check, targets '_FixOverduesOnReturn') 3) manually test forgiving a fine to ensure no regression was introduced. a) Set finesMode to 'Calculate and charge'. Give your staff user the updatecharges => writeoff permission. b) At admin/circulation-rules.pl, for the patron category, item type and library you will use, set: - Fine amount: 1 - Fine charging interval: 1 - Fine grace period: 0 c) Check an item out to a patron and backdate the due date by a week. d) perl misc/cronjobs/fines.pl -v Confirm an OVERDUE accountline with status UNRETURNED exists. e) Return the item with 'Forgive overdue charges' ticked on the returns page. f) Confirm a FORGIVEN credit exists for the amount outstanding and the overdue line is settled and now has status RETURNED. g) In accountlines, confirm the FORGIVEN credit's manager_id is your staff user's borrowernumber and branchcode is the library you are logged in at. h) Repeat step c) and d), and this time do not tick 'Forgive overdue charges'. i) Confirm the fine created in i) was left untouched Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 --- Comment #2 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 206651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206651&action=edit Bug 43504: test: Koha::Account->forgive_debit Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> 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=43504 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=43504 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206650|0 |1 is obsolete| | Attachment #206651|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=43504 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208411&action=edit Bug 43504: refactor: extract forgive_debit from _FixOverduesOnReturn In preparation for bug 39756, the forgive_debit method is introduced to Account.pm The choice of location is due to it calling Koha::Account::add_credit. This also removes the reliance on userenv. Test plan: 1) run prove -t t/db_dependent/Koha/Account.t (see next commit for the new tests) 2) run prove -t t/db_dependent/Circulation.t (regression check, targets '_FixOverduesOnReturn') 3) manually test forgiving a fine to ensure no regression was introduced. a) Set finesMode to 'Calculate and charge'. Give your staff user the updatecharges => writeoff permission. b) At admin/circulation-rules.pl, for the patron category, item type and library you will use, set: - Fine amount: 1 - Fine charging interval: 1 - Fine grace period: 0 c) Check an item out to a patron and backdate the due date by a week. d) perl misc/cronjobs/fines.pl -v Confirm an OVERDUE accountline with status UNRETURNED exists. e) Return the item with 'Forgive overdue charges' ticked on the returns page. f) Confirm a FORGIVEN credit exists for the amount outstanding and the overdue line is settled and now has status RETURNED. g) In accountlines, confirm the FORGIVEN credit's manager_id is your staff user's borrowernumber and branchcode is the library you are logged in at. h) Repeat step c) and d), and this time do not tick 'Forgive overdue charges'. i) Confirm the fine created in i) was left untouched Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 --- Comment #4 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208412 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208412&action=edit Bug 43504: test: Koha::Account->forgive_debit Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.com |y.org | 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=43504 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208411|0 |1 is obsolete| | Attachment #208412|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=43504 --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208413&action=edit Bug 43504: refactor: extract forgive_debit from _FixOverduesOnReturn In preparation for bug 39756, the forgive_debit method is introduced to Account.pm The choice of location is due to it calling Koha::Account::add_credit. This also removes the reliance on userenv. Test plan: 1) run prove -t t/db_dependent/Koha/Account.t (see next commit for the new tests) 2) run prove -t t/db_dependent/Circulation.t (regression check, targets '_FixOverduesOnReturn') 3) manually test forgiving a fine to ensure no regression was introduced. a) Set finesMode to 'Calculate and charge'. Give your staff user the updatecharges => writeoff permission. b) At admin/circulation-rules.pl, for the patron category, item type and library you will use, set: - Fine amount: 1 - Fine charging interval: 1 - Fine grace period: 0 c) Check an item out to a patron and backdate the due date by a week. d) perl misc/cronjobs/fines.pl -v Confirm an OVERDUE accountline with status UNRETURNED exists. e) Return the item with 'Forgive overdue charges' ticked on the returns page. f) Confirm a FORGIVEN credit exists for the amount outstanding and the overdue line is settled and now has status RETURNED. g) In accountlines, confirm the FORGIVEN credit's manager_id is your staff user's borrowernumber and branchcode is the library you are logged in at. h) Repeat step c) and d), and this time do not tick 'Forgive overdue charges'. i) Confirm the fine created in i) was left untouched Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> Signed-off-by: Andrew Fuerste Henry <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=43504 --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208414 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208414&action=edit Bug 43504: test: Koha::Account->forgive_debit Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> Signed-off-by: Andrew Fuerste Henry <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=43504 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43508 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 [Bug 43508] Extract Koha::Account->add_lost_replacement_fee from chargelostitem -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208413|0 |1 is obsolete| | Attachment #208414|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=43504 --- Comment #7 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 208475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208475&action=edit Bug 43504: refactor: extract forgive_debit from _FixOverduesOnReturn In preparation for bug 39756, the forgive_debit method is introduced to Account.pm The choice of location is due to it calling Koha::Account::add_credit. This also removes the reliance on userenv. Test plan: 1) run prove -t t/db_dependent/Koha/Account.t (see next commit for the new tests) 2) run prove -t t/db_dependent/Circulation.t (regression check, targets '_FixOverduesOnReturn') 3) manually test forgiving a fine to ensure no regression was introduced. a) Set finesMode to 'Calculate and charge'. Give your staff user the updatecharges => writeoff permission. b) At admin/circulation-rules.pl, for the patron category, item type and library you will use, set: - Fine amount: 1 - Fine charging interval: 1 - Fine grace period: 0 c) Check an item out to a patron and backdate the due date by a week. d) perl misc/cronjobs/fines.pl -v Confirm an OVERDUE accountline with status UNRETURNED exists. e) Return the item with 'Forgive overdue charges' ticked on the returns page. f) Confirm a FORGIVEN credit exists for the amount outstanding and the overdue line is settled and now has status RETURNED. g) In accountlines, confirm the FORGIVEN credit's manager_id is your staff user's borrowernumber and branchcode is the library you are logged in at. h) Repeat step c) and d), and this time do not tick 'Forgive overdue charges'. i) Confirm the fine created in i) was left untouched Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> Signed-off-by: Andrew Fuerste Henry <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=43504 --- Comment #8 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 208476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208476&action=edit Bug 43504: test: Koha::Account->forgive_debit Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Christie Balestrieri <balestrieri@monterey.org> Signed-off-by: Andrew Fuerste Henry <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=43504 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Rapid City Public Library list of Sponsors| |<https://www.rapidcitylibra | |ry.org/> Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.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=43504 --- Comment #9 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Developers: forgiving release notes| |overdue charges on return | |is now | |`Koha::Account->forgive_deb | |it`, which no longer | |depends on the logged-in | |user's environment. | |Behaviour for staff is | |unchanged. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 Bug 43504 depends on bug 43508, which changed state. Bug 43508 Summary: Extract Koha::Account->add_lost_replacement_fee from chargelostitem https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |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=43504 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement, no 26.05.x backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org