X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=b863748a0abefc36f15d24c28ee455c00090cedc;hb=f01fe96a27912381d4b30ccad3d355d74f76f505;hp=59ec41b81ad8217a655b26d62447d97da4b85d49;hpb=959663cd4d4885295f44de43ac005e55d054102f;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 59ec41b81..b863748a0 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -11,7 +11,7 @@ use Safe; use Carp; use Time::Local; use Date::Format; -use Date::Manip; +#use Date::Manip; use Mail::Internet; use Mail::Header; use Business::CreditCard; @@ -312,9 +312,6 @@ sub check { || $self->ut_text('city') || $self->ut_textn('county') || $self->ut_textn('state') - || $self->ut_phonen('daytime') - || $self->ut_phonen('night') - || $self->ut_phonen('fax') ; return $error if $error; @@ -357,7 +354,14 @@ sub check { } ); } - $self->zip =~ /^\s*(\w[\w\-\s]{3,8}\w)\s*$/ + $error = + $self->ut_phonen('daytime', $self->country) + || $self->ut_phonen('night', $self->country) + || $self->ut_phonen('fax', $self->country) + ; + return $error if $error; + + $self->zip =~ /^\s*(\w[\w\-\s]{2,8}\w)\s*$/ or return "Illegal zip: ". $self->zip; $self->zip($1); @@ -399,7 +403,7 @@ sub check { } - if ( $self->paydate eq '' ) { + if ( $self->paydate eq '' || $self->paydate eq '-' ) { return "Expriation date required" unless $self->payby eq 'BILL' || $self->payby eq 'PREPAY'; $self->paydate(''); @@ -450,15 +454,16 @@ Returns all non-cancelled packages (see L) for this customer. sub ncancelled_pkgs { my $self = shift; - qsearch( 'cust_pkg', { - 'custnum' => $self->custnum, - 'cancel' => '', - }), - qsearch( 'cust_pkg', { - 'custnum' => $self->custnum, - 'cancel' => 0, - }), - ; + @{ [ # force list context + qsearch( 'cust_pkg', { + 'custnum' => $self->custnum, + 'cancel' => '', + }), + qsearch( 'cust_pkg', { + 'custnum' => $self->custnum, + 'cancel' => 0, + }), + ] }; } =item bill OPTIONS @@ -545,7 +550,8 @@ sub bill { warn "Error reval-ing part_pkg->recur pkgpart ", $part_pkg->pkgpart, ": $@"; } else { - #change this bit to use Date::Manip? + #change this bit to use Date::Manip? CAREFUL with timezones (see + # mailing list archive) #$sdate=$cust_pkg->bill || time; #$sdate=$cust_pkg->bill || $time; $sdate = $cust_pkg->bill || $cust_pkg->setup || $time; @@ -993,7 +999,7 @@ sub check_invoicing_list { =head1 VERSION -$Id: cust_main.pm,v 1.3 2000-01-31 05:22:23 ivan Exp $ +$Id: cust_main.pm,v 1.7 2000-06-27 12:15:37 ivan Exp $ =head1 BUGS