[freeside-commits] freeside/httemplate/view/cust_main packages.html, 1.60, 1.61

Ivan,,, ivan at wavetail.420.am
Sun Mar 29 23:10:20 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail.420.am:/tmp/cvs-serv21892/httemplate/view/cust_main

Modified Files:
	packages.html 
Log Message:
okay.  counts are needed for the package sort, so push the embedded counting into cust_main.pm.  sure hope this does it. RT#5083

Index: packages.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/packages.html,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- packages.html	30 Mar 2009 04:41:33 -0000	1.60
+++ packages.html	30 Mar 2009 06:10:18 -0000	1.61
@@ -177,13 +177,9 @@
     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.pkgnum )';
-
   my @packages = $cust_main->$method( {
-    'select'    => " $cust_pkg_fields, $part_pkg_fields, ".
-                   " $num_cust_svc AS num_cust_svc ",
-    'addl_from' => ' LEFT JOIN part_pkg USING ( pkgpart ) ',
+    'select'    => "$cust_pkg_fields, $part_pkg_fields",
+    'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )',
   } );
   my $num_old_packages = scalar(@packages);
 
@@ -192,7 +188,6 @@
     my %part_pkg = map  { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); }
                    grep { /^part_pkg_/ } keys %hash;
     $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg;
-    $cust_pkg->{'_num_cust_svc'} = $cust_pkg->get('num_cust_svc');
   }
 
   unless ( $cgi->param('showoldpackages') ) {



More information about the freeside-commits mailing list