summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2019-05-24 10:51:08 -0400
committerChristopher Burger <burgerc@freeside.biz>2019-05-28 12:24:28 -0400
commitd0ccab3fd755d1f3b81b8cfc27e99665ee3f20ec (patch)
tree15653ccca14ed1bc24b56196fc046184046beb0e /FS
parentaf9ff3772e41d0464c024364157d92ac1e679c10 (diff)
RT# 77532 - can search cust main phone numbers in advanced customer search
Conflicts: httemplate/search/cust_main.html httemplate/search/report_cust_main.html
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main/Search.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index fcb3efc3b..8073ce102 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -791,6 +791,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
###