From: Bill Erickson Date: Tue, 18 Oct 2011 20:22:25 +0000 (-0400) Subject: Further support for "circ.collections.exempt" setting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Fcollections_exempt_alt_retrieval_method;p=working%2FEvergreen.git Further support for "circ.collections.exempt" setting Added support for skipping users that have the "circ.collections.exempt" setting in the API call: open-ils.collections.users_of_interest.warning_penalty.retrieve This call is an alternate entry point for finding users to consider for collections processing Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm index 03b6b681fc..e5da73cbc1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm @@ -209,14 +209,30 @@ sub users_of_interest_warning_penalty { my $start = time; my $query = { select => {ausp => ['usr']}, - from => 'ausp', + from => { + ausp => { + au => { + join => { + aus => { + type => 'left', + filter => {name => 'circ.collections.exempt'} + } + } + } + } + }, where => { - standing_penalty => 4, # PATRON_EXCEEDS_COLLECTIONS_WARNING - org_unit => [ map {$_->{id}} @$org_ids ], - '-or' => [ - {stop_date => undef}, - {stop_date => {'>' => 'now'}} - ] + '+ausp' => { + standing_penalty => 4, # PATRON_EXCEEDS_COLLECTIONS_WARNING + org_unit => [ map {$_->{id}} @$org_ids ], + '-or' => [ + {stop_date => undef}, + {stop_date => {'>' => 'now'}} + ] + }, + # We are only interested in users that do not have the + # circ.collections.exempt setting applied + '+aus' => {value => undef} } };