[freeside-commits] freeside/FS/FS cust_main.pm, 1.464.2.6, 1.464.2.7

Ivan,,, ivan at wavetail.420.am
Tue Nov 17 14:07:01 PST 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15031/FS/FS

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	cust_main.pm 
Log Message:
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

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.464.2.6
retrieving revision 1.464.2.7
diff -u -d -r1.464.2.6 -r1.464.2.7
--- cust_main.pm	16 Nov 2009 03:55:26 -0000	1.464.2.6
+++ cust_main.pm	17 Nov 2009 22:06:59 -0000	1.464.2.7
@@ -8684,17 +8684,21 @@
 
     # "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,
+          ),
       } );
     }
 



More information about the freeside-commits mailing list