summaryrefslogtreecommitdiff
path: root/sql/modules
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-17 17:24:00 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-09-17 17:24:00 +0000
commitb85dd91eabe25cd1bb56248b0e11cfd21a36adfa (patch)
tree5ecba67b36e24220e5ab3028e5531c27acb83836 /sql/modules
parent55082e51902015bea55f710756f8962b8254860b (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
Diffstat (limited to 'sql/modules')
-rw-r--r--sql/modules/Payment.sql21
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.$$;