diff options
author | ivan <ivan> | 2009-03-30 04:15:56 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-03-30 04:15:56 +0000 |
commit | 613f320ae076de8612ff80fc99c516b544ff3897 (patch) | |
tree | 42b8a19bc25b01ecda0f85871f46c3e227dc1794 /httemplate/view | |
parent | c13fb7ce1d8cba28ae0d56802b71856b0b7995ea (diff) |
try not to search for nothing in cust_svc so much, RT#5083
Diffstat (limited to 'httemplate/view')
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 12 |
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); |