summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorivan <ivan>2009-03-30 04:15:56 +0000
committerivan <ivan>2009-03-30 04:15:56 +0000
commit613f320ae076de8612ff80fc99c516b544ff3897 (patch)
tree42b8a19bc25b01ecda0f85871f46c3e227dc1794 /httemplate/view
parentc13fb7ce1d8cba28ae0d56802b71856b0b7995ea (diff)
try not to search for nothing in cust_svc so much, RT#5083
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_main/packages.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 001e6ec82..d98de8e63 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -173,9 +173,17 @@ sub get_packages {
my $part_pkg_fields =
join(', ', map { "part_pkg.$_ AS part_pkg_$_" } fields('part_pkg') );
+ my $group_by =
+ join(', ', map "cust_pkg.$_", fields('cust_pkg') ). ', '.
+ join(', ', map "part_pkg.$_", fields('part_pkg') );
+
+ my $num_cust_svc =
+ '( SELECT COUNT(*) FROM cust_svc WHERE cust_pkg.pkgnum = cust_svc.svcnum )';
+
my @packages = $cust_main->$method( {
- 'select' => "$cust_pkg_fields, $part_pkg_fields",
- 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )'
+ 'select' => " $cust_pkg_fields, $part_pkg_fields, ".
+ " $num_cust_svc AS num_cust_svc ",
+ 'addl_from' => ' LEFT JOIN part_pkg USING ( pkgpart ) ',
} );
my $num_old_packages = scalar(@packages);