diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-26 17:46:47 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-26 17:46:47 +0000 |
commit | 1d53d40656d58bc4a0293bbaa3001b3be40d6b23 (patch) | |
tree | 4d28cd9bdf48e8c8c88ce27a9b35c391aa84396f /sql/modules | |
parent | 5b24f1bd3c5acc9fd200f0384495adb8bb8e512f (diff) |
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
Diffstat (limited to 'sql/modules')
-rw-r--r-- | sql/modules/Payment.sql | 30 |
1 files 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.$$; + + + + |