X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FSearch.pm;h=25216c6d65a0414f3dc31a79db64e487eb55df15;hb=4fd1280540e2c9b90fa59c0c32d691f5222f65d4;hp=63f10fb649052e9673bdf0c8b2d3eb3dbe4615aa;hpb=a98de57aee063b3ff737c283336f83b2e50e14a8;p=freeside.git diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 63f10fb64..25216c6d6 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -789,6 +789,21 @@ sub search { )"; } + ## + # phones + ## + + foreach my $phonet (qw(daytime night mobile fax)) { + if ($params->{$phonet}) { + $params->{$phonet} =~ s/\D//g; + $params->{$phonet} =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/ + or next; + my $phonen = "$1-$2-$3"; + if ($4) { push @where, "cust_main.".$phonet." = '".$phonen." x$4'"; } + else { push @where, "cust_main.".$phonet." like '".$phonen."%'"; } + } + } + ### # refnum ###