diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-05-17 21:38:10 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-05-17 21:38:10 +0000 |
commit | f62f4e8a8bc9cabe957d06be2f4fc1ddb21260a6 (patch) | |
tree | a98214b4217dc9248fad17bd940e0a0fbdeef8ef | |
parent | a82d735ee2cc76fac7902d10fc8996f090642043 (diff) |
Correcting all load errors for all working scripts on Pg 8.1.x and above.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2150 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | sql/Pg-database.sql | 6 | ||||
-rw-r--r-- | sql/modules/Payment.sql | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sql/Pg-database.sql b/sql/Pg-database.sql index 26f5f29e..fc8e79a1 100644 --- a/sql/Pg-database.sql +++ b/sql/Pg-database.sql @@ -78,7 +78,7 @@ CREATE TABLE transactions ( id int PRIMARY KEY, table_name text, locked_by int references "session" (session_id) ON DELETE SET NULL, - approved_by int references "users" (entity_id), + approved_by int references entity (id), approved_at timestamp ); @@ -504,7 +504,9 @@ values ('Inventory Entity', currval('entity_id_seq')); INSERT INTO entity_credit_account (entity_id, meta_number, entity_class) VALUES -(currval('entity_id_seq'), '00000', 1), +(currval('entity_id_seq'), '00000', 1); +INSERT INTO entity_credit_account (entity_id, meta_number, entity_class) +VALUES (currval('entity_id_seq'), '00000', 2); diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql index b3b9d1c2..dc6ac74a 100644 --- a/sql/modules/Payment.sql +++ b/sql/modules/Payment.sql @@ -385,8 +385,12 @@ BEGIN CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, - t_voucher_id, in_payment_date, in_source), + t_voucher_id, in_payment_date, in_source); + INSERT INTO acc_trans + (trans_id, chart_id, amount, approved, voucher_id, + transdate, source) + VALUES (in_transactions[out_count][1], case when in_account_class = 1 THEN t_ar_ap_id WHEN in_account_class = 2 THEN t_cash_id @@ -743,7 +747,11 @@ BEGIN in_date_reversed, in_source, 'Reversing ' || COALESCE(in_source, ''), case when in_batch_id is not null then false - else true end, t_voucher_id), + else true end, t_voucher_id); + INSERT INTO acc_trans + (trans_id, chart_id, amount, transdate, source, memo, approved, + voucher_id) + VALUES (pay_row.trans_id, pay_row.ar_ap_account_id, pay_row.amount, in_date_reversed, in_source, 'Reversing ' || COALESCE(in_source, ''), |