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

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



Revision: 2691
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2691&view=rev
Author:   einhverfr
Date:     2009-06-16 17:20:47 +0000 (Tue, 16 Jun 2009)

Log Message:
-----------
Moving reconciliation routines to account table from chart table for performance reasons.

Modified Paths:
--------------
    trunk/dists/source/build.sh
    trunk/sql/modules/Reconciliation.sql

Modified: trunk/dists/source/build.sh
===================================================================
--- trunk/dists/source/build.sh	2009-06-16 16:34:08 UTC (rev 2690)
+++ trunk/dists/source/build.sh	2009-06-16 17:20:47 UTC (rev 2691)
@@ -2,7 +2,7 @@
 
 # Simple script to prepare for release
 
-version="1.3.0_milestone_2";
+version="1.3.0_milestone_3";
 build_d="../release";
 
 if test -d $build_d/ledgersmb; then

Modified: trunk/sql/modules/Reconciliation.sql
===================================================================
--- trunk/sql/modules/Reconciliation.sql	2009-06-16 16:34:08 UTC (rev 2690)
+++ trunk/sql/modules/Reconciliation.sql	2009-06-16 17:20:47 UTC (rev 2691)
@@ -114,7 +114,7 @@
 $$
 	select CASE WHEN c.category = 'A' THEN sum(ac.amount) * -1 ELSE
 		sum(ac.amount) END
-	FROM chart c
+	FROM account c
 	JOIN acc_trans ac ON (ac.chart_id = c.id)
 	JOIN (select id from ar where approved
 		union
@@ -433,7 +433,7 @@
 BEGIN
 	FOR report IN
 		SELECT r.* FROM cr_report r
-		JOIN chart c ON (r.chart_id = c.id)
+		JOIN account c ON (r.chart_id = c.id)
 		WHERE 
 			(in_date_from IS NULL OR in_date_from <= end_date) and
 			(in_date_to IS NULL OR in_date_to >= end_date) AND
@@ -462,7 +462,7 @@
     SELECT 
         coa.accno || ' ' || coa.description as name,
         coa.accno, coa.id as id
-    FROM chart coa, cr_coa_to_account cta
+    FROM account coa, cr_coa_to_account cta
     WHERE cta.chart_id = coa.id
     ORDER BY coa.accno;
 $$ language sql;
@@ -472,7 +472,7 @@
 $$
 DECLARE outval NUMERIC;
 BEGIN
-	SELECT CASE WHEN (select category FROM chart WHERE id = in_account_id)
+	SELECT CASE WHEN (select category FROM account WHERE id = in_account_id)
 			IN ('A', 'E') THEN sum(a.amount) * -1
 		ELSE sum(a.amount) END
 	FROM acc_trans a


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