[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2364] trunk/sql/modules
- Subject: SF.net SVN: ledger-smb:[2364] trunk/sql/modules
- From: ..hidden..
- Date: Fri, 10 Oct 2008 18:57:51 +0000
Revision: 2364
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2364&view=rev
Author: einhverfr
Date: 2008-10-10 18:57:51 +0000 (Fri, 10 Oct 2008)
Log Message:
-----------
Renaming broken Account.sql function (currently unused by app)
All Account.sql tests now pass.
Modified Paths:
--------------
trunk/sql/modules/Account.sql
trunk/sql/modules/chart.sql
trunk/sql/modules/test/Account.sql
Modified: trunk/sql/modules/Account.sql
===================================================================
--- trunk/sql/modules/Account.sql 2008-10-10 18:25:24 UTC (rev 2363)
+++ trunk/sql/modules/Account.sql 2008-10-10 18:57:51 UTC (rev 2364)
@@ -10,7 +10,7 @@
END;
$$ LANGUAGE plpgsql;
-CREATE OR REPLACE FUNCTION account_is_orphaned (in_id int) RETURNS bool AS
+CREATE OR REPLACE FUNCTION account_has_transactions (in_id int) RETURNS bool AS
$$
BEGIN
PERFORM trans_id FROM acc_trans WHERE chart_id = in_id LIMIT 1;
Modified: trunk/sql/modules/chart.sql
===================================================================
--- trunk/sql/modules/chart.sql 2008-10-10 18:25:24 UTC (rev 2363)
+++ trunk/sql/modules/chart.sql 2008-10-10 18:57:51 UTC (rev 2364)
@@ -34,6 +34,7 @@
END LOOP;
END;
$$ language plpgsql;
+
COMMENT ON FUNCTION chart_list_cash(in_account_class int) IS
$$ This function returns the cash account acording with in_account_class which must be 1 or 2 $$;
@@ -80,5 +81,6 @@
END LOOP;
END;
$$ language plpgsql;
+
COMMENT ON FUNCTION chart_list_cash(in_account_class int) IS
$$ This function returns the overpayment accounts acording with in_account_class which must be 1 or 2 $$;
Modified: trunk/sql/modules/test/Account.sql
===================================================================
--- trunk/sql/modules/test/Account.sql 2008-10-10 18:25:24 UTC (rev 2363)
+++ trunk/sql/modules/test/Account.sql 2008-10-10 18:57:51 UTC (rev 2364)
@@ -8,6 +8,10 @@
INSERT INTO chart (description, charttype, category, accno)
VALUES ('TEST testing 2', 'A', 'A', '00002');
+INSERT INTO ap (invnumber, netamount, amount) VALUES ('TEST', '0', '0');
+INSERT INTO acc_trans (trans_id, chart_id, amount)
+VALUES (currval('id')::int, currval('chart_id_seq')::int, '0');
+
INSERT INTO chart (description, charttype, category, accno, link)
VALUES ('TEST AP 1', 'A', 'L', '00003', 'AP');
@@ -71,15 +75,11 @@
INSERT INTO test_result(test_name, success)
VALUES ('Accounts created', currval('chart_id_seq') is not null);
-INSERT INTO ap (invnumber, netamount, amount) VALUES ('TEST', '0', '0');
-INSERT INTO acc_trans (trans_id, chart_id, amount)
-VALUES (currval('id')::int, currval('chart_id_seq')::int, '0');
-
INSERT INTO test_result(test_name, success)
-VALUES ('Chart 1 is orphaned', account_is_orphaned((select id from chart where description = 'TEST testing 1')));
+VALUES ('Chart 1 is orphaned', account_has_transactions((select id from chart where description = 'TEST testing 1')) is false);
INSERT INTO test_result(test_name, success)
-VALUES ('Chart 2 is not orphaned', account_is_orphaned(currval('chart_id_seq')::int) is false);
+VALUES ('Chart 2 is not orphaned', account_has_transactions((select id from chart where accno = '00002')) is true);
INSERT INTO test_result(test_name, success)
SELECT 'All Test Accounts Exist', count(*) = 22 FROM chart_list_all()
@@ -116,7 +116,4 @@
|| (select count(*) from test_result where success is not true)
|| ' failed' as message;
-\echo This currently fails 2 tests due to some confusion as to
-\echo account_is_orphaned is supposed to do.
-
ROLLBACK;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.