X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fcust_main.pm;h=57e76ba423f4cdbd02faf21c61abaa2dd3447172;hb=89393334e46b9608bf3a1ab9e205a83260bc96cf;hp=83a7d786dcd2da038c85af848acb7f344e3d29c6;hpb=0bf5ad9ff0a65195db88ed0bac3aa11c33ec1ad3;p=freeside.git diff --git a/site_perl/cust_main.pm b/site_perl/cust_main.pm index 83a7d786d..57e76ba42 100644 --- a/site_perl/cust_main.pm +++ b/site_perl/cust_main.pm @@ -19,7 +19,11 @@ use FS::cust_pkg; use FS::cust_bill; use FS::cust_bill_pkg; use FS::cust_pay; -#use FS::cust_pay_batch; +use FS::cust_credit; +use FS::cust_pay_batch; +use FS::part_referral; +use FS::cust_main_county; +use FS::agent; @ISA = qw(FS::Record Exporter); @EXPORT_OK = qw(hfields); @@ -279,20 +283,24 @@ sub check { $self->ss("$1-$2-$3"); } - return "Unknown state/county/country" - unless qsearchs('cust_main_county',{ - 'state' => $self->state, - 'county' => $self->county, - } ); + $self->country =~ /^(\w\w)$/ or return "Illegal country"; + $self->country($1); + unless ( qsearchs('cust_main_county', { + 'country' => $self->country, + 'state' => '', + } ) ) { + return "Unknown state/county/country" + #" state ". $self->state. " county ". $self->county. " country ". $self->country + unless qsearchs('cust_main_county',{ + 'state' => $self->state, + 'county' => $self->county, + 'country' => $self->country, + } ); + } - #int'l zips? - $self->zip =~ /^(\d{5}(-\d{4})?)$/ or return "Illegal zip"; + $self->zip =~ /^([\w\-]{10})$/ or return "Illegal zip"; $self->zip($1); - #int'l countries! - $self->country =~ /^(US)$/ or return "Illegal country"; - $self->country($1); - $self->payby =~ /^(CARD|BILL|COMP)$/ or return "Illegal payby"; $self->payby($1); @@ -868,7 +876,17 @@ enable cybercash, cybercash v3 support, don't need to import FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21 $Log: cust_main.pm,v $ -Revision 1.3 1998-11-13 09:56:54 ivan +Revision 1.6 1998-11-18 09:01:42 ivan +i18n! i18n! + +Revision 1.5 1998/11/15 11:23:14 ivan +use FS::table_name for all searches to eliminate warnings, +emit state/county when they don't match + +Revision 1.4 1998/11/15 05:30:48 ivan +bugfix for new config layout + +Revision 1.3 1998/11/13 09:56:54 ivan change configuration file layout to support multiple distinct databases (with own set of config files, export, etc.)