communigate pro provisioning, RT#7083
[freeside.git] / httemplate / view / svc_acct / usage.html
diff --git a/httemplate/view/svc_acct/usage.html b/httemplate/view/svc_acct/usage.html
new file mode 100644 (file)
index 0000000..9758d83
--- /dev/null
@@ -0,0 +1,27 @@
+% my %ulabel = ( seconds    => 'Time',
+%                upbytes    => 'Upload bytes',
+%                downbytes  => 'Download bytes',
+%                totalbytes => 'Total bytes',
+%              );
+% foreach my $uf ( keys %ulabel ) {
+%   my $tf = $uf . "_threshold";
+%   if ( $svc_acct->$uf ne '' ) {
+%     my $v = $uf eq 'seconds'
+%       #? (($svc_acct->$uf < 0 ? '-' : ''). duration_exact($svc_acct->$uf) )
+%       ? ($svc_acct->$uf < 0 ? '-' : '').
+%         int(abs($svc_acct->$uf)/3600). "hr ".
+%         sprintf("%02d",(abs($svc_acct->$uf)%3600)/60). "min"
+%       : FS::UI::bytecount::display_bytecount($svc_acct->$uf);
+    <TR>
+      <TD ALIGN="right"><% $ulabel{$uf} %> remaining</TD>
+      <TD BGCOLOR="#ffffff"><% $v %></TD>
+    </TR>
+
+%   }
+% }
+<%init>
+
+my %opt = @_;
+my $svc_acct = $opt{'svc_acct'};
+
+</%init>