https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42186

--- Comment #1 from Paul Derscheid <[email protected]> ---
Created attachment 196367
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196367&action=edit
Bug 42186: Add extended patron search filters

The patron search page only offers basic filters (library, category,
search field, search type). This makes it difficult for staff to
narrow down patron lists by common operational criteria such as age,
checkout activity, account balance, or account status.

This patch adds the following filters to the patron search sidebar:
- Patron age range (from/to)
- Number of checkouts range (from/to)
- Account balance range (from/to)
- Account expiry date range (from/to)
- Restriction (debarred) period range (from/to)
- Inactive since date (no checkouts or activity)
- Valid email address (has/does not have)
- Patron list membership

On the API side, custom filter parameters are extracted from the
JSON q parameter before the Objects plugin processes it, then
applied as DBIC conditions on the base resultset. Existing Koha
methods are used where available (filter_by_amount_owed for
charges, DBIC joins for patron lists). Literal SQL is used only
where no abstraction exists (checkout count, email validation).

Test plan:
1. Navigate to Patrons > Search (members/member.pl).
2. Verify the sidebar now shows additional filter fields below
   the existing Library/Category filters.
3. Enter an age range (e.g. 18 to 30) and click Search.
   - Confirm only patrons within that age range appear.
4. Clear filters, then enter a checkout count range (e.g. 5 to
   50) and search.
   - Confirm results match patrons with that many current
     checkouts.
5. Clear filters, then enter a charges range (e.g. 0 to 10) and
   search.
   - Confirm patrons with account balance in that range appear,
     including patrons with no accountlines when 0 is in the
     range.
6. Test account expiry from/to date filters.
7. Test restriction period from/to date filters.
8. Test "Inactive since" with a date in the past.
   - Confirm only patrons with no checkouts and no activity
     since that date appear.
9. Test "Email address" filter set to "Has valid email" and
   "No valid email".
10. Create a patron list, add some patrons, then filter by that
    list.
    - Confirm only patrons on the list appear.
11. Verify the Clear button resets all new filter fields.
12. Combine multiple filters (e.g. age range + category +
    charges) and confirm they work together correctly.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to