diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-17 17:24:00 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-17 17:24:00 +0000 |
commit | b85dd91eabe25cd1bb56248b0e11cfd21a36adfa (patch) | |
tree | 5ecba67b36e24220e5ab3028e5531c27acb83836 | |
parent | 55082e51902015bea55f710756f8962b8254860b (diff) |
Adding project list stored procedure
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1622 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | sql/modules/Payment.sql | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql index 8f7f052c..61a68940 100644 --- a/sql/modules/Payment.sql +++ b/sql/modules/Payment.sql @@ -228,3 +228,24 @@ approved: False, for a voucher. This function posts the payment or saves the payment voucher. $$; + + +-- Move this to the projects module when we start on that. CT +CREATE OR REPLACE FUNCTION project_list_open(in_date date) +RETURNS SETOF project AS +$$ +DECLARE out_project project%ROWTYPE; +BEGIN + FOR out_project IN + SELECT * from project + WHERE startdate <= in_date AND enddate >= in_date + AND completed = 0 + LOOP + return next out_project; + END LOOP; +END; +$$ 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.$$; |