diff options
author | ivan <ivan> | 2006-07-24 22:40:37 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-07-24 22:40:37 +0000 |
commit | c4dd2593a5cf5c4463a9180fbc5aef1f2c76f6e2 (patch) | |
tree | ac2b7f78990a0f0c8e8c81d3500161b5931befa5 | |
parent | 79f6314575d140a09b362129e5ee580468059e99 (diff) |
fix up smart searching to make the quick payment entry behave better
-rw-r--r-- | FS/FS/cust_main.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 2b9564442..f4568a8a0 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3866,6 +3866,11 @@ sub smart_search { } elsif ( $search =~ /^\s*(\S.*\S)\s*$/ ) { #value search my $value = lc($1); + + # remove "(Last, First)" in "Company (Last, First"), otherwise the + # full strings the browser remembers won't work + $value =~ s/\([\w \,\.\-\']*\)$//; #false laziness w/Record::ut_name + my $q_value = dbh->quote($value); #exact @@ -3938,6 +3943,10 @@ sub smart_search { } + #eliminate duplicates + my %saw = (); + @cust_main = grep { !$saw{$_->custnum}++ } @cust_main; + } @cust_main; |