$hashref->{pkg}
- $hashref->{comment} |
-END
- if ( $cgi->param('active') ) {
- print " ";
- print ''.
- $num_active_cust_pkg{$hashref->{'pkgpart'}}.
- qq! active !;
-
- $suspended_sth->execute( $part_pkg->pkgpart ) or die $suspended_sth->errstr;
- my $num_suspended = $suspended_sth->fetchrow_arrayref->[0];
- print ''. $num_suspended.
- qq! suspended !;
-
- $canceled_sth->execute( $part_pkg->pkgpart ) or die $canceled_sth->errstr;
- my $num_canceled = $canceled_sth->fetchrow_arrayref->[0];
- print ''. $num_canceled.
- qq! canceled!;
-
-
- print ' | ';
- }
- print <$hashref->{freq}
- $hashref->{plan} |
- $plandata |
-END
-
- my($pkg_svc);
- my($n)="";
- foreach $pkg_svc ( @pkg_svc ) {
- my($svcpart)=$pkg_svc->getfield('svcpart');
- my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart });
- print $n,qq!!,
- $part_svc->getfield('svc')," | ",
- $pkg_svc->getfield('quantity')," | \n";
- $n="";
- }
-
- print "
";
-}
+ *,
+
+ ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart
+ AND ( cancel IS NULL OR cancel = 0 )
+ AND ( susp IS NULL OR susp = 0 )
+ ) AS num_active,
+
+ ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart
+ AND ( cancel IS NULL OR cancel = 0 )
+ AND susp IS NOT NULL AND susp != 0
+ ) AS num_suspended,
+
+ ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart
+ AND cancel IS NOT NULL AND cancel != 0
+ ) AS num_cancelled
-$colspan = $cgi->param('showdisabled') ? 8 : 9;
-print <
-