use Carp;
use Time::Local;
use Date::Format;
-use Date::Manip;
+#use Date::Manip;
use Mail::Internet;
use Mail::Header;
use Business::CreditCard;
|| $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;
} );
}
- $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);
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
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;
}
}
- warn "setup is undefinded" unless defined($setup);
- warn "recur is undefinded" unless defined($recur);
- warn "cust_pkg bill is undefinded" unless defined($cust_pkg->bill);
+ warn "setup is undefined" unless defined($setup);
+ warn "recur is undefined" unless defined($recur);
+ warn "cust_pkg bill is undefined" unless defined($cust_pkg->bill);
if ( $cust_pkg_mod_flag ) {
$error=$cust_pkg->replace($old_cust_pkg);
} elsif ( $processor eq 'cybercash3.2' ) {
%result = &CCMckDirectLib3_2::SendCC2_1Server(@full_xaction);
} else {
- return "Unkonwn real-time processor $processor\n";
+ return "Unknown real-time processor $processor\n";
}
#if ( $result{'MActionCode'} == 7 ) { #cybercash smps v.1.1.3
}
} else {
- return "Unkonwn real-time processor $processor\n";
+ return "Unknown real-time processor $processor\n";
}
} else { #batch card
=head1 VERSION
-$Id: cust_main.pm,v 1.4 2000-02-02 20:22:18 ivan Exp $
+$Id: cust_main.pm,v 1.9 2001-01-31 07:21:00 ivan Exp $
=head1 BUGS