[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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #6 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Would PQA, but the main commit is missing the SO, if anyone can confirm Anna's SO, I will fill it in. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Paul Derscheid from comment #6)
Would PQA, but the main commit is missing the SO, if anyone can confirm Anna's SO, I will fill it in.
Can confirm she OKed sign-off on both, I just did it poorly! -- 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 #209865|0 |1 is obsolete| | Attachment #209927|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 #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210966&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 Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210967 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210967&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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=43941 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210966|0 |1 is obsolete| | Attachment #210967|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 #10 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211027 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211027&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 Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #11 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211028 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211028&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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #12 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211030 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211030&action=edit Bug 43941: (QA follow-up) Test processing_fee with ItemHomeLibrary - Give the test item distinct home and holding libraries - Cover LostChargesControl ItemHomeLibrary with both HomeOrHoldingBranch values Test plan: 1. prove -v /kohadevbox/koha/t/db_dependent/Koha/Checkout.t 2. Tests pass Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <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=43941 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211027|0 |1 is obsolete| | Attachment #211028|0 |1 is obsolete| | Attachment #211030|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 #13 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211048 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211048&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 Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> Signed-off-by: Paul Derscheid <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=43941 --- Comment #14 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211049 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211049&action=edit Bug 43941: Add unit tests Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> Signed-off-by: Paul Derscheid <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=43941 --- Comment #15 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 211051 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211051&action=edit Bug 43941: (QA follow-up) Test processing_fee with ItemHomeLibrary - Give the test item distinct home and holding libraries - Cover LostChargesControl ItemHomeLibrary with both HomeOrHoldingBranch values Test plan: 1. prove -v /kohadevbox/koha/t/db_dependent/Koha/Checkout.t 2. Tests pass Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <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=43941 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k Status|Passed QA |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=43941 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- 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 #211048|0 |1 is obsolete| | Attachment #211049|0 |1 is obsolete| | Attachment #211051|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 #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211740&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 Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> Signed-off-by: Paul Derscheid <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=43941 --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211741 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211741&action=edit Bug 43941: Add unit tests Signed-off-by: Anna Stalter <staltera@hamiltoneastpl.org> Signed-off-by: Paul Derscheid <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=43941 --- Comment #18 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211742 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211742&action=edit Bug 43941: (QA follow-up) Test processing_fee with ItemHomeLibrary - Give the test item distinct home and holding libraries - Cover LostChargesControl ItemHomeLibrary with both HomeOrHoldingBranch values Test plan: 1. prove -v /kohadevbox/koha/t/db_dependent/Koha/Checkout.t 2. Tests pass Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <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=43941 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 --- Comment #19 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=43941 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Checkouts have a new release notes| |`processing_fee` method | |that returns the processing | |fee from the Default lost | |item fee policy in | |Circulation and fine rules. | |Notice templates can print | |it, for example in the | |issue slip with `[% | |c.processing_fee %]` inside | |`borrower.checkouts`. -- 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|Pushed to main |Needs documenting --- Comment #20 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43941 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_26_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org