summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2010-09-18 03:49:07 +0000
committerivan <ivan>2010-09-18 03:49:07 +0000
commitfe222cc914c17763670d7e21fb0d730c733275a2 (patch)
tree37bd76f30652dfe1b6f98e47be47db8b10091c09
parent9b05a3660eabd3215bdebf9429eb490b41570436 (diff)
ignore bad zip on otaker upgrade
-rw-r--r--FS/FS/cust_main.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 8764c88a4..cf3caca53 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -8,7 +8,7 @@ use base qw( FS::cust_main::Billing FS::cust_main::Billing_Realtime
);
use vars qw( $DEBUG $me $conf
@encrypted_fields
- $import $ignore_expired_card
+ $import $ignore_expired_card $ignore_illegal_zip
$skip_fuzzyfiles @fuzzyfields
@paytypes
);
@@ -75,6 +75,7 @@ $me = '[FS::cust_main]';
$import = 0;
$ignore_expired_card = 0;
+$ignore_illegal_zip = 0;
$skip_fuzzyfiles = 0;
@fuzzyfields = ( 'first', 'last', 'company', 'address1' );
@@ -1800,10 +1801,14 @@ sub check {
$self->ut_phonen('daytime', $self->country)
|| $self->ut_phonen('night', $self->country)
|| $self->ut_phonen('fax', $self->country)
- || $self->ut_zip('zip', $self->country)
;
return $error if $error;
+ unless ( $ignore_illegal_zip ) {
+ $error = $self->ut_zip('zip', $self->country);
+ return $error if $error;
+ }
+
if ( $conf->exists('cust_main-require_phone')
&& ! length($self->daytime) && ! length($self->night)
) {
@@ -1856,10 +1861,13 @@ sub check {
$self->ut_phonen('ship_daytime', $self->ship_country)
|| $self->ut_phonen('ship_night', $self->ship_country)
|| $self->ut_phonen('ship_fax', $self->ship_country)
- || $self->ut_zip('ship_zip', $self->ship_country)
;
return $error if $error;
+ unless ( $ignore_illegal_zip ) {
+ $error = $self->ut_zip('ship_zip', $self->ship_country);
+ return $error if $error;
+ }
return "Unit # is required."
if $self->ship_address2 =~ /^\s*$/
&& $conf->exists('cust_main-require_address2');
@@ -5537,6 +5545,7 @@ sub _upgrade_data { #class method
$sth->execute or die $sth->errstr;
local($ignore_expired_card) = 1;
+ local($ignore_illegal_zip) = 1;
local($skip_fuzzyfiles) = 1;
$class->_upgrade_otaker(%opts);