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

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



Revision: 2480
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2480&view=rev
Author:   einhverfr
Date:     2009-03-06 01:07:11 +0000 (Fri, 06 Mar 2009)

Log Message:
-----------
Correcting recon set approval.

Modified Paths:
--------------
    trunk/sql/modules/Reconciliaton.sql
    trunk/sql/modules/test/Reconciliation.sql
    trunk/t/43-dbtest.t

Modified: trunk/sql/modules/Reconciliaton.sql
===================================================================
--- trunk/sql/modules/Reconciliaton.sql	2009-03-05 22:40:08 UTC (rev 2479)
+++ trunk/sql/modules/Reconciliaton.sql	2009-03-06 01:07:11 UTC (rev 2480)
@@ -119,7 +119,7 @@
 		LEFT JOIN cr_report_line rl ON (rl.report_id = in_report_id
 			AND ((rl.ledger_id = ac.entry_id 
 				AND ac.voucher_id IS NULL) 
-				OR (rl.voucher_id = ac.voucher_id)))
+				OR (rl.voucher_id = ac.voucher_id)) and rl.cleared is true)
 		WHERE ac.cleared IS FALSE
 			AND ac.chart_id = (select chart_id from cr_report where id = in_report_id)
 		GROUP BY gl.ref, ac.source, ac.transdate,

Modified: trunk/sql/modules/test/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/Reconciliation.sql	2009-03-05 22:40:08 UTC (rev 2479)
+++ trunk/sql/modules/test/Reconciliation.sql	2009-03-06 01:07:11 UTC (rev 2480)
@@ -28,29 +28,50 @@
 SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int));
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
+SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Transactions closed', count(*) = 0 FROM acc_trans where chart_id = -200 and cleared is false;
+SELECT '1 Transactions closed', count(*) = 0 FROM acc_trans where chart_id = -200 and cleared is false;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Create Recon Report', 
+SELECT '1 Create Recon Report', 
 	reconciliation__new_report_id(-201, 100, now()::date) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Pending Transactions Ran', reconciliation__pending_transactions(now()::date, -201, currval('cr_report_id_seq')::int) > 0;
+SELECT '1 Pending Transactions Ran', reconciliation__pending_transactions(now()::date, -201, currval('cr_report_id_seq')::int) > 0;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Correct number of GL groups', count(*) = 4 from cr_report_line where scn like '% gl %' and report_id = currval('cr_report_id_seq')::int;
+SELECT '1 Correct number of GL groups', count(*) = 4 from cr_report_line where scn like '% gl %' and report_id = currval('cr_report_id_seq')::int;
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Correct number of report lines', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int;
+SELECT '1 Correct number of report lines', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int;
 
 
 INSERT INTO test_result(test_name, success)
-SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int));
+SELECT '1 Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, '{}');
 
+
 INSERT INTO test_result(test_name, success)
+SELECT '1 Cleared balance pre-approval is 10', reconciliation__get_cleared_balance(-201) = 10;
+
+INSERT INTO test_result(test_name, success)
+SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0;
+
+INSERT INTO test_result(test_name, success)
+SELECT '1 Transactions open', count(*) = 12 FROM acc_trans where chart_id = -201 and cleared is false;
+
+INSERT INTO test_result(test_name, success)
+SELECT '1 Cleared balance post-approval is 10', reconciliation__get_cleared_balance(-201) = 10;
+
+
+INSERT INTO test_result(test_name, success)
+SELECT '1 Create Recon Report', 
+	reconciliation__new_report_id(-201, 100, now()::date) > 0;
+
+INSERT INTO test_result(test_name, success)
+SELECT '1 Pending Transactions Ran', reconciliation__pending_transactions(now()::date, -201, currval('cr_report_id_seq')::int) > 0;
+
+
 SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int));
 
 INSERT INTO test_result(test_name, success)

Modified: trunk/t/43-dbtest.t
===================================================================
--- trunk/t/43-dbtest.t	2009-03-05 22:40:08 UTC (rev 2479)
+++ trunk/t/43-dbtest.t	2009-03-06 01:07:11 UTC (rev 2480)
@@ -5,7 +5,7 @@
 	plan skip_all => 'Skipping all.  Told not to test db.';
 }
 else {
-	plan tests => 74;
+	plan tests => 80;
 	if (defined $ENV{LSMB_NEW_DB}){
 		$ENV{PGDATABASE} = $ENV{LSMB_NEW_DB};
 	}


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