summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-22 06:19:05 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-11-22 06:19:05 +0000
commit08e1b04d20e4f328638fbde9f7a2ae54a3dca966 (patch)
tree1191bd1b7d8bad8873a95b864e108e8358ae2345 /sql
parenta7badcbfb8db7f379590d66031137efb9f65717c (diff)
First (unsuccessful) attempt to automatically handle number formatting in the template engine..
Customer screen enhancements as well. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1890 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Customer.sql29
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/modules/Customer.sql b/sql/modules/Customer.sql
index 500556f5..3ce11f30 100644
--- a/sql/modules/Customer.sql
+++ b/sql/modules/Customer.sql
@@ -227,6 +227,35 @@ BEGIN
END;
$$ LANGUAGE PLPGSQL;
+CREATE OR REPLACE FUNCTION entity__save_bank_account
+(in_entity_id int, in_bic text, in_iban text)
+RETURNS int AS
+$$
+DECLARE out_id int;
+BEGIN
+ INSERT INTO entity_bank_account(entity_id, bic, iban)
+ VALUES(in_entity_id, in_bic, in_iban);
+
+ SELECT CURRVAL('entity_bank_account_id_seq') INTO out_id ;
+
+ RETURN out_id;
+END;
+$$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION company__save_contact
+(in_entity_id int, in_contact_class int, in_contact text)
+RETURNS INT AS
+$$
+DECLARE out_id int;
+BEGIN
+ INSERT INTO company_to_contact(company_id, contact_class_id, contact)
+ SELECT id, in_contact_class, in_contact FROM company
+ WHERE entity_id = in_entity_id;
+
+ RETURN 1;
+END;
+$$ LANGUAGE PLPGSQL;
+
CREATE TYPE entity_note_list AS (
id int,
note text