projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
79f6314
)
fix up smart searching to make the quick payment entry behave better
author
ivan
<ivan>
Mon, 24 Jul 2006 22:40:37 +0000
(22:40 +0000)
committer
ivan
<ivan>
Mon, 24 Jul 2006 22:40:37 +0000
(22:40 +0000)
FS/FS/cust_main.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
2b95644
..
f4568a8
100644
(file)
--- 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);
} 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
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;
}
@cust_main;