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

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



Revision: 3479
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3479&view=rev
Author:   einhverfr
Date:     2011-07-09 13:58:18 +0000 (Sat, 09 Jul 2011)

Log Message:
-----------
Tax setup logic slightly changed, tax checkboxes now work properly on accounts screen

Modified Paths:
--------------
    trunk/UI/accounts/edit.html
    trunk/sql/modules/Account.sql

Modified: trunk/UI/accounts/edit.html
===================================================================
--- trunk/UI/accounts/edit.html	2011-07-09 13:11:00 UTC (rev 3478)
+++ trunk/UI/accounts/edit.html	2011-07-09 13:58:18 UTC (rev 3479)
@@ -129,7 +129,7 @@
                name = 'tax',
                type = 'checkbox',
               label = text('Tax'),
-            checked = checked.tax,
+            checked = tax,
               value = '1'} ?>
    </div>
 </div>

Modified: trunk/sql/modules/Account.sql
===================================================================
--- trunk/sql/modules/Account.sql	2011-07-09 13:11:00 UTC (rev 3478)
+++ trunk/sql/modules/Account.sql	2011-07-09 13:58:18 UTC (rev 3479)
@@ -69,7 +69,11 @@
 	t_heading_id int;
 	t_link record;
 	t_id int;
+        t_tax bool;
 BEGIN
+
+    SELECT count(*) > 0 INTO t_tax FROM tax WHERE in_id = chart_id;
+    t_tax := t_tax OR in_tax;
 	-- check to ensure summary accounts are exclusive
         -- necessary for proper handling by legacy code
     FOR t_link IN SELECT description FROM account_link_description 
@@ -101,7 +105,7 @@
 		gifi_accno = in_gifi_accno,
 		heading = t_heading_id,
 		contra = in_contra,
-                tax = in_tax
+                tax = t_tax
 	WHERE id = in_id;
 
 	IF FOUND THEN


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