summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorjeff <jeff>2006-12-07 02:40:32 +0000
committerjeff <jeff>2006-12-07 02:40:32 +0000
commit6194551336a925ae5455cede68a7f73660b06bb6 (patch)
tree54be12685fdfcc4b3da1ccfca8a42bff1a2b128c /httemplate
parent571d5e87ffc63a155072dab88fba16d5918cc57d (diff)
retouch bandwidth countdown
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/prepay_credit.cgi12
-rw-r--r--httemplate/edit/process/prepay_credit.cgi2
-rwxr-xr-xhttemplate/misc/process/recharge_svc.html6
-rw-r--r--httemplate/search/prepay_credit.html20
4 files changed, 33 insertions, 7 deletions
diff --git a/httemplate/edit/prepay_credit.cgi b/httemplate/edit/prepay_credit.cgi
index 7ce44c087..c22904d6c 100644
--- a/httemplate/edit/prepay_credit.cgi
+++ b/httemplate/edit/prepay_credit.cgi
@@ -21,6 +21,7 @@
%$cgi->param('multiplier', '60') unless $cgi->param('multiplier');
%$cgi->param('upmultiplier', '1000000') unless $cgi->param('upmultiplier');
%$cgi->param('downmultiplier', '1000000') unless $cgi->param('downmultiplier');
+%$cgi->param('totalmultiplier','1000000') unless $cgi->param('totalmultiplier');
%
%
@@ -91,6 +92,17 @@ $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amou
</SELECT> download
</TD></TR>
+<TR><TD></TD>
+<TD>and/or
+<INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') %>">
+<SELECT NAME="totalmultiplier">
+% foreach my $multiplier ( keys %bytemultiplier ) {
+
+ <OPTION VALUE="<% $multiplier %>"<% $cgi->param('totalmultiplier') eq $multiplier ? ' SELECTED' : '' %>><% $bytemultiplier{$multiplier} %>
+% }
+
+</SELECT> total transfer
+</TD></TR>
</TABLE>
<BR><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Generate" onSubmit="this.disabled = true">
diff --git a/httemplate/edit/process/prepay_credit.cgi b/httemplate/edit/process/prepay_credit.cgi
index ba4296900..6bf46bf7c 100644
--- a/httemplate/edit/process/prepay_credit.cgi
+++ b/httemplate/edit/process/prepay_credit.cgi
@@ -19,6 +19,7 @@
%$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier');
%$hashref->{upbytes} = $cgi->param('upbytes') * $cgi->param('upmultiplier');
%$hashref->{downbytes} = $cgi->param('downbytes') * $cgi->param('downmultiplier');
+%$hashref->{totalbytes} = $cgi->param('totalbytes') * $cgi->param('totalmultiplier');
%
%$error ||= FS::prepay_credit::generate( $num,
% scalar($cgi->param('type')),
@@ -50,6 +51,7 @@
<% $hashref->{seconds} ? duration_exact($hashref->{seconds}) : '' %>
<% $hashref->{upbytes} ? FS::UI::Web::bytecount_unexact($hashref->{upbytes}) : '' %>
<% $hashref->{downbytes} ? FS::UI::Web::bytecount_unexact($hashref->{downbytes}) : '' %>
+ <% $hashref->{totalbytes} ? FS::UI::Web::bytecount_unexact($hashref->{totalbytes}) : '' %>
<br>
% }
diff --git a/httemplate/misc/process/recharge_svc.html b/httemplate/misc/process/recharge_svc.html
index ae526689e..d9fa2070e 100755
--- a/httemplate/misc/process/recharge_svc.html
+++ b/httemplate/misc/process/recharge_svc.html
@@ -23,12 +23,12 @@
%
%unless ($error) {
%
-%my ($amount, $seconds, $up, $down) = (0, 0, 0, 0);
-%$error = $cust_main->get_prepay($prepaid, \$amount, \$seconds, \$up, \$down)
+%my ($amount, $seconds, $up, $down, $total) = (0, 0, 0, 0, 0);
+%$error = $cust_main->get_prepay($prepaid, \$amount, \$seconds, \$up, \$down, \$total)
% || $svc_acct->increment_seconds($seconds)
% || $svc_acct->increment_upbytes($up)
% || $svc_acct->increment_downbytes($down)
-% || $svc_acct->increment_totalbytes($up + $down)
+% || $svc_acct->increment_totalbytes($total)
% || $cust_main->insert_cust_pay_prepay( $amount, $prepaid );
%}
%
diff --git a/httemplate/search/prepay_credit.html b/httemplate/search/prepay_credit.html
index fecb12f2a..c79acb005 100644
--- a/httemplate/search/prepay_credit.html
+++ b/httemplate/search/prepay_credit.html
@@ -22,16 +22,27 @@
},
'count_query' => $count_query,
#'redirect' => $link,
- 'header' => [ '#', qw(Amount Time Upload Download Agent) ],
+ 'header' => [ '#', qw(Amount Time Upload Download Total Agent) ],
'fields' => [
'identifier',
sub { sprintf('$%.2f', shift->amount ) },
- sub { my $c = shift; $c ? duration_exact($c->seconds) : '' },
sub { my $c = shift;
- $c ? FS::UI::Web::bytecount_unexact($c->upbytes) : ''
+ $c->seconds ? duration_exact($c->seconds) : ''
},
sub { my $c = shift;
- $c ? FS::UI::Web::bytecount_unexact($c->downbytes) : ''
+ $c->upbytes
+ ? FS::UI::Web::bytecount_unexact($c->upbytes)
+ : ''
+ },
+ sub { my $c = shift;
+ $c->downbytes
+ ? FS::UI::Web::bytecount_unexact($c->downbytes)
+ : ''
+ },
+ sub { my $c = shift;
+ $c->totalbytes
+ ? FS::UI::Web::bytecount_unexact($c->totalbytes)
+ : ''
},
sub { my $agent = shift->agent;
$agent ? $agent->agent : '';
@@ -43,6 +54,7 @@
'',
'',
'',
+ '',
sub { my $agent = shift->agent;
$agent ? [ "${p}view/agent.cgi?", 'agentnum' ] : '';
},