[freeside-commits] freeside/httemplate/view/cust_main packages.html, 1.61, 1.62
Ivan,,,
ivan at wavetail.420.am
Tue Apr 14 13:27:53 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail.420.am:/tmp/cvs-serv29696
Modified Files:
packages.html
Log Message:
don't hide old packages that have services, RT#5179
Index: packages.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages.html,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- packages.html 30 Mar 2009 06:10:18 -0000 1.61
+++ packages.html 14 Apr 2009 20:27:50 -0000 1.62
@@ -177,8 +177,11 @@
join(', ', map "cust_pkg.$_", fields('cust_pkg') ). ', '.
join(', ', map "part_pkg.$_", fields('part_pkg') );
+ my $num_svcs = '( SELECT COUNT(*) FROM cust_svc '.
+ ' WHERE cust_svc.pkgnum = cust_pkg.pkgnum ) AS num_svcs';
+
my @packages = $cust_main->$method( {
- 'select' => "$cust_pkg_fields, $part_pkg_fields",
+ 'select' => "$cust_pkg_fields, $part_pkg_fields, $num_svcs",
'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )',
} );
my $num_old_packages = scalar(@packages);
@@ -200,7 +203,9 @@
);
@packages =
- grep { !exists($hide{$_->status}) or $_->get($hide{$_->status}) > $then }
+ grep { !exists($hide{$_->status}) or $_->get($hide{$_->status}) > $then
+ or $_->num_svcs #don't hide packages w/services
+ }
@packages;
}
More information about the freeside-commits
mailing list