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.