X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_receivables.cgi;h=ad353a1b3b80e492182d3c77a1f6de318d1acdb1;hp=108453d4373da8dfb0ba90be3cd1b07c1558f9f5;hb=bd4d69496e5e122cf65e246e9be95d1d8555e9f3;hpb=8ded47043e6d1f002a57c392fa95f481e697ab45 diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index 108453d43..ad353a1b3 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -70,14 +70,14 @@ END ( select count(*) from cust_pkg where cust_main.custnum = cust_pkg.custnum and $recurring - and cancel = 0 or cancel is null + and ( cancel = 0 or cancel is null ) ) as uncancelled_pkgs, ( select count(*) from cust_pkg where cust_main.custnum = cust_pkg.custnum and $recurring - and cancel = 0 or cancel is null - and susp = 0 or susp is null + and ( cancel = 0 or cancel is null ) + and ( susp = 0 or susp is null ) ) as active_pkgs END @@ -123,14 +123,14 @@ END if ( $row->{uncancelled_pkgs} ) { $status = 'Suspended'; $statuscol = 'FF9900'; - if ( $row->{active_pkgs} > $row->{uncancelled_pkgs} ) { + if ( $row->{active_pkgs} ) { $status = 'Active'; $statuscol = '00CC00'; } } %> - + <%= $row->{'custnum'} %>: <%= $row->{'company'} ? $row->{'company'}. ' (' : '' %><%= $row->{'last'}. ', '. $row->{'first'} %><%= $row->{'company'} ? ')' : '' %> <%= $status %>