summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2008-03-30 02:42:53 +0000
committerivan <ivan>2008-03-30 02:42:53 +0000
commitcf9ea3b22181348e70df1faf826bb783e296301f (patch)
tree8e4bc2328e946aee43dc6f759dfd977f6997aeb4 /httemplate
parent586d70385900909f16e10438a5ca55231da0da19 (diff)
don't show invoice resend and payment posting links if you can't do that anyway
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/search/cust_bill.html23
-rwxr-xr-xhttemplate/view/cust_bill.cgi68
2 files changed, 47 insertions, 44 deletions
diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html
index 25a7ea051..2860f7a4d 100755
--- a/httemplate/search/cust_bill.html
+++ b/httemplate/search/cust_bill.html
@@ -213,15 +213,18 @@ function confirm_fax_process() {
</SCRIPT>';
-my $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');
+my $menubar = [];
+
+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>
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 951725531..db30d3ecc 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -4,56 +4,56 @@
% if ( $cust_bill->owed > 0
-% && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} )
-% )
-% {
+% && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) )
+% && $FS::CurrentUser::CurrentUser->access_right('Post payment')
+% )
+% {
% my $s = 0;
- Post
-% if ( $payby{'BILL'} ) {
+ Post
-
- <% $s++ ? ' | ' : '' %>
- <A HREF="<% $p %>edit/cust_pay.cgi?payby=BILL;invnum=<% $invnum %>">check</A>
-% }
-% if ( $payby{'CASH'} ) {
+% if ( $payby{'BILL'} ) {
+ <% $s++ ? ' | ' : '' %>
+ <A HREF="<% $p %>edit/cust_pay.cgi?payby=BILL;invnum=<% $invnum %>">check</A>
+% }
-
- <% $s++ ? ' | ' : '' %>
- <A HREF="<% $p %>edit/cust_pay.cgi?payby=CASH;invnum=<% $invnum %>">cash</A>
-% }
-% if ( $payby{'WEST'} ) {
+% if ( $payby{'CASH'} ) {
+ <% $s++ ? ' | ' : '' %>
+ <A HREF="<% $p %>edit/cust_pay.cgi?payby=CASH;invnum=<% $invnum %>">cash</A>
+% }
-
- <% $s++ ? ' | ' : '' %>
- <A HREF="<% $p %>edit/cust_pay.cgi?payby=WEST;invnum=<% $invnum %>">Western Union</A>
-% }
-% if ( $payby{'MCRD'} ) {
+% if ( $payby{'WEST'} ) {
+ <% $s++ ? ' | ' : '' %>
+ <A HREF="<% $p %>edit/cust_pay.cgi?payby=WEST;invnum=<% $invnum %>">Western Union</A>
+% }
-
- <% $s++ ? ' | ' : '' %>
- <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<% $invnum %>">manual credit card</A>
-% }
+% if ( $payby{'MCRD'} ) {
+ <% $s++ ? ' | ' : '' %>
+ <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;invnum=<% $invnum %>">manual credit card</A>
+% }
+ payment against this invoice<BR><BR>
- payment against this invoice<BR>
% }
-<A HREF="<% $p %>misc/print-invoice.cgi?<% $link %>">Re-print this invoice</A>
-% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
+% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) {
- | <A HREF="<% $p %>misc/email-invoice.cgi?<% $link %>">Re-email
- this invoice</A>
-% }
-% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
+ <A HREF="<% $p %>misc/print-invoice.cgi?<% $link %>">Re-print this invoice</A>
+
+% if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) {
+ | <A HREF="<% $p %>misc/email-invoice.cgi?<% $link %>">Re-email this invoice</A>
+% }
+
+% if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) {
+ | <A HREF="<% $p %>misc/fax-invoice.cgi?<% $link %>">Re-fax this invoice</A>
+% }
+
+ <BR><BR>
- | <A HREF="<% $p %>misc/fax-invoice.cgi?<% $link %>">Re-fax
- this invoice</A>
% }
-<BR><BR>
% if ( $conf->exists('invoice_latex') ) {
<A HREF="<% $p %>view/cust_bill-pdf.cgi?<% $link %>.pdf">View typeset invoice</A>