diff options
author | ivan <ivan> | 2009-11-17 22:06:51 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-11-17 22:06:51 +0000 |
commit | 012d0eb8b78e68b1c3ea8da6af659ade6a976351 (patch) | |
tree | 1b3ce74fa30be400e8a0eb58e0ede0b8adacab3b /FS/FS/cust_main.pm | |
parent | 2e5ab3c55cab5d72c3f41518dba2ed728e991b90 (diff) |
do a case-insensive search on browser-remembered results, so starting to use USPS verification (which UPPERCASES everything) doesn't invalidate everything your browser remembered in quick payment entry
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r-- | FS/FS/cust_main.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 5d4e47e..3c4eb44 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -8810,17 +8810,21 @@ sub smart_search { # "Company (Last, First)" #this is probably something a browser remembered, - #so just do an exact (but case-insensitive) search + #so just do an exact search (but case-insensitive, so USPS standardization + #doesn't throw a wrench in the works) foreach my $prefix ( '', 'ship_' ) { push @cust_main, qsearch( { 'table' => 'cust_main', - 'hashref' => { $prefix.'first' => $first, - $prefix.'last' => $last, - $prefix.'company' => $company, - %options, - }, - 'extra_sql' => " AND $agentnums_sql", + 'hashref' => { %options }, + 'extra_sql' => + ( keys(%options) ? ' AND ' : ' WHERE ' ). + join(' AND ', + " LOWER(${prefix}first) = ". dbh->quote(lc($first)), + " LOWER(${prefix}last) = ". dbh->quote(lc($last)), + " LOWER(${prefix}company) = ". dbh->quote(lc($company)), + $agentnums_sql, + ), } ); } |