summaryrefslogtreecommitdiff
path: root/FS/FS/cust_main
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS/cust_main')
-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 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
###