<%
my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
die "Unknown domain" unless $svc_domain;
$domain = $svc_domain->domain;
} else {
- die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc;
+ unless ( $mydomain ) {
+ die "No legacy domain config file and no svc_domain.svcnum record ".
+ "for svc_acct.domsvc: ". $cust_svc->domsvc;
+ }
+ $domain = $mydomain;
}
%>
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 ( $cust_pkg ) {
- print ' this billing cycle (since '. time2str("%C", $last_bill). ') - '.
- $plandata{recur_included_hours}. ' total hours in plan<BR><BR>';
+ print ' since last bill ('. time2str("%C", $last_bill). ') - '.
+ $plandata{recur_included_hours}. ' total hours in plan<BR>';
} 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). '</B> megabytes<BR>';
+ print 'Output: <B>'. sprintf("%.3f", $output). '</B> megabytes<BR>';
+
+ print '<BR>';
+
}
#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
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>';
%>