From ceeea809f0f5fedd694b8d18fc03dd1bcc1a174f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 18 Oct 2011 16:22:25 -0400 Subject: [PATCH] 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 Signed-off-by: Mike Rylander --- .../lib/OpenILS/Application/Collections.pm | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) 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} } }; -- 2.11.0