removing location from collections stuff
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 6 Jul 2006 14:20:23 +0000 (14:20 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 6 Jul 2006 14:20:23 +0000 (14:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4905 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm

index e94ee9e..fc62b0d 100644 (file)
@@ -19,7 +19,6 @@ sub new_collections {
 
        my $SQL = <<"   SQL";
                SELECT  lt.usr,
-                       lt.location,
                        MAX(bl.billing_ts) AS last_pertinent_billing,
                        SUM(bl.amount) - SUM(COALESCE(pm.amount,0)) AS threshold_amount
                  FROM  ( SELECT id,usr,billing_location AS location FROM money.grocery
@@ -31,7 +30,7 @@ sub new_collections {
                        LEFT JOIN money.collections_tracker cl USING (usr,location)
                  WHERE AGE(bl.billing_ts) > ?
                        AND cl.usr IS NULL
-                 GROUP BY 1, 2 HAVING (SUM(bl.amount) - SUM(COALESCE(pm.amount,0))) > ? 
+                 GROUP BY lt.usr HAVING (SUM(bl.amount) - SUM(COALESCE(pm.amount,0))) > ? 
        SQL
 
        my @l_ids;