X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_acct.cgi;h=e28e00e6127fab71e3598ca10748d5afb6ce8e4f;hb=ee1a01a4d001bf993b9cce54e59f119db20e49f0;hp=daf025a38de8a6ece81e520b5e64eb1a29b1916d;hpb=f38abb144955686f880a528ed6fe4c9c5453517b;p=freeside.git diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi index daf025a38..e28e00e61 100755 --- a/httemplate/search/svc_acct.cgi +++ b/httemplate/search/svc_acct.cgi @@ -21,13 +21,14 @@ $query ||= ''; #to avoid use of unitialized value errors my $unlinked = ''; if ( $query =~ /^UN_(.*)$/ ) { $query = $1; - $unlinked = ' + my $empty = driver_name =~ /^Pg$/i ? qq('') : qq(""); + $unlinked = " WHERE 0 < ( SELECT count(*) FROM cust_svc WHERE cust_svc.svcnum = svc_acct.svcnum - AND pkgnum IS NULL + AND ( pkgnum IS NULL OR pkgnum = 0 OR pkgnum = $empty ) ) - '; + "; } my(@svc_acct, $sortby);