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)
committerBill Erickson <berick@esilibrary.com>
Mon, 15 Oct 2012 16:31:00 +0000 (12:31 -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 f1d6e36..8d61327 100644 (file)
@@ -221,6 +221,12 @@ sub users_of_interest_warning_penalty {
                         aus => {
                             type => 'left',
                             filter => {name => 'circ.collections.exempt'}
+                        },
+                        mct => {
+                            type => 'left',
+                            filter => {
+                                location => [ map {$_->{id}} @$org_ids ]
+                            }
                         }
                     }
                 }
@@ -237,7 +243,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}
         }
     };