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

SF.net SVN: ledger-smb: [2145] branches/1.2/sql/fixes/ar_ap_summary_fix_1.2 .14.sql



Revision: 2145
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2145&view=rev
Author:   einhverfr
Date:     2008-05-14 14:40:07 -0700 (Wed, 14 May 2008)

Log Message:
-----------
better approach to handling negative amounts on the fix.

Modified Paths:
--------------
    branches/1.2/sql/fixes/ar_ap_summary_fix_1.2.14.sql

Modified: branches/1.2/sql/fixes/ar_ap_summary_fix_1.2.14.sql
===================================================================
--- branches/1.2/sql/fixes/ar_ap_summary_fix_1.2.14.sql	2008-05-14 21:38:06 UTC (rev 2144)
+++ branches/1.2/sql/fixes/ar_ap_summary_fix_1.2.14.sql	2008-05-14 21:40:07 UTC (rev 2145)
@@ -13,12 +13,11 @@
 			)
 		)
 	ELSE
-		-1 *
 		(select sum(amount) from acc_trans 
 		where trans_id = ap.id 
 			AND ((chart_id IN 
 				(select id from chart where link = 'AP')
-				     AND amount > 0)
+				     AND amount < 0)
 				OR (chart_id IN 
 					(select id from chart 
 					where link like '%tax%')
@@ -44,12 +43,12 @@
 				)
 			)
 		)
-	ELSE 
+	ELSE  -1 *
 		(select sum(amount) from acc_trans 
 		where trans_id = ar.id 
 			AND ((chart_id IN (select id from chart 
 				where link = 'AR')
-				     AND amount < 0)
+				     AND amount > 0)
 			OR (chart_id IN 
 				(select id from chart where link like '%tax%')
 				)


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