projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for correct radacct column names
[freeside.git]
/
httemplate
/
view
/
svc_acct.cgi
diff --git
a/httemplate/view/svc_acct.cgi
b/httemplate/view/svc_acct.cgi
index
3fb9156
..
30480d1
100755
(executable)
--- a/
httemplate/view/svc_acct.cgi
+++ b/
httemplate/view/svc_acct.cgi
@@
-60,15
+60,17
@@
function areyousure(href) {
if ( $part_svc->part_export('sqlradius') ) {
my $last_bill;
if ( $part_svc->part_export('sqlradius') ) {
my $last_bill;
+ my %plandata;
if ( $cust_pkg ) {
#false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
#belong in plan data
if ( $cust_pkg ) {
#false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
#belong in plan data
-
my
%plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
-
split("\n", $cust_pkg->part_pkg->plandata );
+ %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
+ split("\n", $cust_pkg->part_pkg->plandata );
$last_bill = $cust_pkg->last_bill;
} else {
$last_bill = 0;
$last_bill = $cust_pkg->last_bill;
} else {
$last_bill = 0;
+ %plandata = ();
}
my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time );
}
my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time );
@@
-76,6
+78,13
@@
if ( $part_svc->part_export('sqlradius') ) {
my $m = int( ($seconds%3600) / 60 );
my $s = $seconds%60;
my $m = int( ($seconds%3600) / 60 );
my $s = $seconds%60;
+ my $input = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'AcctInputOctets'
+ ) / 1048576;
+ my $output = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'AcctOutputOctets'
+ ) / 1048576;
+
if ( $seconds ) {
print "Online <B>$h</B>h <B>$m</B>m <B>$s</B>s";
} else {
if ( $seconds ) {
print "Online <B>$h</B>h <B>$m</B>m <B>$s</B>s";
} else {
@@
-83,12
+92,17
@@
if ( $part_svc->part_export('sqlradius') ) {
}
if ( $cust_pkg ) {
}
if ( $cust_pkg ) {
- print ' this billing cycle (since '. time2str(
%C
, $last_bill). ') - '.
- $plandata{recur_included_hours}. ' total hours in plan<BR>
<BR>
';
+ print ' this billing cycle (since '. time2str(
"%C"
, $last_bill). ') - '.
+ $plandata{recur_included_hours}. ' total hours in plan<BR>';
} else {
} else {
- print ' (no billing cycle available for unaudited account)<BR>
<BR>
';
+ print ' (no billing cycle available for unaudited account)<BR>';
}
}
+ print 'Input: <B>'. sprintf("%.3f", $input). ' megabytes<BR>';
+ print 'Output: <B>'. sprintf("%.3f", $output). ' megabytes<BR>';
+
+ print '<BR>';
+
}
#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
}
#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
@@
-181,7
+195,7
@@
print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
print '</TABLE></TD></TR></TABLE><BR><BR>';
print '</TABLE></TD></TR></TABLE><BR><BR>';
-print join("\n", $conf->config('svc_acct-notes') ).
'<BR><BR>'.
+print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'.
joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>';
%>
joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>';
%>