X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=dbb0144ff7b194ccf9769d422d34aaaeddb2083a;hb=7965de6cbd9f9795acc5fc27d6597a5ce63f6434;hp=53ecf5b8e2407c6d6531a68509dd3efe52ad74b0;hpb=5e76ae4e7a11bd28478ed68eef8124fb7ff0767c;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 53ecf5b8e..dbb0144ff 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2032,14 +2032,15 @@ sub check { my $payinfo = $self->payinfo; $payinfo =~ s/[^\d\@\.]//g; - if ( $conf->exists('cust_main-require-bank-branch') ) { - $payinfo =~ /^(\d+)\@(\d+)\.(\d+)$/ or return 'invalid echeck account@branch.bank'; + if ( $conf->config('echeck-country') eq 'CA' ) { + $payinfo =~ /^(\d+)\@(\d{5})\.(\d{3})$/ + or return 'invalid echeck account@branch.bank'; $payinfo = "$1\@$2.$3"; - } elsif ( $conf->exists('echeck-nonus') ) { - $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@aba'; + } elsif ( $conf->config('echeck-country') eq 'US' ) { + $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account@aba'; $payinfo = "$1\@$2"; } else { - $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account@aba'; + $payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account@routing'; $payinfo = "$1\@$2"; } $self->payinfo($payinfo); @@ -5035,6 +5036,8 @@ sub process_censustract_update { # then it's a tract code $cust_main->set('censustract', $new_tract); $cust_main->set('censusyear', $new_year); + + local($import) = 1; #prevent automatic geocoding (need its own variable?) my $error = $cust_main->replace; die $error if $error; } @@ -5062,6 +5065,10 @@ sub _upgrade_data { #class method "UPDATE cust_main SET paydate = SUBSTRING(paydate FROM 1 FOR 5) || '0' || SUBSTRING(paydate FROM 6) WHERE SUBSTRING(paydate FROM 7 FOR 1) = '-'"; } + push @statements, #fix the weird BILL with a cc# in payinfo problem + #DCRD to be safe, or CARD? + "UPDATE cust_main SET payby = 'DCRD' WHERE payby = 'BILL' and length(payinfo) = 16"; + foreach my $sql ( @statements ) { my $sth = dbh->prepare($sql) or die dbh->errstr; $sth->execute or die $sth->errstr;