summaryrefslogtreecommitdiff
path: root/sql/modules
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-14 22:59:13 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-14 22:59:13 +0000
commitb90309f0267bdc9063fb5750f5a499d6504bd8a5 (patch)
tree390ca23fbe0824d860719b2411d19dff00248ab5 /sql/modules
parent23145d356c9461d83545f76207afce42d391a20d (diff)
Correcting SQL errors in Payment.sql
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1601 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules')
-rw-r--r--sql/modules/Payment.sql7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql
index bb71703a..9c29ed5d 100644
--- a/sql/modules/Payment.sql
+++ b/sql/modules/Payment.sql
@@ -185,7 +185,8 @@ $$;
CREATE OR REPLACE FUNCTION payment_post
(in_trans_id int, in_source text, in_amount numeric, in_ar_ap_accno text,
- in_cash_accno text, in_approved bool, in_payment_date, in_account_class)
+ in_cash_accno text, in_approved bool, in_payment_date date,
+ in_account_class)
RETURNS INT AS
$$
DECLARE out_entry_id int;
@@ -198,7 +199,7 @@ BEGIN
END,
in_trans_id, in_payment_date, in_approved, in_source);
- INSERT INTO acc_trans (chart_id, amount
+ INSERT INTO acc_trans (chart_id, amount,
trans_id, transdate, approved, source)
VALUES ((SELECT id FROM chart WHERE accno = in_cash_accno),
CASE WHEN in_account_class = 2 THEN in_amount * -1
@@ -215,7 +216,7 @@ $$ LANGUAGE PLPGSQL;
COMMENT ON FUNCTION payment_post
(in_trans_id int, in_source text, in_amount numeric, in_ar_ap_accno text,
in_cash_accno text, in_approved bool, in_payment_date, in_account_class)
-$$
+IS $$
This function takes the following arguments (prefaced with in_ in the db):
trans_id: Id for ar/ap transaction.
source: text for source documnet identifier (for example, check number)