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);
return { 'error' => gettext('unknown_card_type') }
if cardtype($payinfo) eq "Unknown";
- if ( defined $cust_main->dbdef_table->column('paycvv') ) {
- if ( length($p->{'paycvv'} ) ) {
- if ( cardtype($payinfo) eq 'American Express card' ) {
- $p->{'paycvv'} =~ /^(\d{4})$/
- or return { 'error' => "CVV2 (CID) for American Express cards is four digits." };
- $paycvv = $1;
- } else {
- $p->{'paycvv'} =~ /^(\d{3})$/
- or return { 'error' => "CVV2 (CVC2/CID) is three digits." };
- $paycvv = $1;
- }
+ if ( length($p->{'paycvv'}) && $p->{'paycvv'} !~ /^\s*$/ ) {
+ if ( cardtype($payinfo) eq 'American Express card' ) {
+ $p->{'paycvv'} =~ /^\s*(\d{4})\s*$/
+ or return { 'error' => "CVV2 (CID) for American Express cards is four digits." };
+ $paycvv = $1;
+ } else {
+ $p->{'paycvv'} =~ /^\s*(\d{3})\s*$/
+ or return { 'error' => "CVV2 (CVC2/CID) is three digits." };
+ $paycvv = $1;
}
}
'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),
};
}
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;
$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 ) ],
);