[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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org