X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fprepay_credit.html;h=43fc6a96c1efbb944ee91686082cc29dc1c241bd;hp=c79acb005cbbd89f1d0a9bbab05299cd23767b61;hb=1748e50c012a65ecb729f15e09169f5d8122a3b1;hpb=6194551336a925ae5455cede68a7f73660b06bb6 diff --git a/httemplate/search/prepay_credit.html b/httemplate/search/prepay_credit.html index c79acb005..43fc6a96c 100644 --- a/httemplate/search/prepay_credit.html +++ b/httemplate/search/prepay_credit.html @@ -1,14 +1,3 @@ -% -%my $agent = ''; -%my $hashref = {}; -%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { -% $hashref->{agentnum} = $1; -% $agent = qsearchs('agent', { 'agentnum' => $1 } ); -%} -% -%my $count_query = 'SELECT COUNT(*) FROM prepay_credit'; -%$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent; -% <% include( 'elements/search.html', 'title' => 'Unused Prepaid Cards'. ($agent ? ' for '. $agent->agent : ''), @@ -31,17 +20,17 @@ }, sub { my $c = shift; $c->upbytes - ? FS::UI::Web::bytecount_unexact($c->upbytes) + ? FS::UI::bytecount::bytecount_unexact($c->upbytes) : '' }, sub { my $c = shift; $c->downbytes - ? FS::UI::Web::bytecount_unexact($c->downbytes) + ? FS::UI::bytecount::bytecount_unexact($c->downbytes) : '' }, sub { my $c = shift; $c->totalbytes - ? FS::UI::Web::bytecount_unexact($c->totalbytes) + ? FS::UI::bytecount::bytecount_unexact($c->totalbytes) : '' }, sub { my $agent = shift->agent; @@ -61,3 +50,19 @@ ], ) %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agent = ''; +my $hashref = {}; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { +$hashref->{agentnum} = $1; +$agent = qsearchs('agent', { 'agentnum' => $1 } ); +} + +my $count_query = 'SELECT COUNT(*) FROM prepay_credit'; +$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent; + +