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

SF.net SVN: ledger-smb:[2589] trunk/sql



Revision: 2589
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2589&view=rev
Author:   einhverfr
Date:     2009-05-08 15:52:50 +0000 (Fri, 08 May 2009)

Log Message:
-----------
Pg-database.sql

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

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2009-05-08 15:48:32 UTC (rev 2588)
+++ trunk/sql/Pg-database.sql	2009-05-08 15:52:50 UTC (rev 2589)
@@ -1068,6 +1068,12 @@
   howmany int,
   payment bool default 'f'
 );
+
+CREATE TABLE payment_type (
+  id serial not null unique,
+  label text primary key
+);
+
 --
 CREATE TABLE recurringemail (
   id int,

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2009-05-08 15:48:32 UTC (rev 2588)
+++ trunk/sql/modules/Payment.sql	2009-05-08 15:52:50 UTC (rev 2589)
@@ -16,7 +16,17 @@
 	discount int
 );
 
+CREATE OR REPLACE FUNCTION payment_type__get_label(in_payment_type_id int) RETURNS SETOF payment_types AS
+$$
+DECLARE out_row payment_types%ROWTYPE;
+BEGIN
+	FOR out_row IN SELECT * FROM payment_types where id=in_payment_type_id LOOP
+		RETURN NEXT out_row;
+	END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
 
+
 CREATE OR REPLACE FUNCTION payment_get_entity_accounts
 (in_account_class int,
  in_vc_name text,


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