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

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



Revision: 4846
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4846&view=rev
Author:   einhverfr
Date:     2012-06-06 02:22:30 +0000 (Wed, 06 Jun 2012)
Log Message:
-----------
Correcting error in history report class that caused a crash
Contact search now allows you to search notes, full text, too.

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/DBObject/Report/Contact/History.pm
    trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
    trunk/UI/Reports/filters/contact_search.html
    trunk/dists/rpm/ledgersmb.spec
    trunk/dists/source/build.sh
    trunk/sql/modules/Company.sql

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/Changelog	2012-06-06 02:22:30 UTC (rev 4846)
@@ -30,6 +30,7 @@
 Customer/Vendor Handling 
 * Added sales tax id and license number fields for companies (Chris T)
 * Simpified database schema (Chris T)
+* Full text search of notes for customers/vendors (Chris T)
 
 New CSV Import Module
 * Imports GL transactions (Chris T)

Modified: trunk/LedgerSMB/DBObject/Report/Contact/History.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Contact/History.pm	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/LedgerSMB/DBObject/Report/Contact/History.pm	2012-06-06 02:22:30 UTC (rev 4846)
@@ -24,7 +24,7 @@
 
 =cut
 
-package LedgerSMB::DBObject::Report::Contact::Search;
+package LedgerSMB::DBObject::Report::Contact::History;
 use Moose;
 extends 'LedgerSMB::DBObject::Report';
 use LedgerSMB::App_State;

Modified: trunk/LedgerSMB/DBObject/Report/Contact/Search.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/LedgerSMB/DBObject/Report/Contact/Search.pm	2012-06-06 02:22:30 UTC (rev 4846)
@@ -161,6 +161,14 @@
 
 has meta_number => (is => 'ro', isa => 'Maybe[Str]');
 
+=item notes
+
+Full text search of all entity/eca notes
+
+=cut
+
+has notes => (is => 'ro', isa => 'Maybe[Str]');
+
 =item address
 
 Full text search (fully matching) on any address line.

Modified: trunk/UI/Reports/filters/contact_search.html
===================================================================
--- trunk/UI/Reports/filters/contact_search.html	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/UI/Reports/filters/contact_search.html	2012-06-06 02:22:30 UTC (rev 4846)
@@ -58,11 +58,10 @@
                 <td><?lsmb INCLUDE input element_data={size = '32', name = 'employee'} ?></td>
 <?lsmb END -?>
               </tr>
-              <!-- tr>
                 <th align="right"><?lsmb text('Notes') ?></th>
                 <td><?lsmb INCLUDE textarea element_data={
   rows = '3', cols = '32', name = 'notes'} ?></td>
-              </tr -->
+              </tr>
             </table>
           </td>
           <td>

Modified: trunk/dists/rpm/ledgersmb.spec
===================================================================
--- trunk/dists/rpm/ledgersmb.spec	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/dists/rpm/ledgersmb.spec	2012-06-06 02:22:30 UTC (rev 4846)
@@ -1,7 +1,7 @@
 # RPM spec written for and tested on CentOS 4 and CentOS 5 
 Summary: LedgerSMB - Open Source accounting software
 Name: ledgersmb
-Version: 1.3.9990104635
+Version: 1.3.9990204845
 Release: 1
 License: GPL
 URL: http://www.ledgersmb.org/

Modified: trunk/dists/source/build.sh
===================================================================
--- trunk/dists/source/build.sh	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/dists/source/build.sh	2012-06-06 02:22:30 UTC (rev 4846)
@@ -2,7 +2,7 @@
 
 # Simple script to prepare for release
 
-version="1.3.9990104635";
+version="1.3.9990204845";
 build_d="../release";
 
 if test -d $build_d/ledgersmb; then

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2012-06-06 01:46:27 UTC (rev 4845)
+++ trunk/sql/modules/Company.sql	2012-06-06 02:22:30 UTC (rev 4846)
@@ -234,13 +234,20 @@
 meta_number must match exactly or be NULL.  inc_open and inc_closed are exact
 matches too.  All other values specify ranges or may match partially.$$;
 
---HV coalesce(ec.entity_class,e.entity_class) in case entity but not yet entity_credit_account
+DROP FUNCTION IF EXISTS  contact__search
+(in_entity_class int, in_contact text, in_contact_info text[],
+        in_meta_number text, in_address text, in_city text, in_state text,
+        in_mail_code text, in_country text, in_active_date_from date,
+        in_active_date_to date,
+        in_business_id int, in_name_part text, in_control_code text);
+
 CREATE OR REPLACE FUNCTION contact__search
 (in_entity_class int, in_contact text, in_contact_info text[], 
 	in_meta_number text, in_address text, in_city text, in_state text, 
 	in_mail_code text, in_country text, in_active_date_from date, 
         in_active_date_to date,
-	in_business_id int, in_name_part text, in_control_code text)
+	in_business_id int, in_name_part text, in_control_code text,
+        in_notes text)
 RETURNS SETOF contact_search_result AS $$
 DECLARE
 	out_row contact_search_result;
@@ -337,6 +344,11 @@
 				OR (ec.enddate IS NULL))
 	 		AND (ec.meta_number like in_meta_number || '%'
 			     OR in_meta_number IS NULL)
+                        AND (in_notes IS NULL OR e.id in (
+                                     SELECT entity_id from entity_note
+                                      WHERE note @@ plainto_tsquery(in_notes))
+                                  OR ec.id IN (select ref_key FROM eca_note
+                                     WHERE note @@ plainto_tsquery(in_notes)))
 	LOOP
 		RETURN NEXT out_row;
 	END LOOP;

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