diff options
author | ivan <ivan> | 2008-01-17 03:50:05 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-01-17 03:50:05 +0000 |
commit | b599898e39e2a882f959ccbd9e99061c69785c42 (patch) | |
tree | 565b724f88c86f545c3a77106cbc2aa48706aab1 | |
parent | 3f552adcfbc140b115bdfed4c24b7f47ad918c0e (diff) |
don't show 'Bill now' link unless the current user can...
-rw-r--r-- | httemplate/view/cust_main/billing.html | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 8562f9374..f1ceb52c2 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -1,23 +1,17 @@ -% -% my( $cust_main ) = @_; -% my @invoicing_list = $cust_main->invoicing_list; -% my $conf = new FS::Conf; -% my $money_char = $conf->config('money_char') || '$'; -% - - Billing information -% # If we can't see the unencrypted card, then bill now is an exercise in frustration -%if ( ! $cust_main->is_encrypted($cust_main->payinfo) ) { +%# If we can't see the unencrypted card, then bill now is an exercise in +%# frustration (without some sort of job queue magic to send it to a secure +%# machine, anyway) +%if ( $FS::CurrentUser::CurrentUser->access_right('Bill customer now') +% && ! $cust_main->is_encrypted($cust_main->payinfo) +% ) { (<A HREF="<% $p %>misc/bill.cgi?<% $cust_main->custnum %>">Bill now</A>) % } <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %> -% + %( my $balance = $cust_main->balance ) % =~ s/^(\-?)(.*)$/<FONT SIZE=+1>$1<\/FONT>$money_char$2/; -% - <TR> <TD ALIGN="right">Balance due</TD> @@ -205,3 +199,11 @@ my $paystate_label = FS::Msgcat::_gettext('paystate'); $paystate_label = 'Bank state' if $paystate_label =~/^paystate$/; </%once> +<%init> + +my( $cust_main ) = @_; +my @invoicing_list = $cust_main->invoicing_list; +my $conf = new FS::Conf; +my $money_char = $conf->config('money_char') || '$'; + +</%init> |