[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1622] trunk/sql/modules/Payment.sql



Revision: 1622
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1622&view=rev
Author:   einhverfr
Date:     2007-09-17 10:24:00 -0700 (Mon, 17 Sep 2007)

Log Message:
-----------
Adding project list stored procedure

Modified Paths:
--------------
    trunk/sql/modules/Payment.sql

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2007-09-17 00:07:35 UTC (rev 1621)
+++ trunk/sql/modules/Payment.sql	2007-09-17 17:24:00 UTC (rev 1622)
@@ -228,3 +228,24 @@
 
 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.$$;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.