From 6194551336a925ae5455cede68a7f73660b06bb6 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 7 Dec 2006 02:40:32 +0000 Subject: retouch bandwidth countdown --- httemplate/edit/prepay_credit.cgi | 12 ++++++++++++ httemplate/edit/process/prepay_credit.cgi | 2 ++ httemplate/misc/process/recharge_svc.html | 6 +++--- httemplate/search/prepay_credit.html | 20 ++++++++++++++++---- 4 files changed, 33 insertions(+), 7 deletions(-) (limited to 'httemplate') 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 @@ $ + total transfer +

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}) : '' %>
% } 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,22 +22,34 @@ }, '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 : ''; }, ], 'links' => [ + '', '', '', '', -- cgit v1.2.1