[Bug 43941] New: Add template plugin for fetching processing fee
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Bug ID: 43941 Summary: Add template plugin for fetching processing fee Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Notices Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lucas@bywatersolutions.com, martin.renvoize@openfifth.co.uk Depends on: 36506 Target Milestone: --- When Bug 36506 moved processing fees into the circulation rules it become much harder to include in an overdue notice. Previously, one could use [% overdue.item.itemtype.processfee %] to get the processing fee for the item type of a checked out item. Now one must get the relevant circ rule value, which requires knowing which branch to use based on the LostChargesControl and HomeOrHoldingBranch system preferences. It would be great to add a template plugin to allow one to use [% overdue.item.processing_fee %] and let Koha handle the work of checking system preferences and requesting the rule value. For reference, here's a basic notice template: [%- USE CirculationRules -%] [%- USE Koha -%] [%- SET lost_pref = Koha.Preference('LostChargesControl') -%] [%- SET item_field = Koha.Preference('HomeOrHoldingBranch') -%] Dear [% borrower.firstname %] [% borrower.surname %], These items are overdue: [% FOREACH odue IN overdues %] [%- SET process_branch = lost_pref == 'ItemHomeLibrary' ? c.item.$item_field : lost_pref == 'PickupLibrary' ? c.item.checkout.branchcode : borrower.branchcode -%] [%- SET processfee = CirculationRules.Get( process_branch, borrower.categorycode, c.item.effective_itemtype, 'lost_item_processing_fee' ) || 0 -%] "[% odue.item.biblio.title %]" by [% odue.item.biblio.author %], [% odue.item.itemcallnumber %], Barcode: [% odue.item.barcode %], Fine: [% overdue.overdue_fines.total_outstanding %] Replacement price: [% odue.item.replacementprice %] Processing fee: [% processfee %] [% END %] Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36506 [Bug 36506] Processing fee should be configurable by library -- 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=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- 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=43941 --- Comment #1 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Bug 35612 added branch_for_fee_context which could do a lot of what we need here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |35612 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35612 [Bug 35612] Record branch context in accountlines.branchcode for OVERDUE, LOST, and PROCESSING fees -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43948 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add template plugin for |Add a method for fetching |fetching processing fee |processing fee from | |circulation rules -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #2 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 209865 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209865&action=edit Bug 43941: Add new method to Koha/Checkout to get the processing fee from circ rules To test: 1. APPLY PATCH, restart_all 2. Go to Administration - > Circulation and fine rules 3. Set up some "Default lost item fee policy" for different item types. 4. Checkout some of those configured item types to a patron 5. In an ISSUESLIP add: [% USE Price %] [% FOREACH c IN borrower.checkouts %] [% c.processing_fee | $Price %] [% END %] 6. Print the ISSUESLIP. You should correctly see the differently configured process fees on the slip 7. prove -v /kohadevbox/koha/t/db_dependent/Koha/Checkout.t 8. Tests should pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #3 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 209866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209866&action=edit Bug 43941: Add unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_26_05_candidate, | |rel_26_11_candidate --- Comment #4 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- While this is technically an enhancement, I'm flagging it for potential backport to 26.05 because it simplifies something that a lot of libraries want and got unexpectedly much more complicated in 26.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 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=43941 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209866|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=43941 --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 209927 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209927&action=edit Bug 43941: Add unit tests Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org