summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/IS.pm2
-rw-r--r--UI/Contact/contact.html9
-rw-r--r--sql/modules/Company.sql12
-rw-r--r--sql/modules/Location.sql1
-rw-r--r--sql/modules/Payment.sql3
-rw-r--r--sql/modules/Person.sql4
6 files changed, 22 insertions, 9 deletions
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index 8f804089..0fb7203a 100644
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -787,7 +787,7 @@ sub customer_details {
# get rest for the customer
my $query = qq|
SELECT c.customernumber, e.name, l.line_one as address1,
- l.line_two as address2, l.city_province AS city,
+ l.line_two as address2, l.city AS city,
'' as state, l.mail_code AS zipcode,
country.name as country,
'' as contact, '' as customerphone, '' as customerfax,
diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html
index 68a14a05..2f1e7d09 100644
--- a/UI/Contact/contact.html
+++ b/UI/Contact/contact.html
@@ -533,6 +533,15 @@ problems with multi-word single-quoted constructs in PI tags. -CT -->
</div>
<div>
<?lsmb PROCESS input element_data = {
+ label = text('Description:'),
+ name = "description"
+ value = description
+ type = "text"
+ size = "20"
+ } #' ?>
+ </div>
+ <div>
+ <?lsmb PROCESS input element_data = {
label = text('Contact Info:'),
name = "contact"
value = contact
diff --git a/sql/modules/Company.sql b/sql/modules/Company.sql
index d935317d..df6967a4 100644
--- a/sql/modules/Company.sql
+++ b/sql/modules/Company.sql
@@ -291,7 +291,7 @@ DECLARE out_row RECORD;
BEGIN
FOR out_row IN
SELECT l.id, l.line_one, l.line_two, l.line_three, l.city,
- l.state, c.name, lc.class
+ l.state, l.mail_code, c.name, lc.class
FROM location l
JOIN company_to_location ctl ON (ctl.location_id = l.id)
JOIN company cp ON (ctl.company_id = cp.id)
@@ -307,6 +307,7 @@ $$ LANGUAGE PLPGSQL;
CREATE TYPE contact_list AS (
class text,
+ description text,
contact text
);
@@ -315,7 +316,7 @@ RETURNS SETOF contact_list AS $$
DECLARE out_row contact_list;
BEGIN
FOR out_row IN
- SELECT cl.class, c.contact
+ SELECT cl.class, c.description, c.contact
FROM company_to_contact c
JOIN contact_class cl ON (c.contact_class_id = cl.id)
WHERE company_id =
@@ -357,13 +358,14 @@ END;
$$ LANGUAGE PLPGSQL;
CREATE OR REPLACE FUNCTION company__save_contact
-(in_entity_id int, in_contact_class int, in_contact text)
+(in_entity_id int, in_contact_class int, in_description text, 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
+ INSERT INTO company_to_contact(company_id, contact_class_id,
+ description, contact)
+ SELECT id, in_contact_class, in_description, in_contact FROM company
WHERE entity_id = in_entity_id;
RETURN 1;
diff --git a/sql/modules/Location.sql b/sql/modules/Location.sql
index c91a93a8..b90e11c7 100644
--- a/sql/modules/Location.sql
+++ b/sql/modules/Location.sql
@@ -131,6 +131,7 @@ CREATE TYPE location_result AS (
line_three text,
city text,
state text,
+ mail_code text,
country text,
class text
);
diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql
index 7f82a88e..b3b9d1c2 100644
--- a/sql/modules/Payment.sql
+++ b/sql/modules/Payment.sql
@@ -606,6 +606,7 @@ CREATE TYPE payment_location_result AS (
line_three text,
city text,
state text,
+ mail_code text
country text,
class text
);
@@ -622,7 +623,7 @@ DECLARE out_row RECORD;
BEGIN
FOR out_row IN
SELECT l.id, l.line_one, l.line_two, l.line_three, l.city,
- l.state, c.name, lc.class
+ l.state, l.mail_code, c.name, lc.class
FROM location l
JOIN company_to_location ctl ON (ctl.location_id = l.id)
JOIN company cp ON (ctl.company_id = cp.id)
diff --git a/sql/modules/Person.sql b/sql/modules/Person.sql
index 160eeb2e..98b4dcb1 100644
--- a/sql/modules/Person.sql
+++ b/sql/modules/Person.sql
@@ -86,7 +86,7 @@ DECLARE out_row RECORD;
BEGIN
FOR out_row IN
SELECT l.id, l.line_one, l.line_two, l.line_three, l.city,
- l.state, c.name, lc.class
+ l.state, l.mail_code, c.name, lc.class
FROM location l
JOIN person_to_location ctl ON (ctl.location_id = l.id)
JOIN person p ON (ctl.person_id = p.id)
@@ -106,7 +106,7 @@ $$
DECLARE out_row RECORD;
BEGIN
FOR out_row IN
- SELECT cc.class, c.contact
+ SELECT cc.class, c.description, 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)