[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[5768] trunk



Revision: 5768
          http://sourceforge.net/p/ledger-smb/code/5768
Author:   einhverfr
Date:     2013-05-11 09:49:01 +0000 (Sat, 11 May 2013)
Log Message:
-----------
Refining contact search criteria, and documenting search type choices, as well as reviewing what we currently have

Modified Paths:
--------------
    trunk/LedgerSMB/Report/Contact/Search.pm
    trunk/sql/modules/Company.sql

Modified: trunk/LedgerSMB/Report/Contact/Search.pm
===================================================================
--- trunk/LedgerSMB/Report/Contact/Search.pm	2013-05-11 09:03:04 UTC (rev 5767)
+++ trunk/LedgerSMB/Report/Contact/Search.pm	2013-05-11 09:49:01 UTC (rev 5768)
@@ -115,7 +115,9 @@
 
 =item name_part
 
-Full text search on contact name.
+Full text search on contact name.  This also matches the beginning of a 
+company's name.  So Acme Software Testing Inc would come up under searches of
+'Ac', 'Software', 'Software Tester', and so forth but not 'Sting' or 'are.'
 
 =cut
 
@@ -179,7 +181,7 @@
 
 =item city
 
-Exact match on city
+City contains this string.
 
 =cut
 
@@ -187,7 +189,7 @@
 
 =item state
 
-Exact match on state/province
+State or province contains this string
 
 =cut
 

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2013-05-11 09:03:04 UTC (rev 5767)
+++ trunk/sql/modules/Company.sql	2013-05-11 09:49:01 UTC (rev 5768)
@@ -276,6 +276,7 @@
 		JOIN (SELECT legal_name, sic_code, entity_id 
                         FROM company 
                        WHERE legal_name @@ plainto_tsquery(in_name_part)
+                             OR legal_name ilike 'in_name_part' || '%'
                       UNION ALL
                       SELECT legal_name, sic_code, entity_id
                         FROM company
@@ -325,7 +326,7 @@
 					AND state ILIKE
 					    '%' || coalesce(in_state, '') || '%'
 					AND mail_code ILIKE
-		   			    '%' || coalesce(in_mail_code, '') || '%'
+		   			    coalesce(in_mail_code, '') || '%'
 					AND country_id 
                                             IN (SELECT id FROM country
 						 WHERE name ilike in_country
@@ -357,6 +358,8 @@
 END;
 $$ language plpgsql;
 
+
+
 DROP FUNCTION IF EXISTS eca__get_taxes(in_credit_id int);
 
 CREATE OR REPLACE FUNCTION eca__get_taxes(in_id int)

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.