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

SF.net SVN: ledger-smb:[4825] trunk/sql/modules/Company.sql



Revision: 4825
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4825&view=rev
Author:   einhverfr
Date:     2012-06-03 11:10:42 +0000 (Sun, 03 Jun 2012)
Log Message:
-----------
persons as customers/vendors working as search and only bug fixed applied to companies as well

Modified Paths:
--------------
    trunk/sql/modules/Company.sql

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2012-06-03 10:24:30 UTC (rev 4824)
+++ trunk/sql/modules/Company.sql	2012-06-03 11:10:42 UTC (rev 4825)
@@ -265,14 +265,18 @@
                         FROM company
                        WHERE in_name_part IS NULL
                       UNION ALL
-                     SELECT first_name || ' ' || middle_name || ' ' 
-                            || last_name, null, entity_id
+                     SELECT coalesce(first_name, '') || ' ' 
+                            || coalesce(middle_name, '') || ' ' 
+                            || coalesce(last_name, ''), null, entity_id
                        FROM person
-                      WHERE first_name || ' ' || middle_name || ' '
-                            || last_name @@ plainto_tsquery(in_name_part)
+                      WHERE coalesce(first_name, '') || ' ' 
+                            || coalesce(middle_name, '') || ' '
+                            || coalesce(last_name, '') 
+                             @@ plainto_tsquery(in_name_part)
                       UNION ALL
-                     SELECT first_name || ' ' || middle_name || ' ' 
-                            || last_name, null, entity_id
+                     SELECT coalesce(first_name, '') || ' ' 
+                            || coalesce(middle_name, '') || ' ' 
+                            || coalesce(last_name, ''), null, entity_id
                        FROM person
                        WHERE in_name_part IS NULL) c ON (e.id = c.entity_id)
 		LEFT JOIN entity_credit_account ec ON (ec.entity_id = e.id)

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