diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-22 06:19:05 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-11-22 06:19:05 +0000 |
commit | 08e1b04d20e4f328638fbde9f7a2ae54a3dca966 (patch) | |
tree | 1191bd1b7d8bad8873a95b864e108e8358ae2345 /sql | |
parent | a7badcbfb8db7f379590d66031137efb9f65717c (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.sql | 29 |
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 |