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

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



Revision: 3108
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3108&view=rev
Author:   einhverfr
Date:     2010-10-28 20:45:39 +0000 (Thu, 28 Oct 2010)

Log Message:
-----------
CC/BCC contact classes
1099 signing problems

Modified Paths:
--------------
    trunk/UI/rp-search.html
    trunk/sql/Pg-database.sql
    trunk/sql/modules/1099_reports.sql

Modified: trunk/UI/rp-search.html
===================================================================
--- trunk/UI/rp-search.html	2010-10-28 20:39:07 UTC (rev 3107)
+++ trunk/UI/rp-search.html	2010-10-28 20:45:39 UTC (rev 3108)
@@ -14,7 +14,7 @@
           <td colspan="3"><?lsmb PROCESS select element_data=form.selectdepartment ?></td>
         </tr>
 <?lsmb END ?>
-<?lsmb INCLUDE "rp-search-${subform}.html" ?>
+<?lsmb INCLUDE "rp-search-generate_trial_balance.html" ?>
 <?lsmb IF gifi ?>
         <tr>
           <th align="right"><?lsmb text('Accounts') ?></th>
@@ -38,13 +38,15 @@
 <?lsmb IF form.report == 'trial_balance' or form.report == 'projects' ?>
 	<tr>
 	  <th align="right"><?lsmb text('Ignore Year-ends'); ?></th>
-	  <td><?lsmb PROCESS select element_data = {
-		options = form.yearend_options,
-		default_values = [form.ignore_yearend],
-		name = 'ignore_yearend',
-		text_attr = 'label',
-		value_attr = 'id',
-              } ?></td>
+	  <td>
+	      <?lsmb PROCESS select element_data = {
+                 options = form.yearend_options,
+                 default_values = [form.ignore_yearend],
+                 name = 'ignore_yearend',
+                 text_attr = 'label',
+                 value_attr = 'id',
+           }?>
+       </td>
 	</tr>
 <?lsmb END ?>
       </table>

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2010-10-28 20:39:07 UTC (rev 3107)
+++ trunk/sql/Pg-database.sql	2010-10-28 20:45:39 UTC (rev 3108)
@@ -612,6 +612,8 @@
 INSERT INTO contact_class (id,class) values (10,'Generic Jabber');
 INSERT INTO contact_class (id,class) values (11,'Home Phone');
 INSERT INTO contact_class (id,class) values (12,'Email');
+INSERT INTO contact_class (id,class) values (13,'CC');
+INSERT INTO contact_class (id,class) values (14,'BCC');
 
 SELECT SETVAL('contact_class_id_seq',12);
 

Modified: trunk/sql/modules/1099_reports.sql
===================================================================
--- trunk/sql/modules/1099_reports.sql	2010-10-28 20:39:07 UTC (rev 3107)
+++ trunk/sql/modules/1099_reports.sql	2010-10-28 20:45:39 UTC (rev 3108)
@@ -41,7 +41,10 @@
                               ELSE 0 END), 
                      sum(CASE WHEN relation = 'invoice' THEN ac.amount 
                               ELSE 0 END), 
-                     sum(ac.amount)
+                     sum(CASE WHEN gl.class = 'ar' then ac.amount
+                                   ELSE ac.amount * -1
+                                   END
+                           )
 		FROM (select id, transdate, entity_credit_account, 'ar' as class FROM ar 
                        UNION 
                       select id, transdate, entity_credit_account, 'ap' as class from ap
@@ -82,16 +85,24 @@
               SELECT company.legal_name, company.entity_id, 
                      entity_credit_account.entity_class, entity.control_code, 
                      entity_credit_account.meta_number, 
-                     sum(CASE WHEN relation = 'acc_trans' THEN ac.amount 
+                     sum(CASE WHEN relation = 'acc_trans' THEN 
+                                   CASE WHEN gl.class = 'ar' then ac.amount
+                                   ELSE ac.amount * -1
+                                   END
                               ELSE 0 END), 
-                     sum(CASE WHEN relation = 'invoice' THEN ac.amount 
+                     sum(CASE WHEN relation = 'invoice' THEN
+                              CASE WHEN gl.class = 'ar' then ac.amount
+                                   ELSE ac.amount * -1
+                              END
                               ELSE 0 END), 
-                     sum(ac.amount),
+                     sum(CASE WHEN gl.class = 'ar' then ac.amount
+                                   ELSE ac.amount * -1
+                                   END),
                      gl.invnumber, gl.duedate::text
-                FROM (select id, entity_credit_account, invnumber, duedate, transdate
+                FROM (select id, entity_credit_account, invnumber, duedate, transdate, 'ar' as class
                         FROM ar 
                        UNION 
-                      select id, entity_credit_account, invnumber, duedate, transdate
+                      select id, entity_credit_account, invnumber, duedate, transdate, 'ap' as class
                         FROM ap
                      ) gl 
                 JOIN (select trans_id, 'acc_trans' as relation, amount as amount, 


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