Support Script to Update Patron Penalties Needed

Bug #1944986 reported by Michele Morgan
64
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

Master circa 3.7

When changes are made to Group Penalty Thresholds, there is currently no way to refresh penalties across the entire database of users.

A support script to perform that function would be most useful, if not essential.

Such a script, if run regularly as a cleanup job, would also help with (but not solve) related bug 1823225, which states that there is no way to recalculate penalties in the client.

I'm taking the liberty of marking bug 979922 as a duplicate of this new one, which presents the use case of a patron's profile being changed to one where different group penalty thresholds apply.

Michele Morgan (mmorgan)
tags: added: circulation supportscripts
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Bill Erickson (berick) wrote :

Been meaning to put something together for this so I can stop with the ad-hoc shell scripts.

Plan is to create a support-scripts Perl script that has a few options:

* process all non-deleted patrons
* process patrons from a file of IDs

To handle some other common cases, add filters like:

* limit to patrons with fines greater than / less then X
* limit to patrons with open circulations.
* Probably others..

Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Here's a branch:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1944986-patron-penalty-batch-update

cd Open-ILS/src/support-scripts && ./patron-penalties-batch.pl --help

Changed in evergreen:
milestone: none → 3.10-beta
tags: added: pullrequest
Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Pushed --has-penalty and --no-has-penalty filters.

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Would it be appropriate to install this script into the Evergreen bin directory during install? With the $osrf_config getting set to the correct value?
Josh

Changed in evergreen:
importance: Undecided → Wishlist
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Galen Charlton (gmc)
Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

I used the script recently for some post-COVID work and had an unexpected side effect.

Some standing penalties can be generated by the system (e.g. PATRON_EXCEEDS_COLLECTIONS_WARNING) based on a threshold, but can also be manually archived by staff even when the conditions that resulted in the penalty still exist.

If the patron interacts with the system in a way that causes penalties to be regenerated OR a batch script runs that updates everyone's penalties, the manually archived penalty can be re-applied for patrons that still meet the required conditions.

If the penalty in question causes, say, a billing notice to be sent, regenerating such penalties can cause a large pile of notices to be sent to patrons that have already received the same notice. Good times.

Removing pullrequest. Adding Needs discussion.

tags: added: needsdiscussion
removed: pullrequest
Changed in evergreen:
milestone: 3.10-beta → 3.next
Revision history for this message
Mike Rylander (mrylander) wrote :

I've embedded the script here in another branch over at bug 2006971 in order to add some additional functionality. If this version ends up going in first then that branch will need a trim, but if it goes first then we can mark this one as a duplicate.

In either case, thanks, Bill! I think this'll be very useful.

Revision history for this message
Katie Greenleaf Martin (kgmspark) wrote :

Speaking for PaILS, we're comfortable with combining this with the work on 2006971 (we tested it both on Butternut and previously on another Equinox server) -- we should add the fact that staff-archived penalties can be re-instated to the documentation; I don't think that the reverse (that a recalculation script would NOT apply penalties that had been manually archived if the conditions still existed) would be a desirable behavior.
(cross-posted on 1944986 and 2006971)

Revision history for this message
Bill Erickson (berick) wrote :

The patch for this branch was merged as part of bug #2006971.

Changed in evergreen:
milestone: 3.next → 3.11-beta
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.