break _bytecount subroutines out of FS::UI::Web
[freeside.git] / FS / FS / ClientAPI / MyAccount.pm
index 675ae0b..ad73aaf 100644 (file)
@@ -9,6 +9,7 @@ use Business::CreditCard;
 use Time::Duration;
 use FS::CGI qw(small_custview); #doh
 use FS::UI::Web;
+use FS::UI::bytecount;
 use FS::Conf;
 use FS::Record qw(qsearch qsearchs);
 use FS::Msgcat qw(gettext);
@@ -402,11 +403,11 @@ sub process_prepay {
            'seconds'   => $seconds,
            'duration'  => duration_exact($seconds),
            'upbytes'   => $upbytes,
-           'upload'    => FS::UI::Web::bytecount_unexact($upbytes),
+           'upload'    => FS::UI::bytecount::bytecount_unexact($upbytes),
            'downbytes' => $downbytes,
-           'download'  => FS::UI::Web::bytecount_unexact($downbytes),
+           'download'  => FS::UI::bytecount::bytecount_unexact($downbytes),
            'totalbytes'=> $totalbytes,
-           'totalload' => FS::UI::Web::bytecount_unexact($totalbytes),
+           'totalload' => FS::UI::bytecount::bytecount_unexact($totalbytes),
          };
 
 }
@@ -610,7 +611,8 @@ sub list_svc_usage {
 
   my $freq   = $svc_acct->cust_svc->cust_pkg->part_pkg->freq;
   my $start  = $svc_acct->cust_svc->cust_pkg->setup;
-  my $end    = $svc_acct->cust_svc->cust_pkg->bill; # or time?
+  #my $end    = $svc_acct->cust_svc->cust_pkg->bill; # or time?
+  my $end    = time;
 
   unless($p->{beginning}){
     $p->{beginning} = $svc_acct->cust_svc->cust_pkg->last_bill;
@@ -711,7 +713,7 @@ sub order_pkg {
     $svcpart ||= $cust_pkg->part_pkg->svcpart($svcdb);
 
     my %fields = (
-      'svc_acct'     => [ qw( username _password sec_phrase popnum ) ],
+      'svc_acct'     => [ qw( username domsvc _password sec_phrase popnum ) ],
       'svc_domain'   => [ qw( domain ) ],
       'svc_external' => [ qw( id title ) ],
     );