From 2cbc631a817e19dcfe4b61d2fd856e87f01d3509 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Fri, 24 May 2019 10:51:08 -0400 Subject: RT# 77532 - can search cust main phone numbers in advanced customer search --- FS/FS/cust_main/Search.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'FS/FS/cust_main') diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 63f10fb..479ebf5 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)) { + 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 ### -- cgit v1.1