summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-12 23:36:59 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-12 23:36:59 +0000
commit4dc9e97ad999bb6ea4fe5171be988ee8e6c156dc (patch)
treedf614c362f79409c7bbd98ece957f2846a2bface /sql
parent8cf90bc4e677ea04ea73b718b64d59f83c2ec01c (diff)
Adding drop down box to set primary entity class for companies.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2323 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Entity.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/modules/Entity.sql b/sql/modules/Entity.sql
index 71eca451..9f7a5ac8 100644
--- a/sql/modules/Entity.sql
+++ b/sql/modules/Entity.sql
@@ -37,6 +37,19 @@ CREATE OR REPLACE FUNCTION entity_save(
$$ language 'plpgsql';
+CREATE OR REPLACE FUNCTION entity__list_classes ()
+RETURNS SETOF entity_class AS $$
+DECLARE out_row entity_class;
+BEGIN
+ FOR out_row IN
+ SELECT * FROM entity_class
+ WHERE active
+ ORDER BY id
+ LOOP
+ RETURN NEXT out_row;
+ END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
CREATE OR REPLACE FUNCTION entity__get_entity (
in_entity_id int