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

SF.net SVN: ledger-smb:[5705] branches/1.3



Revision: 5705
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5705&view=rev
Author:   einhverfr
Date:     2013-03-24 05:26:55 +0000 (Sun, 24 Mar 2013)
Log Message:
-----------
Contact search fixes

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/sql/modules/Company.sql

Property Changed:
----------------
    branches/1.3/
    branches/1.3/Changelog


Property changes on: branches/1.3
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5515,5519,5524,5526,5528-5529,5533,5544-5546,5548-5549,5554-5555,5563,5565,5569,5576,5579,5589-5590,5597,5602-5603,5608,5610,5615,5617,5620,5622,5633-5634,5649-5650,5655-5657,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702
   + /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5515,5519,5524,5526,5528-5529,5533,5544-5546,5548-5549,5554-5555,5563,5565,5569,5576,5579,5589-5590,5597,5602-5603,5608,5610,5615,5617,5620,5622,5633-5634,5649-5650,5655-5657,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702,5704

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2013-03-24 04:19:18 UTC (rev 5704)
+++ branches/1.3/Changelog	2013-03-24 05:26:55 UTC (rev 5705)
@@ -18,6 +18,7 @@
 * Fixed language code changes delayed (Chris T, 3607220) 
 * Fixed order by on reconciliation screen not working (Chris T, 3607223)
 * Fixed country changes to companies not saving (Chris T, 3607437)
+* Fixed customer search on address data (Chris T, 3607436)
 
 Changelog for 1.3.30
 * Documented behavior of Outstanding Summary report (Chris T, 3601314)


Property changes on: branches/1.3/Changelog
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/Changelog:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5513,5515,5519,5524,5529,5548,5563,5565,5578-5579,5581,5583,5587,5590,5593,5595,5597,5608,5610,5612,5615,5617,5620,5622,5626,5633-5634,5649-5650,5652,5655,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702
   + /trunk/Changelog:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473,5475,5482-5483,5485,5487,5489,5495-5496,5513,5515,5519,5524,5529,5548,5563,5565,5578-5579,5581,5583,5587,5590,5593,5595,5597,5608,5610,5612,5615,5617,5620,5622,5626,5633-5634,5649-5650,5652,5655,5668,5670,5675,5677,5680-5682,5684,5687-5688,5690,5694,5696,5698,5700,5702,5704

Modified: branches/1.3/sql/modules/Company.sql
===================================================================
--- branches/1.3/sql/modules/Company.sql	2013-03-24 04:19:18 UTC (rev 5704)
+++ branches/1.3/sql/modules/Company.sql	2013-03-24 05:26:55 UTC (rev 5705)
@@ -231,44 +231,42 @@
 		LEFT JOIN entity_credit_account ec ON (ec.entity_id = e.id)
 		LEFT JOIN business b ON (ec.business_id = b.id)
 		WHERE coalesce(ec.entity_class,e.entity_class) = in_account_class
-			AND (c.id IN (select company_id FROM company_to_contact
-				WHERE contact ILIKE ALL(t_contact_info))
-				OR '' ILIKE ALL(t_contact_info)
-				OR t_contact_info IS NULL)
+			AND (e.id IN 
+                            (select entity_id 
+                               FROM entity_credit_account leca
+                               JOIN eca_to_contact le2c 
+                                 ON le2c.credit_id = leca.id
+			      WHERE contact ILIKE ALL(t_contact_info))
+			OR '' ILIKE ALL(t_contact_info)
+			OR t_contact_info IS NULL)
 			
 			AND (c.legal_name ilike '%' || in_legal_name || '%'
 				OR in_legal_name IS NULL)
 			AND ((in_address IS NULL AND in_city IS NULL 
 					AND in_state IS NULL 
+                                        AND in_mail_code IS NULL
 					AND in_country IS NULL)
-				OR (c.id IN 
-				(select company_id FROM company_to_location
-				WHERE location_id IN 
-					(SELECT id FROM location
-					WHERE line_one 
-						ilike '%' || 
-							coalesce(in_address, '')
-							|| '%'
-						AND city ILIKE 
-							'%' || 
-							coalesce(in_city, '') 
-							|| '%'
-						AND state ILIKE
-							'%' || 
-							coalesce(in_state, '') 
-							|| '%'
-						AND mail_code ILIKE
-							'%' || 
-							coalesce(in_mail_code,
-								'')
-							|| '%'
-						AND country_id IN 
-							(SELECT id FROM country
-							WHERE name ILIKE '%' ||
-								in_country ||'%'
-								OR short_name
-								ilike 
-								in_country)))))
+				OR (e.id IN 
+			(SELECT entity_id 
+                           FROM entity_credit_account leca 
+                           JOIN eca_to_location le2l 
+                             ON (leca.id = le2l.credit_id)
+                           JOIN location ll ON ll.id = le2l.location_id
+                          WHERE e.id = leca.entity_id 
+                                AND  line_one ilike 
+                                     '%' || coalesce(in_address, '') || '%'
+				AND city ILIKE 
+                                     '%' || coalesce(in_city, '') || '%'
+				AND state ILIKE
+		                     '%' || coalesce(in_state, '') || '%'
+				AND mail_code ILIKE
+                                     '%' || coalesce(in_mail_code, '') || '%'
+				AND country_id IN (SELECT id FROM country
+						    WHERE name ILIKE '%' ||
+					 		  in_country ||'%'
+							  OR short_name
+							  ilike 
+							  in_country))))
 			AND (ec.business_id = 
 				coalesce(in_business_id, ec.business_id)
 				OR (ec.business_id IS NULL 

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