From: Ivan Kohler Date: Tue, 26 Jan 2016 18:46:55 +0000 (-0800) Subject: import customers with echeck payment info, RT#39863 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=2c94fadec581ea4decc7eb425ce78f6013703860 import customers with echeck payment info, RT#39863 --- diff --git a/FS/FS/cust_main/Import.pm b/FS/FS/cust_main/Import.pm index a243b275f..b5fb2746c 100644 --- a/FS/FS/cust_main/Import.pm +++ b/FS/FS/cust_main/Import.pm @@ -400,11 +400,23 @@ sub batch_import { } if ( defined $cust_main{'payinfo'} && length $cust_main{'payinfo'} ) { - $cust_main{'payby'} = 'CARD'; - if ($cust_main{'payinfo'} =~ /\s*([AD]?)(.*)\s*$/) { - $cust_main{'payby'} = 'DCRD' if $1 eq 'D'; - $cust_main{'payinfo'} = $2; + + if ( $cust_main{'payinfo'} =~ /^\s*(\d+\@[\d\.]+)\s*$/ ) { + + $cust_main{'payby'} = 'CHEK'; + $cust_main{'payinfo'} = $1; + + } else { + + $cust_main{'payby'} = 'CARD'; + + if ($cust_main{'payinfo'} =~ /^\s*([AD]?)(.*)\s*$/) { + $cust_main{'payby'} = 'DCRD' if $1 eq 'D'; + $cust_main{'payinfo'} = $2; + } + } + } $cust_main{$_} = parse_datetime($cust_main{$_})