X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_acct.cgi;h=8657f16abeff23e28c34c4d08baa89d01bde2db6;hb=bc122901e14ee5b836ff75afc21a99fb9bbc4d54;hp=7f7c25c66baf7cffdac7d6efbe4374c9a11c97d2;hpb=9ba2416211d9eba2914f524d07987b96d21f354b;p=freeside.git diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index 7f7c25c66..8657f16ab 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -50,8 +50,7 @@ function areyousure(href) { <%= header('Account View', menubar( ( ( $pkgnum || $custnum ) - ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum", - "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", ) : ( "Cancel this (unaudited) account" => "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" ) @@ -62,7 +61,9 @@ function areyousure(href) { <% #if ( $cust_pkg && $cust_pkg->part_pkg->plan eq 'sqlradacct_hour' ) { -if ( $part_svc->part_export('sqlradius') ) { +if ( $part_svc->part_export('sqlradius') + || $part_svc->part_export('sqlradius_withdomain') +) { my $last_bill; my %plandata; @@ -79,32 +80,32 @@ if ( $part_svc->part_export('sqlradius') ) { } my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time ); - my $h = int($seconds/3600); - my $m = int( ($seconds%3600) / 60 ); - my $s = $seconds%60; + my $hour = int($seconds/3600); + my $min = int( ($seconds%3600) / 60 ); + my $sec = $seconds%60; my $input = $svc_acct->attribute_since_sqlradacct( - $last_bill, time, 'Acct-Input-Octets' + $last_bill, time, 'AcctInputOctets' ) / 1048576; my $output = $svc_acct->attribute_since_sqlradacct( - $last_bill, time, 'Acct-Output-Octets' + $last_bill, time, 'AcctOutputOctets' ) / 1048576; if ( $seconds ) { - print "Online $hh $mm $ss"; + print "Online $hourh $minm $secs"; } else { print 'Has not logged on'; } if ( $cust_pkg ) { - print ' this billing cycle (since '. time2str("%C", $last_bill). ') - '. + 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 'Input: '. sprintf("%.3f", $input). ' megabytes
'; - print 'Output: '. sprintf("%.3f", $output). ' megabytes
'; + print 'Input: '. sprintf("%.3f", $input). ' megabytes
'; + print 'Output: '. sprintf("%.3f", $output). ' megabytes
'; print '
'; @@ -145,7 +146,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;