use Mail::Header;
use Business::CreditCard;
use FS::UID qw( getotaker dbh );
-use FS::Record qw( qsearchs qsearch );
+use FS::Record qw( qsearchs qsearch dbdef );
use FS::cust_pkg;
use FS::cust_bill;
use FS::cust_bill_pkg;
|| $self->ut_text('city')
|| $self->ut_textn('county')
|| $self->ut_textn('state')
+ || $self->ut_country('country')
|| $self->ut_anything('comments')
;
#barf. need message catalogs. i18n. etc.
$self->ss("$1-$2-$3");
}
- $self->country =~ /^(\w\w)$/ or return "Illegal country: ". $self->country;
- $self->country($1);
unless ( qsearchs('cust_main_county', {
'country' => $self->country,
'state' => '',
|| $self->ut_text('ship_city')
|| $self->ut_textn('ship_county')
|| $self->ut_textn('ship_state')
+ || $self->ut_country('ship_country')
;
return $error if $error;
#false laziness with above
- $self->ship_country =~ /^(\w\w)$/
- or return "Illegal ship_country: ". $self->ship_country;
- $self->ship_country($1);
unless ( qsearchs('cust_main_county', {
'country' => $self->ship_country,
'state' => '',
or return "Illegal expiration date: ". $self->paydate;
if ( length($2) == 4 ) {
$self->paydate("$2-$1-01");
- } elsif ( $2 > 97 ) { #should pry change to check for "this year"
- $self->paydate("19$2-$1-01");
} else {
$self->paydate("20$2-$1-01");
}
=back
+=head1 SUBROUTINES
+
+=over 4
+
+=item rebuild_fuzzyfile
+
+=cut
+
+sub rebuild_fuzzyfiles {
+ my @all_last = map $_->getfield('last'), qsearch('cust_main', {});
+ push @all_last,
+ grep $_, map $_->getfield('ship_last'), qsearch('cust_main',{})
+ if defined dbdef->table('cust_main')->column('ship_last');
+# open(
+
+}
+
+=back
+
=head1 VERSION
-$Id: cust_main.pm,v 1.18 2001-08-17 10:55:04 ivan Exp $
+$Id: cust_main.pm,v 1.20 2001-08-23 06:17:03 ivan Exp $
=head1 BUGS