summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-20 21:06:06 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-08-20 21:06:06 +0000
commit49c0b62ecacd828569849c4a05607f4161f0cbac (patch)
tree778fa12f1a1c33678e5b38300d5b947a5ab716b0
parent9924b1bea3e50f6a1570a44d43577bb544e282cc (diff)
Correcting issues with editing contact info
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2287 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--UI/Contact/contact.html10
-rw-r--r--sql/modules/Company.sql8
2 files changed, 17 insertions, 1 deletions
diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html
index 3bf7f1a3..7c22bfe1 100644
--- a/UI/Contact/contact.html
+++ b/UI/Contact/contact.html
@@ -619,6 +619,16 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
} ?>
<?lsmb PROCESS input element_data = {
type="hidden"
+ name="old_contact_class"
+ value=contact_class
+ } ?>
+ <?lsmb PROCESS input element_data = {
+ type="hidden"
+ name="old_contact"
+ value=contact
+ } ?>
+ <?lsmb PROCESS input element_data = {
+ type="hidden"
name="contact_id"
value=contact_id
} ?>
diff --git a/sql/modules/Company.sql b/sql/modules/Company.sql
index 04056164..4cd0e2cd 100644
--- a/sql/modules/Company.sql
+++ b/sql/modules/Company.sql
@@ -713,11 +713,17 @@ END;
$$ language plpgsql;
CREATE OR REPLACE FUNCTION eca__save_contact
-(in_credit_id int, in_contact_class int, in_description text, in_contact text)
+(in_credit_id int, in_contact_class int, in_description text, in_contact text,
+in_old_contact text, in_old_contact_class int)
RETURNS INT AS
$$
DECLARE out_id int;
BEGIN
+ DELETE FROM eca_to_contact
+ WHERE credit_id = in_credit_id
+ AND contact = in_old_contact
+ AND contact_class_id = in_old_contact_class;
+
INSERT INTO eca_to_contact(credit_id, contact_class_id,
description, contact)
VALUES (in_credit_id, in_contact_class, in_description, in_contact);