From 1d53d40656d58bc4a0293bbaa3001b3be40d6b23 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Wed, 26 Sep 2007 17:46:47 +0000 Subject: Applying David Mora's patch to Payment.sql git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1669 4979c152-3d1c-0410-bac9-87ea11338e46 --- sql/modules/Payment.sql | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql index 61a68940..7b771734 100644 --- a/sql/modules/Payment.sql +++ b/sql/modules/Payment.sql @@ -186,7 +186,7 @@ $$; 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 date, - in_account_class) + in_account_class int) RETURNS INT AS $$ DECLARE out_entry_id int; @@ -215,7 +215,8 @@ $$ 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) + in_cash_accno text, in_approved bool, in_payment_date, + in_account_class int) IS $$ This function takes the following arguments (prefaced with in_ in the db): trans_id: Id for ar/ap transaction. @@ -249,3 +250,28 @@ $$ language plpgsql; comment on function project_list_open(in_date date) is $$ This function returns all projects that were open as on the date provided as the argument.$$; + + + +-- Move this to the projects module when we start on that. CT +CREATE OR REPLACE FUNCTION department_list(in_role char) +RETURNS SETOF department AS +$$ +DECLARE out_department department%ROWTYPE; +BEGIN + FOR out_department IN + SELECT * from department + WHERE role = in_role + LOOP + return next out_department; + END LOOP; +END; +$$ language plpgsql; + +comment on function department_list(in_role char) is +$$ This function returns all department that match the role provided as +the argument.$$; + + + + -- cgit v1.2.3