[Bug 38023] New: Add ability to exclude certain item types for advance_notice.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38023 Bug ID: 38023 Summary: Add ability to exclude certain item types for advance_notice.pl Change sponsored?: --- 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: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Libraries often request that certain item types not be reported upon in an advance notice. It's pretty trivial to exclude them from a DUE or PREDUE with TT but the digest ones are not as easy. Would be nice if there was an flag in the cron to exclude. -- 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=38023 --- Comment #1 from Slava Shishkin <slavashishkin@gmail.com> --- Created attachment 209591 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209591&action=edit Bug 38023: Allow excluding item types from advance notices Add repeatable --itemtypesout to exclude types from individual and digest DUE/PREDUE notices. Fetch both item and bibliographic types in one query, respect item-level_itypes, update digest counts and skip empty digests. Test plan: 1. Prepare BK/ILL/REF loans due today and in three days, with individual and digest email notices enabled. Include an ILL-only patron. 2. Run with and without the patch; output should match: perl misc/cronjobs/advance_notices.pl -c -n -m 3 --itemscontent barcode 3. Add --itemtypesout ILL: ILL loans disappear, counts remain correct and no empty notices appear. Repeat the option for multiple types. 4. Repeat with --digest-per-branch and both item-level_itypes settings, including fallback when an item's type is unset. Assisted-by: OpenAI Codex -- 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=38023 Slava Shishkin <slavashishkin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |slavashishkin@gmail.com Status|NEW |Needs Signoff -- 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=38023 --- Comment #2 from Andrii Nugged <nugged@gmail.com> --- Created attachment 211733 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211733&action=edit Bug 38023: Scope item type exclusions to checkout libraries The item type exclusion currently applies to every checkout library. The same item type may need reminders at one library and be excluded at another. Add repeatable --itemtypesout-library to restrict the existing item type filter to selected checkout libraries. Other item types and loans from other libraries remain eligible. The checkout library is used independently of --frombranch. Without the new option, exclusions remain global. Use the existing early filter so individual notices, digest contents and counts share the same selection, without splitting combined digests. Test plan: Prerequisites: apply the existing Bug 38023 patch. On a test instance, prepare three loans for one patron, all due tomorrow: type ILL at LIB1, type ILL at LIB2, and another type at LIB1. Substitute the actual item type and library codes below. In the patron messaging preferences, select Email and Digests only for Advance notice, and set Days in advance to 1. Configure the PREDUEDGST Email notice for the patron's home library with this plain-text content: COUNT <<count>> ITEMS <<items.content>> The --itemscontent barcode argument below makes <<items.content>> contain the barcodes. Before applying the patch: 1. Run the cron in no-send mode: perl misc/cronjobs/advance_notices.pl -c -n --itemscontent barcode \ --itemtypesout ILL 2. Confirm the digest contains only the other item type, with count 1. Both ILL loans are excluded; their checkout libraries cannot be scoped. Apply the patch. After applying the patch: 1. Repeat with the exclusion restricted to LIB1: perl misc/cronjobs/advance_notices.pl -c -n --itemscontent barcode \ --itemtypesout ILL --itemtypesout-library LIB1 2. Confirm one digest contains the other type at LIB1 and the ILL loan at LIB2, with count 2. The ILL loan at LIB1 is excluded. 3. Repeat the original command without --itemtypesout-library and confirm the original global exclusion and count 1. 4. Repeat --itemtypesout-library for additional checkout libraries and confirm exclusions apply at each selected library. Automated tests: prove -I. -It/lib t/db_dependent/cronjobs/advance_notices_digest.t Coverage includes DUE, PREDUE, DUEDGST and PREDUEDGST, multiple libraries, normal item types, global defaults, empty results, combined and per-library digests, bibliographic item types and a different owning library. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org