[Bug 43508] New: Extract Koha::Account->add_lost_replacement_fee from chargelostitem
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Bug ID: 43508 Summary: Extract Koha::Account->add_lost_replacement_fee from chargelostitem 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 a similar vein to bugs 43504, 43501, and 43500, this is preparation for 39756 that extracts logic which the new overdue triggers processing script will be relying on, and removes the userenv dependency. This time we extract Koha::Account->add_lost_replacement_fee from chargelostitem. -- 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=43508 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |chloe.zermatten@openfifth.c |ity.org |o.uk Blocks| |39756 Status|NEW |ASSIGNED 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 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=43508 --- Comment #1 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 206805 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206805&action=edit Bug 43508: refactor(Account): extract add_lost_replacement_fee For the purposes of bug 39756, we need a modern OOP method which keeps: - the deduplication logic - the useDefaultReplacementCost fallback - the lost_item_processing_fee rule lookup - both add_debit calls (PROCESSING and LOST) Extract Koha::Account->add_lost_replacement_fee from chargelostitem. However, partly for SRP and mostly for compatibility with bug 39756's trigger-based overdue circulation rules, we reduce the scope of the routine's repsonsibilities and remove branch resolution, and issue-id discovery, leaving those to the caller. We also remove the reliance on userenv. For testing: expect no changes to existing features. Test plan: 1) run prove -t t/db_dependent/Accounts.t (regression check) 2) run prove -t t/db_dependent/Koha/Account.t (tests added, see following commit) 3) Charge a lost item through LostItem: a) Set the WhenLostChargeReplacementFee system preference to 'Charge'. b) Edit the item you will use in your testing: give it a "v - Cost, replacement price". c) Navigate to /cgi-bin/koha/admin/smart-rules.pl, and under "Default lost item fee policy" set a "Lost item processing fee", for 'All' Item type. d) Check the item out to a test patron e) Edit your item again, and set '1 - Lost status' to 'Lost'. f) View your test patron's Accounting page to confirm a LOST debit was added for the replacement price, and a PROCESSING debit for the processing fee. Check that the staff member named on both is the staff member you used to carry out the testing. Go through part 3), steps a) to f), both before and after applying the patch: there should be no behaviour differences. 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=43508 --- Comment #2 from Chloé Zermatten <chloe.zermatten@openfifth.co.uk> --- Created attachment 206806 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206806&action=edit Bug 43508: test(Account): add_lost_replacement_fee 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=43508 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=43508 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |f.demians@tamil.fr --- Comment #3 from Frédéric Demians <f.demians@tamil.fr> --- prove t/db_dependent/Accounts.t t/db_dependent/Koha/Account.t: 45 tests pass. I ran the same test scenario before and after the patch, without noticing any difference. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Black Hills Library list of Sponsors| |Consortium- | |http://www.rcgov.org/Librar | |y/ Sponsorship status|--- |Sponsored 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=43508 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206805|0 |1 is obsolete| | Attachment #206806|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=43508 --- Comment #4 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207940&action=edit Bug 43508: refactor(Account): extract add_lost_replacement_fee For the purposes of bug 39756, we need a modern OOP method which keeps: - the deduplication logic - the useDefaultReplacementCost fallback - the lost_item_processing_fee rule lookup - both add_debit calls (PROCESSING and LOST) Extract Koha::Account->add_lost_replacement_fee from chargelostitem. However, partly for SRP and mostly for compatibility with bug 39756's trigger-based overdue circulation rules, we reduce the scope of the routine's repsonsibilities and remove branch resolution, and issue-id discovery, leaving those to the caller. We also remove the reliance on userenv. For testing: expect no changes to existing features. Test plan: 1) run prove -t t/db_dependent/Accounts.t (regression check) 2) run prove -t t/db_dependent/Koha/Account.t (tests added, see following commit) 3) Charge a lost item through LostItem: a) Set the WhenLostChargeReplacementFee system preference to 'Charge'. b) Edit the item you will use in your testing: give it a "v - Cost, replacement price". c) Navigate to /cgi-bin/koha/admin/smart-rules.pl, and under "Default lost item fee policy" set a "Lost item processing fee", for 'All' Item type. d) Check the item out to a test patron e) Edit your item again, and set '1 - Lost status' to 'Lost'. f) View your test patron's Accounting page to confirm a LOST debit was added for the replacement price, and a PROCESSING debit for the processing fee. Check that the staff member named on both is the staff member you used to carry out the testing. Go through part 3), steps a) to f), both before and after applying the patch: there should be no behaviour differences. Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 --- Comment #5 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207941&action=edit Bug 43508: test(Account): add_lost_replacement_fee Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 --- Comment #6 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 207942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207942&action=edit Bug 43508: (follow-up) Remove non-ASCII character from add_lost_replacement_fee POD koha-qa.pl fails on Koha/Account.pm: FAIL pod Non-ASCII character seen before =encoding in '—' Replace the em dash with a colon. Test plan: 1. koha-qa.pl -c 3 passes for Koha/Account.pm 2. podchecker Koha/Account.pm reports no error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207940|0 |1 is obsolete| | Attachment #207941|0 |1 is obsolete| | Attachment #207942|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=43508 --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208408&action=edit Bug 43508: refactor(Account): extract add_lost_replacement_fee For the purposes of bug 39756, we need a modern OOP method which keeps: - the deduplication logic - the useDefaultReplacementCost fallback - the lost_item_processing_fee rule lookup - both add_debit calls (PROCESSING and LOST) Extract Koha::Account->add_lost_replacement_fee from chargelostitem. However, partly for SRP and mostly for compatibility with bug 39756's trigger-based overdue circulation rules, we reduce the scope of the routine's repsonsibilities and remove branch resolution, and issue-id discovery, leaving those to the caller. We also remove the reliance on userenv. For testing: expect no changes to existing features. Test plan: 1) run prove -t t/db_dependent/Accounts.t (regression check) 2) run prove -t t/db_dependent/Koha/Account.t (tests added, see following commit) 3) Charge a lost item through LostItem: a) Set the WhenLostChargeReplacementFee system preference to 'Charge'. b) Edit the item you will use in your testing: give it a "v - Cost, replacement price". c) Navigate to /cgi-bin/koha/admin/smart-rules.pl, and under "Default lost item fee policy" set a "Lost item processing fee", for 'All' Item type. d) Check the item out to a test patron e) Edit your item again, and set '1 - Lost status' to 'Lost'. f) View your test patron's Accounting page to confirm a LOST debit was added for the replacement price, and a PROCESSING debit for the processing fee. Check that the staff member named on both is the staff member you used to carry out the testing. Go through part 3), steps a) to f), both before and after applying the patch: there should be no behaviour differences. Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> 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=43508 --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208409&action=edit Bug 43508: test(Account): add_lost_replacement_fee Sponsored-by: Black Hills Library Consortium- http://www.rcgov.org/Library/ Assisted-by: Claude Opus 5 (Anthropic) Signed-off-by: Frédéric Demians <f.demians@tamil.fr> 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=43508 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 208410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208410&action=edit Bug 43508: (follow-up) Remove non-ASCII character from add_lost_replacement_fee POD koha-qa.pl fails on Koha/Account.pm: FAIL pod Non-ASCII character seen before =encoding in '—' Replace the em dash with a colon. Test plan: 1. koha-qa.pl -c 3 passes for Koha/Account.pm 2. podchecker Koha/Account.pm reports no error 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=43508 Chloé Zermatten <chloe.zermatten@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43504 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43504 [Bug 43504] Extract Koha::Account->forgive_debit from _FixOverduesOnReturn -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited|Black Hills Library |Rapid City Public Library list of Sponsors|Consortium- |<https://www.rapidcitylibra |http://www.rcgov.org/Librar |ry.org/> |y/ | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 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=43508 --- Comment #10 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=43508 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Developers: charging the release notes| |replacement and processing | |fees for a lost item is now | |`Koha::Account->add_lost_re | |placement_fee`, taken out | |of the `chargelostitem` | |routine in `C4::Accounts`. | |It keeps the deduplication, | |default replacement cost | |and processing fee rule | |handling. Lost item | |charging behaves as before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43508 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com Resolution|--- |FIXED --- Comment #11 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