... and this last piece of sql too
[freeside.git] / FS / FS / TicketSystem / RT_External.pm
index a105c27..3bb1991 100644 (file)
@@ -50,9 +50,11 @@ sub num_customer_tickets {
   }
 
   my $sql = "
-    select count(*) from tickets 
+    select count(*) from tickets
+                    join links on ( tickets.id = links.localbase )
        where ( status = 'new' or status = 'open' or status = 'stalled' )
          and target = 'freeside://freeside/cust_main/$custnum'
+         $priority_sql
   ";
 
   my $sth = $dbh->prepare($sql) or die $dbh->errstr;