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

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



Revision: 2285
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2285&view=rev
Author:   einhverfr
Date:     2008-08-20 03:59:13 +0000 (Wed, 20 Aug 2008)

Log Message:
-----------
Making account numbers clickable on customer/vendor screen, correcting contact editing population (needs a little more work there), and adding control code search

Modified Paths:
--------------
    trunk/UI/Contact/contact.html
    trunk/UI/Contact/search.html
    trunk/UI/ct-search.html
    trunk/sql/modules/Company.sql
    trunk/sql/modules/Person.sql

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2008-08-19 23:32:54 UTC (rev 2284)
+++ trunk/UI/Contact/contact.html	2008-08-20 03:59:13 UTC (rev 2285)
@@ -161,17 +161,17 @@
 		value = account_class
 	} ?>	
 	<?lsmb PROCESS input element_data = {
-		label = text('Control Code:'), #'
-		type= "text",
-		name = "control_code",
-		value = control_code,
+		label = text('Control Code:') #'
+		type= "text"
+		name = "control_code"
+		value = control_code
 		size = "20"
 	} ?><br/>
 	<?lsmb PROCESS input element_data = {
-		label = text('Name:'),
-		type= "text",
-		name = "name",
-		value = name,
+		label = text('Name:')
+		type= "text"
+		name = "name"
+		value = name
 		size = "20"
 	} ?><br/>
         <table>
@@ -231,7 +231,9 @@
             <?lsmb ELSIF cl_item.entity_class == 2 ?><?lsmb text('Customer') ?>
             <?lsmb END ?>
         </td>
-        <td><?lsmb cl_item.meta_number ?></td>
+        <td><a href="<?lsmb script ?>?action=get&account_class=<?lsmb 
+		account_class ?>&entity_id=<?lsmb entity_id 
+		?>&meta_number=<?lsmb cl_item.meta_number ?>"><?lsmb cl_item.meta_number ?></a></td>
         <td><?lsmb cl_item.credit_limit ?></td>
         <td><?lsmb cl_item.start_date ?></td>
         <td><?lsmb cl_item.end_date ?></td>
@@ -589,7 +591,9 @@
 		<td class="contact"><?lsmb ct.contact ?></td>
 		<td class="contact_actions">
 			<a href="<?lsmb script ?>?entity_id=<?lsmb entity_id 
-				?>&contact_id=<?lsmb ct.id 
+				?>&contact=<?lsmb ct.contact 
+				?>&contact_class=<?lsmb ct.class_id
+				?>&description=<?lsmb ct.description 
 				?>&action=edit&credit_id=<?lsmb 
 				credit_id ?>"
 			>[<?lsmb text('Edit'); ?>]</a>&nbsp;&nbsp;
@@ -618,13 +622,15 @@
 		name="contact_id" 
 		value=contact_id
 	} ?>
-	<div><label for="contact_type"><?lsmb text('Type:') ?></label>
-		<select name="contact_class" id="contact_type">
-		<?lsmb FOREACH cc = contact_class_list ?>
-		<option value="<?lsmb cc.id ?>"><?lsmb cc.class ?></option>
-		<?lsmb END ?>
-		</select>
-		<!-- TODO:  Move the above select list to elements.html -CT -->
+	<div>
+		<?lsmb PROCESS select element_data = {
+			name = "contact_class"
+			label = "Type"
+			text_attr = "class"
+			value_attr = "id"
+			default_values = [contact_class]		
+			options = contact_class_list
+		} ?>
 	</div>
 	<div>
 		<?lsmb PROCESS input element_data = {

Modified: trunk/UI/Contact/search.html
===================================================================
--- trunk/UI/Contact/search.html	2008-08-19 23:32:54 UTC (rev 2284)
+++ trunk/UI/Contact/search.html	2008-08-20 03:59:13 UTC (rev 2285)
@@ -30,6 +30,15 @@
                 <th align="right"><?lsmb text('Company Name') ?></th>
                 <td><?lsmb INCLUDE input element_data={size = '32', name = 'legal_name'} ?></td>
               </tr>
+             <tr>
+                <th align="right"><?lsmb text('Control Code') ?></th>
+		<td><?lsmb PROCESS input element_data = {
+			size = 32
+			name = "control_code"
+			type = "text"
+			value = control_code
+			} ?></td>
+             </tr>
               <tr>
                 <th align="right"><?lsmb text('Contact') ?></th>
                 <td><?lsmb INCLUDE input element_data={size = '32', name = 'contact'} ?></td>

Modified: trunk/UI/ct-search.html
===================================================================
--- trunk/UI/ct-search.html	2008-08-19 23:32:54 UTC (rev 2284)
+++ trunk/UI/ct-search.html	2008-08-20 03:59:13 UTC (rev 2285)
@@ -15,6 +15,15 @@
                 <th align="right"><?lsmb text('Company Name') ?></th>
                 <td><?lsmb PROCESS input element_data={size => '32', name => 'name'} ?></td>
               </tr>
+             <tr>
+                <th align="right"><?lsmb text('Control Code') ?></th>
+		<td><?lsmb PROCESS input element_data = {
+			size = 32
+			name = "control_code"
+			type = "text"
+			value = control_code
+			} ?></td>
+             </tr>
               <tr>
                 <th align="right"><?lsmb text('Contact') ?></th>
                 <td><?lsmb PROCESS input element_data={size => '32', name => 'contact'} ?></td>

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2008-08-19 23:32:54 UTC (rev 2284)
+++ trunk/sql/modules/Company.sql	2008-08-20 03:59:13 UTC (rev 2285)
@@ -16,7 +16,7 @@
 (in_account_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_date_from date, in_date_to date,
-	in_business_id int, in_legal_name text)
+	in_business_id int, in_legal_name text, in_control_code text)
 RETURNS SETOF company_search_result AS $$
 DECLARE
 	out_row company_search_result;
@@ -34,6 +34,8 @@
 		JOIN entity_credit_account ec ON (ec.entity_id = e.id)
 		LEFT JOIN business b ON (ec.business_id = b.id)
 		WHERE ec.entity_class = in_account_class
+			AND (e.control_code = in_control_code 
+				or in_control_code IS NULL)
 			AND (c.id IN (select company_id FROM company_to_contact
 				WHERE contact LIKE ALL(t_contact_info))
 				OR '' LIKE ALL(t_contact_info))
@@ -438,6 +440,7 @@
 
 CREATE TYPE contact_list AS (
 	class text,
+	class_id int,
 	description text,
 	contact text
 );
@@ -447,7 +450,7 @@
 DECLARE out_row contact_list;
 BEGIN
 	FOR out_row IN
-		SELECT cl.class, c.description, c.contact
+		SELECT cl.class, cl.id, c.description, c.contact
 		FROM company_to_contact c
 		JOIN contact_class cl ON (c.contact_class_id = cl.id)
 		WHERE company_id = 
@@ -699,7 +702,7 @@
 DECLARE out_row contact_list;
 BEGIN
 	FOR out_row IN
-		SELECT cl.class, c.description, c.contact
+		SELECT cl.class, cl.id, c.description, c.contact
 		FROM eca_to_contact c
 		JOIN contact_class cl ON (c.contact_class_id = cl.id)
 		WHERE credit_id = in_credit_id

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2008-08-19 23:32:54 UTC (rev 2284)
+++ trunk/sql/modules/Person.sql	2008-08-20 03:59:13 UTC (rev 2285)
@@ -106,7 +106,7 @@
 DECLARE out_row RECORD;
 BEGIN
 	FOR out_row IN 
-		SELECT cc.class, c.description, c.contact
+		SELECT cc.class, cc.id, c.description, c.contact
 		FROM person_to_contact c
 		JOIN contact_class cc ON (c.contact_class_id = cc.id)
 		JOIN person p ON (c.person_id = p.id)


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