X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_acct.cgi;h=599c1d8b9610d1e12b00bfe84341d3ed63dbe811;hb=4f4ba96481821fb7e9c25e7258737d4a0de7c26b;hp=e86d43f306d99e7dca7f36ebdde954334b2ddd91;hpb=62e07cc34e38055a59ce160e1c06fcc5edb26927;p=freeside.git diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index e86d43f30..599c1d8b9 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -78,6 +78,13 @@ if ( $part_svc->part_export('sqlradius') ) { 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 $hh $mm $ss"; } else { @@ -85,12 +92,17 @@ if ( $part_svc->part_export('sqlradius') ) { } if ( $cust_pkg ) { - print ' this billing cycle (since '. time2str("%C", $last_bill). ') - '. - $plandata{recur_included_hours}. ' total hours in plan

'; + print ' since last bill ('. time2str("%C", $last_bill). ') - '. + $plandata{recur_included_hours}. ' total hours in plan
'; } else { - print ' (no billing cycle available for unaudited account)

'; + print ' (no billing cycle available for unaudited account)
'; } + print 'Input: '. sprintf("%.3f", $input). ' megabytes
'; + print 'Output: '. sprintf("%.3f", $output). ' megabytes
'; + + print '
'; + } #print qq!
Send account information!; @@ -128,7 +140,9 @@ if ( $conf->exists('security_phrase') ) { $svc_acct->sec_phrase. ''; } -my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); +my $svc_acct_pop = $svc_acct->popnum + ? qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}) + : ''; print "Access number". "". $svc_acct_pop->text. '' if $svc_acct_pop; @@ -183,7 +197,7 @@ print 'RADIUS groups'. print '

'; -print join("\n", $conf->config('svc_acct-notes') ). '

'. +print join("\n", $conf->config('svc_acct-notes') ). '

'. joblisting({'svcnum'=>$svcnum}, 1). ''; %>