summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2007-03-20 17:03:43 +0000
committerjeff <jeff>2007-03-20 17:03:43 +0000
commit587f0384fb03179f6b504daeada93e193d2ea27f (patch)
tree0998d5d51ac6112bb80b24031fe7fdfdacc0d48d /FS
parent7b3d074cbb694330334469510548d98eebe196ed (diff)
ticket 1418, a tool for customer note importation
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 9c4b8bed7..f6270e1d4 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -4115,7 +4115,8 @@ sub fuzzy_search {
Accepts the following options: I<search>, the string to search for. The string
will be searched for as a customer number, phone number, name or company name,
as an exact, or, in some cases, a substring or fuzzy match (see the source code
-for the exact heuristics used).
+for the exact heuristics used); I<no_fuzzy_on_exact>, causes smart_search to
+skip fuzzy matching when an exact match is found.
Any additional options are treated as an additional qualifier on the search
(i.e. I<agentnum>).
@@ -4132,6 +4133,7 @@ sub smart_search {
my @cust_main = ();
+ my $skip_fuzzy = delete $options{'no_fuzzy_on_exact'};
my $search = delete $options{'search'};
( my $alphanum_search = $search ) =~ s/\W//g;
@@ -4269,7 +4271,7 @@ sub smart_search {
#always do substring & fuzzy,
#getting complains searches are not returning enough
- #unless ( @cust_main ) { #no exact match, trying substring/fuzzy
+ unless ( @cust_main && $skip_fuzzy ) { #no exact match, trying substring/fuzzy
#still some false laziness w/ search/cust_main.cgi
@@ -4330,7 +4332,7 @@ sub smart_search {
FS::cust_main->fuzzy_search( { $field => $value }, @fuzopts );
}
- #}
+ }
#eliminate duplicates
my %saw = ();