[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2745] trunk/sql/modules/test
- Subject: SF.net SVN: ledger-smb:[2745] trunk/sql/modules/test
- From: ..hidden..
- Date: Fri, 07 Aug 2009 06:03:29 +0000
Revision: 2745
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2745&view=rev
Author: einhverfr
Date: 2009-08-07 06:03:29 +0000 (Fri, 07 Aug 2009)
Log Message:
-----------
Test case updates
Modified Paths:
--------------
trunk/sql/modules/test/Account.sql
trunk/sql/modules/test/Base.sql
trunk/sql/modules/test/Company.sql
trunk/sql/modules/test/Draft.sql
trunk/sql/modules/test/Payment.sql
trunk/sql/modules/test/Reconciliation.sql
trunk/sql/modules/test/Session.sql
trunk/sql/modules/test/Voucher.sql
trunk/sql/modules/test/data/Reconciliation.sql
Modified: trunk/sql/modules/test/Account.sql
===================================================================
--- trunk/sql/modules/test/Account.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Account.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -8,11 +8,13 @@
INSERT INTO chart (description, charttype, category, accno)
VALUES ('TEST testing 2', 'A', 'A', '00002');
-INSERT INTO entity (id, control_code, name, entity_class)
-values (-100, 'test1', 'test', 3);
-INSERT INTO entity_credit_account (id, meta_number, entity_id, entity_class)
-values (-100, 'test1', -100, 1);
+INSERT INTO entity (id, control_code, name, entity_class, country_id)
+values (-100, 'test1', 'test', 3, 242);
+
+INSERT INTO entity_credit_account (id, meta_number, entity_id, entity_class, ar_ap_account_id)
+values (-100, 'test1', -100, 1, -1000);
+
INSERT INTO ap (invnumber, netamount, amount, entity_credit_account, id)
VALUES ('TEST', '0', '0', -100, -100);
INSERT INTO acc_trans (trans_id, chart_id, amount)
Modified: trunk/sql/modules/test/Base.sql
===================================================================
--- trunk/sql/modules/test/Base.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Base.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -5,6 +5,9 @@
select account_heading_save(NULL, '000000000000000000000', 'TEST', NULL);
+INSERT INTO account(id, accno, description, category, heading, contra)
+values (-1000, '-1000000000', 'Test cases only', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false);
+
CREATE OR REPLACE FUNCTION test_get_account_id(in_accno text) returns int as
$$
SELECT id FROM chart WHERE accno = $1;
Modified: trunk/sql/modules/test/Company.sql
===================================================================
--- trunk/sql/modules/test/Company.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Company.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -11,7 +11,7 @@
SELECT 'Saving Credit Acct',
entity_credit_save( NULL , 1, currval('entity_id_seq')::int, 'TEST', 0, false,
0, 0, 0, 'test-123', NULL, NULL, NULL, 'USD', now()::date, now()::date,
- 0, NULL, NULL, NULL)
+ 0, -1000, NULL, NULL)
IS NOT NULL;
INSERT INTO test_result (test_name, success)
@@ -23,9 +23,9 @@
INSERT INTO test_result (test_name, success)
SELECT 'eca_location_save returns same id with same args and no in_location_id',
eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 1, 'Test2', 'Test',
- '', 'Test', 'Test', '12345', 25) =
- eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 2, 'Test2', 'Test',
- '', 'Test', 'Test', '12345', 25);
+ '', 'Test', 'Test123', '12345', 25) =
+ eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 3, 'Test2', 'Test',
+ '', 'Test', 'Test123', '12345', 25);
INSERT INTO test_result (test_name, success)
SELECT 'list_locations', count(*) = 3
Modified: trunk/sql/modules/test/Draft.sql
===================================================================
--- trunk/sql/modules/test/Draft.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Draft.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -3,10 +3,10 @@
INSERT INTO entity (id, entity_class, name, country_id)
VALUES (-1000, 1, '__TEST', 243);
-INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id)
-VALUES (-1000, '_testv', 1, -1000);
-INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id)
-VALUES (-1001, '_testc', 2, -1000);
+INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id, ar_ap_account_id)
+VALUES (-1000, '_testv', 1, -1000, -1000);
+INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id, ar_ap_account_id)
+VALUES (-1001, '_testc', 2, -1000, -1000);
SELECT account_save(NULL, '00001', 'test only', 'A', NULL, NULL, FALSE, '{}');
SELECT account_save(NULL, '00002', 'test only', 'A', NULL, NULL, FALSE, '{}');
INSERT INTO ap (invnumber, entity_credit_account, amount, netamount, paid,
Modified: trunk/sql/modules/test/Payment.sql
===================================================================
--- trunk/sql/modules/test/Payment.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Payment.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -1,16 +1,16 @@
BEGIN;
\i Base.sql
-INSERT INTO entity (id, name, entity_class, control_code)
-VALUES (-100, 'Testing.....', 3, '_TESTING.....');
+INSERT INTO entity (id, name, entity_class, control_code, country_id)
+VALUES (-100, 'Testing.....', 3, '_TESTING.....', 242);
DELETE FROM users WHERE username = CURRENT_USER;
INSERT INTO users (entity_id, username)
SELECT -100, CURRENT_USER;
-INSERT INTO entity(name, id, entity_class, control_code)
-values ('test user 1', -200, 3, 'Test User 1');
+INSERT INTO entity(name, id, entity_class, control_code, country_id)
+values ('test user 1', -200, 3, 'Test User 1', 242);
insert into users (entity_id, username, id)
values (-200, '_test1', -200);
@@ -37,8 +37,8 @@
INSERT INTO test_result(test_name, success)
SELECT 'AP Batch created', (SELECT batch_create('test', 'test', 'ap', now()::date)) IS NOT NULL;
-INSERT INTO entity (id, entity_class, name, control_code)
-VALUES (-101, 1, 'TEST VENDOR', 'TEST 2');
+INSERT INTO entity (id, entity_class, name, control_code, country_id)
+VALUES (-101, 1, 'TEST VENDOR', 'TEST 2', 242);
INSERT INTO company (id, legal_name, entity_id)
VALUES (-101, 'TEST', -101);
@@ -46,8 +46,8 @@
INSERT INTO business (id, description)
values (-101, 'test');
-INSERT INTO entity_credit_account (id, meta_number, threshold, entity_id, entity_class, business_id)
-values (-101, 'TEST1', 100000, -101, 1, -101);
+INSERT INTO entity_credit_account (id, meta_number, threshold, entity_id, entity_class, business_id, ar_ap_account_id)
+values (-101, 'TEST1', 100000, -101, 1, -101, -1000);
INSERT INTO ap (invnumber, entity_credit_account, approved, amount, netamount, curr)
values ('test_hide', -101, false, '1', '1', 'USD');
Modified: trunk/sql/modules/test/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/Reconciliation.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Reconciliation.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -2,7 +2,8 @@
\i Base.sql
\i data/Reconciliation.sql
-INSERT INTO entity (id, control_code, name, entity_class) values (-50, 'Test User', 'Test User', 3);
+
+INSERT INTO entity (id, control_code, name, entity_class, country_id) values (-50, 'Test User', 'Test User', 3, 242);
INSERT INTO person (id, entity_id, first_name, last_name) values (-50, -50, 'Test', 'Usr');
INSERT INTO users (id, entity_id, username) values (-50, -50, SESSION_USER);
Modified: trunk/sql/modules/test/Session.sql
===================================================================
--- trunk/sql/modules/test/Session.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Session.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -5,8 +5,8 @@
values ('timeout set',
(select count(*) from defaults where setting_key = 'timeout') = 1);
-INSERT INTO entity (name, entity_class, control_code)
-VALUES ('Testing.....', 3, '_TESTING.....');
+INSERT INTO entity (name, entity_class, control_code, country_id)
+VALUES ('Testing.....', 3, '_TESTING.....',242);
INSERT INTO users (entity_id, username)
SELECT currval('entity_id_seq'), CURRENT_USER;
Modified: trunk/sql/modules/test/Voucher.sql
===================================================================
--- trunk/sql/modules/test/Voucher.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/Voucher.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -5,10 +5,10 @@
SELECT 'Batch Created',
batch_create('_TEST', '_TEST', 'payment', '2008-01-01') IS NOT NULL;
-INSERT INTO entity (id, name, entity_class, control_code)
-values (-3, 'Test', 1, 'test');
-INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class)
-values (-3, -1, 'Test', 1);
+INSERT INTO entity (id, name, entity_class, control_code, country_id)
+values (-3, 'Test', 1, 'test', 242);
+INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id)
+values (-3, -1, 'Test', 1, -1000);
INSERT INTO entity_employee(entity_id) values (-3);
Modified: trunk/sql/modules/test/data/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/data/Reconciliation.sql 2009-07-28 19:41:16 UTC (rev 2744)
+++ trunk/sql/modules/test/data/Reconciliation.sql 2009-08-07 06:03:29 UTC (rev 2745)
@@ -3,10 +3,10 @@
INSERT INTO chart (id, accno, description, category, charttype) values (-200, '-11111', 'Test Acct 1', 'A', 'A');
INSERT INTO chart (id, accno, description, category, charttype) values (-201, '-11112', 'Test Acct 2', 'A', 'A');
-INSERT INTO entity (id, control_code, name, entity_class) values (-200, '-11111', 'Test 1', 1);
+INSERT INTO entity (id, control_code, name, entity_class, country_id) values (-200, '-11111', 'Test 1', 1, 242);
-INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class) values (-200, -200, 'T-11111', 1);
-INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class) values (-200, -201, 'T-11112', 1);
+INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-200, -200, 'T-11111', 1, -1000);
+INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-200, -201, 'T-11112', 1, -1000);
INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate) values (-200, '-2000', '10', '10', '0', -200, '1000-01-01');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.