check on invoice re-printing newest percust... can't reproduce any problem, prints...
[freeside.git] / httemplate / search / cust_bill.html
index b7eac57..25a7ea0 100755 (executable)
@@ -124,8 +124,6 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
     $orderby = "ORDER BY cust_bill.$field";
   }
 
-  $search{'newest_percust'} = 1 if $cgi->param('newest_percust');
-
   if ( $cgi->param('newest_percust') ) {
     $search{'newest_percust'} = 1;
     $count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'";
@@ -161,7 +159,8 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
                      FS::cust_bill->owed_sql. ' AS owed',
                      FS::cust_bill->net_sql.  ' AS net',
                    ),
-    'extra_sql' => "$extra_sql $orderby"
+    'extra_sql' => $extra_sql,
+    'order_by'  => $orderby,
   };
 
 }
@@ -215,7 +214,6 @@ function confirm_fax_process() {
 </SCRIPT>';
 
 my $menubar =  [
-                'Main menu' => $p,
                 'Print these invoices' =>
                   "javascript:confirm_print_process()",
                 'Email these invoices' =>