don't show invoice resend and payment posting links if you can't do that anyway
[freeside.git] / httemplate / search / cust_bill.html
index 9166f6d..2860f7a 100755 (executable)
@@ -159,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,
   };
 
 }
@@ -212,15 +213,18 @@ function confirm_fax_process() {
 
 </SCRIPT>';
 
-my $menubar =  [
-                'Print these invoices' =>
-                  "javascript:confirm_print_process()",
-                'Email these invoices' =>
-                  "javascript:confirm_email_process()",
-              ];
+my $menubar = [];
 
-push @$menubar, 'Fax these invoices' =>
-                 "javascript:confirm_fax_process()"
- if $conf->exists('hylafax');
+if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) {
+
+  push @$menubar, 'Print these invoices' =>
+                    "javascript:confirm_print_process()",
+                  'Email these invoices' =>
+                    "javascript:confirm_email_process()";
+
+  push @$menubar, 'Fax these invoices' =>
+                    "javascript:confirm_fax_process()"
+    if $conf->exists('hylafax');
+}
 
 </%init>