Added a check for the money.collections_tracker table when using the open-ils.collect...
authorSteven Callender <stevecallender@esilibrary.com>
Mon, 15 Oct 2012 14:48:28 +0000 (10:48 -0400)
committerJeff Godin <jgodin@tadl.org>
Mon, 3 Jun 2013 20:40:14 +0000 (16:40 -0400)
Users that are already entered into the money.collections_tracker table should not be recalled from the open-ils.collections.users_of_interest.warning_penalty.retrieve API. This change will check for the existance of the user in the money.colletions_tracker table.

Signed-off-by: Steven Callender <stevecallender@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Collections.pm

index 69fc472..44981db 100644 (file)
@@ -224,6 +224,12 @@ sub users_of_interest_warning_penalty {
                         aus => {
                             type => 'left',
                             filter => {name => 'circ.collections.exempt'}
+                        },
+                        mct => {
+                            type => 'left',
+                            filter => {
+                                location => [ map {$_->{id}} @$org_ids ]
+                            }
                         }
                     }
                 }
@@ -240,7 +246,10 @@ sub users_of_interest_warning_penalty {
             },
             # We are only interested in users that do not have the 
             # circ.collections.exempt setting applied
-            '+aus' => {value => undef}
+            '+aus' => {value => undef},
+            # and we're only interested in users that are not in the
+            # collections tracker table
+            '+mct' => {id => undef}
         }
     };