summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevinse <levinse>2011-01-10 20:14:08 +0000
committerlevinse <levinse>2011-01-10 20:14:08 +0000
commitc34d1fcd9b979bb3598c32dfab4b6d79ccd5a010 (patch)
treeec657e838bb7b8bfdee4e242ea2f4ca3aa2c7879
parent1e1d4445682c0e69781654ea7f2851d861031e9f (diff)
add customer search by billing email, RT10399
-rw-r--r--FS/FS/cust_main/Search.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index ad24ff8..06a4522 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -112,8 +112,17 @@ sub smart_search {
# custnum search (also try agent_custid), with some tweaking options if your
# legacy cust "numbers" have letters
}
-
- if ( $search =~ /^\s*(\d+)\s*$/
+
+
+ if ( $search =~ /@/ ) {
+ push @cust_main,
+ map $_->cust_main,
+ qsearch( {
+ 'table' => 'cust_main_invoice',
+ 'hashref' => { 'dest' => $search },
+ }
+ );
+ } elsif ( $search =~ /^\s*(\d+)\s*$/
|| ( $conf->config('cust_main-agent_custid-format') eq 'ww?d+'
&& $search =~ /^\s*(\w\w?\d+)\s*$/
)