Bug 40182 - Tracking patron activity with charges
Summary: Tracking patron activity with charges
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lari Strand
QA Contact: Testopia
URL:
Keywords:
Depends on: 15504
Blocks:
  Show dependency treegraph
 
Reported: 2025-06-19 11:51 UTC by Katariina Pohto
Modified: 2025-06-26 12:15 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40182: Update lastseen when adding/modifying charges (3.66 KB, patch)
2025-06-26 09:04 UTC, Lari Strand
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katariina Pohto 2025-06-19 11:51:41 UTC
We're tacking patron activity with lastseen and noticed that accruing charges or paying them does not update the lastseen value.

Just in general getting and paying charges is an indication of activity, but we also have some patrons that are using their library card solely for copy charges in libraries that don't have a possibility for direct payment. We have no trace of the activity of these patrons, and managed to even delete some of them when cleaning up inactive patrons.

We'd like to be able to add a syspref to TrackLastPatronActivityTriggers for charges. Especially it should be when a charge is (manually) added and when a charge is paid. There will be cronjobs to expire charges and there could be writeoffs that don't require acitivity from the patron, so not just any change in charges is useful for this tracking.
Comment 1 Lari Strand 2025-06-26 09:04:51 UTC
Created attachment 183529 [details] [review]
Bug 40182: Update lastseen when adding/modifying charges

To test:

1. make a payment/add credit/create an invoice to a patron
2. check that lastseen hasn't updated
3. Check "Adding patron a charge or credit" and "Modifying a patron's charge or credit" from TrackLastPatronActivityTriggers syspref
4. repeat step 1's action
5. Notice lastseen having been updated

To test the new triggers you sould use multiple patrons and/or restart memcached since lastseen is not updated for the same patron but once a day
Comment 2 Lari Strand 2025-06-26 09:09:59 UTC
This approach is just a simple way of handling manual accountline modifications' lastseen updates for the patron that doesn't collide with cronjobs modifying patrons' accountlines. The new selections/descriptions for the TrackLastPatronActivityTriggers syspref might also need some input from you guys.
Comment 3 Lari Strand 2025-06-26 09:15:36 UTC
Writing off some/all charges should also update lastseen for the patron whose account is being dealt with and follows modify_charges (Modifying a patron's charge or credit) preference.