summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-17 23:22:02 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2008-09-17 23:22:02 +0000
commit9e2e27bda4a44c0303cea5bc774d566e2e9f40df (patch)
tree3d991af2d844ed9940cf78085252454e8c7f5419 /sql
parentc4ff29592269fdc248c0a27736dcad1227c3a998 (diff)
Further fixes to Reconciliation, the new Admin interface, and a small change to Company.sql
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2327 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Company.sql1
-rw-r--r--sql/modules/Employee.sql4
-rw-r--r--sql/modules/Person.sql4
-rw-r--r--sql/modules/admin.sql8
4 files changed, 9 insertions, 8 deletions
diff --git a/sql/modules/Company.sql b/sql/modules/Company.sql
index 7d9dd747..a102fa1c 100644
--- a/sql/modules/Company.sql
+++ b/sql/modules/Company.sql
@@ -463,7 +463,6 @@ $$ LANGUAGE PLPGSQL;
CREATE TYPE contact_list AS (
class text,
class_id int,
- description text,
contact text
);
diff --git a/sql/modules/Employee.sql b/sql/modules/Employee.sql
index 78920ea6..ae2efc86 100644
--- a/sql/modules/Employee.sql
+++ b/sql/modules/Employee.sql
@@ -17,13 +17,13 @@ returns int AS $$
select * into e from entity where id = in_entity and entity_class = 3;
IF NOT FOUND THEN
- RAISE EXCEPTION 'No entity found for ID %', in_id;
+ RAISE EXCEPTION 'No entity found for ID %', in_entity;
END IF;
select * into p from person where id = in_person;
IF NOT FOUND THEN
- RAISE EXCEPTION 'No person found for ID %', in_id;
+ RAISE EXCEPTION 'No person found for ID %', in_person;
END IF;
-- Okay, we're good. Check to see if we update or insert.
diff --git a/sql/modules/Person.sql b/sql/modules/Person.sql
index cd84fefc..9eda8335 100644
--- a/sql/modules/Person.sql
+++ b/sql/modules/Person.sql
@@ -1,6 +1,6 @@
begin;
-CREATE OR REPLACE FUNCTION person_save
+CREATE OR REPLACE FUNCTION person__save
(in_entity_id integer, in_salutation_id int,
in_first_name text, in_middle_name text, in_last_name text
)
@@ -106,7 +106,7 @@ $$
DECLARE out_row RECORD;
BEGIN
FOR out_row IN
- SELECT cc.class, cc.id, c.description, c.contact
+ SELECT cc.class, cc.id, c.contact
FROM person_to_contact c
JOIN contact_class cc ON (c.contact_class_id = cc.id)
JOIN person p ON (c.person_id = p.id)
diff --git a/sql/modules/admin.sql b/sql/modules/admin.sql
index c7dc3d9b..f590aa94 100644
--- a/sql/modules/admin.sql
+++ b/sql/modules/admin.sql
@@ -481,15 +481,17 @@ $$ language plpgsql;
create or replace function admin__user_preferences (in_user int) returns setof user_preference as $$
declare
- v_row user_preferences;
+ v_row user_preference;
BEGIN
- select * into v_row from user_preference where user_id = in_user;
+ select * into v_row from user_preference where id = in_user;
IF NOT FOUND THEN
- RAISE EXCEPTION "Could not find user preferences for id %", in_user;
+ RAISE EXCEPTION 'Could not find user preferences for id %', in_user;
ELSE
return next v_row;
END IF;
+END;
+$$ language plpgsql;
commit; \ No newline at end of file